Summary
When the host pi session runs on a non-Anthropic provider (e.g. openai-codex/gpt-5.5), the crew planner and workers still default to a Claude model rather than inheriting the session's current model. This forces per-project config.models workarounds and, when the user has no/limited Anthropic credit, breaks the crew entirely (the planner 4xx then loops — see companion issue).
Where
Model resolution falls back to the agent's hardcoded (Claude) model:
crew/agents.ts:206 — const model = task.modelOverride ?? config.models?.[role] ?? agentConfig?.model;
crew/lobby.ts:72 — const model = config.models?.worker ?? workerConfig.model;
The host session model is already available to the extension:
store.ts:427 — const currentModel = ctx.model?.id ?? reg.model;
Repro
- Run
pi with --provider openai-codex --model gpt-5.5 (no Anthropic usage).
pi_messenger({ action: "plan" }).
- Planner spawns on a Claude model and fails despite gpt-5.5 being fully available.
Ask
Default crew roles (planner/worker/reviewer/analyst) to the host session model (ctx.model?.id) when there is no explicit task.modelOverride / config.models[role]. Keep config.models as an explicit override. "Same model as the session" is the least-surprising default.
Workaround
Set crew.models.* to the session model in ~/.pi/agent/pi-messenger.json (global) or <project>/.pi/messenger/crew/config.json (per-project).
Summary
When the host
pisession runs on a non-Anthropic provider (e.g.openai-codex/gpt-5.5), the crew planner and workers still default to a Claude model rather than inheriting the session's current model. This forces per-projectconfig.modelsworkarounds and, when the user has no/limited Anthropic credit, breaks the crew entirely (the planner 4xx then loops — see companion issue).Where
Model resolution falls back to the agent's hardcoded (Claude) model:
crew/agents.ts:206—const model = task.modelOverride ?? config.models?.[role] ?? agentConfig?.model;crew/lobby.ts:72—const model = config.models?.worker ?? workerConfig.model;The host session model is already available to the extension:
store.ts:427—const currentModel = ctx.model?.id ?? reg.model;Repro
piwith--provider openai-codex --model gpt-5.5(no Anthropic usage).pi_messenger({ action: "plan" }).Ask
Default crew roles (planner/worker/reviewer/analyst) to the host session model (
ctx.model?.id) when there is no explicittask.modelOverride/config.models[role]. Keepconfig.modelsas an explicit override. "Same model as the session" is the least-surprising default.Workaround
Set
crew.models.*to the session model in~/.pi/agent/pi-messenger.json(global) or<project>/.pi/messenger/crew/config.json(per-project).