-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Description
Bug Description
Running oh-my-opencode run --agent Librarian fails before any assistant/user message is persisted. The session is created, but the run immediately throws undefined is not an object (evaluating 'agent.model') and then only polls /session/status until timeout/exit.
This does not look like a generic provider outage because:
oh-my-opencode runworks in the same project/configoh-my-opencode run --agent Sisyphusalso works in the same project/configAtlascan at least enter a session and persist messages, even though that path later hits a separate provider-sideNot Found
So this looks like a direct --agent Librarian resolution / agent config parsing bug.
Steps to Reproduce
- Environment: WSL2 Ubuntu on Windows, OpenCode
1.2.23, oh-my-opencode3.11.2 - Configure
librarianto use a valid model:
{
"agents": {
"librarian": {
"model": "minimax/MiniMax-M2.5",
"category": "quick",
"reasoningEffort": "low"
}
},
"categories": {
"quick": {
"model": "minimax/MiniMax-M2.5",
"reasoningEffort": "low"
}
}
}- Verify the model exists in OpenCode:
opencode modelsIt includes:
minimax/MiniMax-M2.5- Run:
oh-my-opencode run --agent Librarian --json --no-timestamp 'List deploy_remote.py and app/tests/test_deploy_remote.py only.'Expected Behavior
The Librarian agent should start normally and return a response, just like Sisyphus does in the same environment.
Actual Behavior
- A session is created successfully
- The run then errors very early with:
undefined is not an object (evaluating 'agent.model')- After that it keeps polling
/session/status - The resulting session is effectively empty in sqlite:
ses_329243ea9ffengeI53pZD29j27 messages=0 parts=0
ses_3291c4533ffeeBeenCJ2gljNvr messages=0 parts=0
For comparison, another failing path (Atlas) at least persisted data:
ses_32924512fffeOt1OjPcC6TWH6M messages=2 parts=1
Doctor Output
oMoMoMoMo Doctor
? 1 issue found:
1. GitHub CLI not authenticated
gh CLI is installed but not logged in.
Fix: Run: gh auth login
Affects: GitHub automationError Logs
INFO 2026-03-10T08:27:32 +4ms service=server method=POST path=/session/ses_329243ea9ffengeI53pZD29j27/prompt_async request
INFO 2026-03-10T08:27:32 +29ms service=server status=completed duration=29 method=POST path=/session/ses_329243ea9ffengeI53pZD29j27/prompt_async request
ERROR 2026-03-10T08:27:32 +3ms service=default e=undefined is not an object (evaluating 'agent.model') rejectionRelevant log file:
/home/woody/.local/share/opencode/log/2026-03-10T082728.log
Configuration
Global config (sanitized):
{
"default_run_agent": "sisyphus",
"agents": {
"sisyphus": {
"model": "foxcode/gpt-5.4",
"category": "unspecified-high",
"reasoningEffort": "high"
},
"librarian": {
"model": "minimax/MiniMax-M2.5",
"category": "quick",
"reasoningEffort": "low",
"prompt_append": "Cheap evidence gatherer. Use for document lookup, quick summaries, and low-ambiguity retrieval work."
}
},
"categories": {
"quick": {
"model": "minimax/MiniMax-M2.5",
"reasoningEffort": "low"
}
}
}Project config (sanitized):
{
"agents": {
"librarian": {
"prompt_append": "Focus on cheap repo evidence gathering: config locations, route definitions, service/schema references, deploy artifacts, and test entry points. Escalate if ambiguity remains."
}
}
}Additional Context
- This feels related to agent-specific config resolution, not generic model availability.
- OpenCode sees the model correctly.
Sisyphusworks in the same setup.- The failure happens before any real message content is stored.
- Possibly related issue families, but this exact failure mode looks distinct from them: [Bug]: Agent model configuration causes model to revert to default after sending message in web mode #2351, [Bug]: Plugin/user agents not injected into Sisyphus system prompt (customAgentSummaries type mismatch) #2386, [Question]: How do I specify the subagent to use a specific model? #2416.
Operating System
Linux (WSL2 Ubuntu on Windows 11)
OpenCode Version
1.2.23
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels