Troubleshooting
SDK Session Has No Model
What to do when a local Agent SDK run fails because the session has no model
SDK Session Has No Model
This is one of the most common local SDK problems.
Reason
Local SDK sessions do not have a model unless the host provides one.
You can fix it in either way:
const agent = new Agent({
id: "repo-helper",
path: "/path/to/project",
model,
});or:
await session.set({ model });Correct order
const session = await agent.session();
const turn = await session.prompt({ query: "Continue" });
await turn.finished;If you already confirmed that local Agent construction succeeded but execution still fails, this is usually the first thing to check.
What about remote sessions
Remote sessions do not currently support passing a local model instance from the client.