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

The local SDK has no executable model only when neither the Agent nor the Session provides one.

You can fix it in either way:

const agent = new Agent({
  id: "repo-helper",
  workspace: new Workspace({ path: "/path/to/project" }),
  model,
});

or:

await session.set({ model });

Correct order

const session = await agent.sessions.create();
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.