Advisor mode falls back when explicitly configured to the primary model
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
Research direction
Start in extensions/advisor.ts and trace ensureRuntime() through resolveModelAndThinking(), focusing on how explicit advisor configuration is distinguished from an absent mode. Reproduce the case with an advisor provider and model matching the primary session, then verify that /advisor uses the configured model while an absent configuration still falls back to the built-in default.
Written by the indexing model from the issue text.
Description
Summary
/advisor cannot be configured to use the same model as the primary Pi session. If modes.json explicitly sets advisor to the current primary model, the extension treats that as if no advisor model was configured and falls back to the built-in default.
Reproduction
- Start Pi with primary model
openai-codex/gpt-5.5. - Configure
~/.pi/agent/modes.jsonor project.pi/modes.json:
{
"modes": {
"advisor": {
"provider": "openai-codex",
"modelId": "gpt-5.5",
"thinkingLevel": "xhigh"
}
}
}
- Run
/advisor onor/advisor status.
Actual behavior
The advisor does not use openai-codex/gpt-5.5. It falls back to the built-in default advisor model.
Expected behavior
If modes.json explicitly configures an advisor model, /advisor should use that model even when it is the same model as the primary session.
Suspected cause
In extensions/advisor.ts, ensureRuntime() calls resolveModelAndThinking(), then uses object identity against the current primary model as a sentinel for “mode absent”:
const sameAsPrimary = resolved.model === ctx.model;
model = sameAsPrimary ? undefined : resolved.model;
But resolveModelAndThinking() also returns ctx.model when the configured advisor mode intentionally resolves to the same provider/model as the primary session. That makes an explicit config indistinguishable from a missing config.
Minimal fix idea
Check whether the advisor mode exists separately from whether the resolved model equals ctx.model, or make resolveModelAndThinking() return whether a mode spec was found/applied.
- Dominant language
- JavaScript
- Stars
- 111
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·