You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(model): answer a Claude pane whose models Ovis cannot read with 404, not 500 - #5134
Pressing the composer model pill on a terminal Claude Code pane (where Ovis runs agent tools, #5089) could show
"Could not read the agent's models: internal error ()". GET /api/pane/model answered 500 in two cases:
Claude Code did not list its models: the headless claude -p … initialize run through hc's machine.exec failed
to start, timed out, or gave no models. claudeModelControl().read() threw a plain Error("Claude Code did not list its models"), which errorResponse turns into internal_error.
The pane's transcript could not be read yet (ConversationReadPending or any other read error): read() awaited sources.reported() without catching it.
Fix
A list Claude did not give makes read() answer null, so the route answers 404 model_in_terminal: the pill keeps
the model as words and its panel says to pick one in Claude's terminal with /model. Claude is still asked again
after MISSED_MS (30 s), and the client reads again whenever the pane's model, level or status moves.
A transcript that cannot be read yet no longer fails the read: Claude's list is answered with no model in force
(current: { model: null, effort: null }).
terminalModelReason gives an accurate reason for a Claude pane where agent tools do run (the old one said Ovis
types /model only where it runs agent tools, which is wrong there).
Review round (omo gate + Codex) follow-up, in 549cbfa:
The composer draws the model button when the agent lists choices though its conversation names no model yet (shown as the existing Model — state), so a Claude pane whose transcript is not read yet can still be picked from.
Opening a model_in_terminal panel reads again, so a Claude that lists its models by then shows them (a press is the retry the 404 path otherwise lacks).
A read right after a confirmed change that finds the transcript pending keeps the confirmed value (no false applied: false).
initializeModels keeps only well-shaped fields of Claude's answer (a malformed field no longer throws → 500).
No new control, setting or HTTP/WS contract change: both answers already exist in the contract (model_in_terminal
404, current fields nullable).
Verification
Reproduced on main through a real isolated hc (scripts/test-hc.tsIsolatedCore, real machine.exec, real claudeModelList and handlePaneModelRequest): a claude that fails to start → 500 internal_error; transcript
not readable → 500 internal_error; real Claude Code 2.1.330 in an isolated HOME → 200, 4 models.
With this branch: 404 model_in_terminal, 200 (4 models), 200 (4 models).
server/agent-tools/drivers/claude-model.test.ts: the new test fails on main (read throws) and passes here.
bun test server/agent-tools/drivers/claude-model.test.ts server/agent-tools/drivers/terminal-model.test.ts server/pane-model.test.ts: 17 pass.
…04, not 500
GET /api/pane/model threw on a terminal Claude Code pane when Claude did not
list its models (the headless initialize run failed or timed out) or when the
pane's transcript was not readable yet, so the pill said "Could not read the
agent's models: internal error (<id>)". A missing list now answers
model_in_terminal (pick in Claude's terminal), and an unread transcript lists
the models with no model in force.
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Bug Fixes
Claude Code panes now show available model choices even when conversation details are still loading.
When Claude’s model list can’t be read, panes prompt you to choose a model in Claude’s terminal using /model.
Changes
Claude model reads now return null when no model list is available. Pending transcript reads can return the listed models without a current model or effort. When Claude is running and its models are unavailable, the terminal model reason provides Claude-specific messaging.
Claude model availability
Layer / File(s)
Summary
Unavailable model handling and messaging server/agent-tools/drivers/claude-model.ts, server/agent-tools/drivers/terminal-model.ts, server/agent-tools/drivers/claude-model.test.ts, changelog.d/claude-model-pill-unlisted.md, DESIGN.md
Claude model reads return null if no model list is available. Pending transcript reads return the listed models with null current model and effort. Claude-specific terminal messaging and tests, changelog, and design documentation cover unavailable models.
devswha/ovis#5089: Adds the Claude model-list path and related terminal model behavior that this change updates.
Merge Risk: Minimal · previous review 0efcd
This change turns a 500 error into a clear prompt to choose a model with /model in Claude's terminal, and still lists models when the conversation cannot yet be read. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: a Claude pane whose models Ovis cannot read now gets a 404 instead of a 500. It matches the objectives and the raw summary. The title is one sentence and specific, tho…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the template's two sections, Change and Validation. The Change section explains the problem (500 internal_error from GET /api/pane/model for Claude terminal panes in two cases)…
Full details: Title check
Explanation
The title names the main change: a Claude pane whose models Ovis cannot read now gets a 404 instead of a 500. It matches the objectives and the raw summary. The title is one sentence and specific, though it is slightly long at 80 characters.
Full details: Description check
Explanation
The description follows the template's two sections, Change and Validation. The Change section explains the problem (500 internal_error from GET /api/pane/model for Claude terminal panes in two cases), the fix, and a review-round follow-up. The Validation section lists reproduction through an isolated hc, a targeted test file, and a bun test command with 17 passing tests. It does not state whether the fast or full check suites were run, and it does not mention the changelog entry, which the template's header comment says is required for changes. It also does not state whether contract tests were run, though the author says no HTTP/WS contract change was made.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 5499fb9 and 0efcd20.
Files selected for processing: 5
DESIGN.md
changelog.d/claude-model-pill-unlisted.md
server/agent-tools/drivers/claude-model.test.ts
server/agent-tools/drivers/claude-model.ts
server/agent-tools/drivers/terminal-model.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
…, keep a confirmed change
Review follow-up: draw the model button when the agent lists choices though
the conversation names no model yet; read again as a model_in_terminal panel
opens; keep the last transcript value when a read right after a confirmed
change is pending; keep only well-shaped fields of Claude's initialize answer.
One review round ran on head 0efcd20 (omo gate: BLOCK, Codex gpt-6.2-sol-fast xhigh: BLOCK). Fixed in the next commit:
HIGH (gate) / MEDIUM (Codex): a listed catalog with no conversation metadata drew no pill.Composer.tsx now draws the model button when the agent lists choices (paneModel.state), as Model — until the conversation names one. Test: src/components/ComposerModelPill.test.tsx (fails on main: no button).
MEDIUM (Codex): a terminal-fallback pill never read again while the pane stayed idle. Opening a model_in_terminal panel now reads again (ComposerModel.tsx), so a Claude that lists its models by then shows them. Test in ComposerModel.test.tsx (fails on main: no read on reopen).
MEDIUM (Codex): POST could answer applied: false after a confirmed change when the transcript read right after was pending.claudeModelControl keeps the last value a transcript read gave and uses it when a later read is not ready. Test in claude-model.test.ts.
MEDIUM (gate) / LOW (Codex): a field of an unexpected shape in Claude's initialize answer (displayName: 42, supportedEffortLevels: "high") still threw → 500.initializeModels now keeps only the fields of the shape read. Test in claude-model.test.ts.
Not changed (LOW, recorded here only): an empty models: [] answer is cached for the full 10 minutes like a real list; ACP lists stale choices during an F4 terminal takeover (predates this PR).
Checks after the fix: 88 focused tests pass (claude-model, terminal-model, pane-model, ComposerModel, ComposerModelPill, ComposerContextRing, ComposerBarePick), bun run typecheck exit 0, every *conventions.test.ts + changelog-fold.test.ts 153 pass; the isolated-hc repro still answers 404 model_in_terminal / 200 / 200.
Merged through pr-merge at head d506362ba. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.
main moved but untouched: merged without update. Its new commits up to d93617ad4 change no file of this pull request, none imported by one, nothing that decides which checks run, and no core path.
Reviews: omo gate + Codex (gpt-6.2-sol-fast, xhigh) one round on 0efcd20, all HIGH/MEDIUM findings fixed in 549cbfa; dori review CLEAR at 549cbfa; CodeRabbit skipped this head. Merged on the Dori lead's word (lane model-pill-claude-err).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pressing the composer model pill on a terminal Claude Code pane (where Ovis runs agent tools, #5089) could show
"Could not read the agent's models: internal error ()".
GET /api/pane/modelanswered 500 in two cases:claude -p … initializerun through hc'smachine.execfailedto start, timed out, or gave no
models.claudeModelControl().read()threw a plainError("Claude Code did not list its models"), whicherrorResponseturns intointernal_error.ConversationReadPendingor any other read error):read()awaitedsources.reported()without catching it.Fix
read()answer null, so the route answers 404model_in_terminal: the pill keepsthe model as words and its panel says to pick one in Claude's terminal with
/model. Claude is still asked againafter
MISSED_MS(30 s), and the client reads again whenever the pane's model, level or status moves.(
current: { model: null, effort: null }).terminalModelReasongives an accurate reason for a Claude pane where agent tools do run (the old one said Ovistypes
/modelonly where it runs agent tools, which is wrong there).Review round (omo gate + Codex) follow-up, in 549cbfa:
Model —state), so a Claude pane whose transcript is not read yet can still be picked from.model_in_terminalpanel reads again, so a Claude that lists its models by then shows them (a press is the retry the 404 path otherwise lacks).applied: false).initializeModelskeeps only well-shaped fields of Claude's answer (a malformed field no longer throws → 500).No new control, setting or HTTP/WS contract change: both answers already exist in the contract (
model_in_terminal404,
currentfields nullable).Verification
scripts/test-hc.tsIsolatedCore, realmachine.exec, realclaudeModelListandhandlePaneModelRequest): aclaudethat fails to start →500 internal_error; transcriptnot readable →
500 internal_error; real Claude Code 2.1.330 in an isolated HOME →200, 4 models.With this branch:
404 model_in_terminal,200(4 models),200(4 models).server/agent-tools/drivers/claude-model.test.ts: the new test fails on main (read throws) and passes here.bun test server/agent-tools/drivers/claude-model.test.ts server/agent-tools/drivers/terminal-model.test.ts server/pane-model.test.ts: 17 pass.