fix(agents): align /btw model resolution with runtime aliases#92181
fix(agents): align /btw model resolution with runtime aliases#92181wangwllu wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 12, 2026, 9:19 AM ET / 13:19 UTC. Summary PR surface: Source +135, Tests +103. Total +238 across 4 files. Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 0fc5a57a3440. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +135, Tests +103. Total +238 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review Real behavior proof added in PR body — captured before/after on OpenClaw 2026.6.5 with patched dist. The error-message swap (primitive Unknown model → buildUnknownModelError with registration hint) shows the new resolveModelAsync path is hit; with a minimal provider entry registered as the new error suggests, /btw then reaches the configured CLI backend end-to-end and returns a normal side-question answer. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞👀 Command router queued. I will update this comment with the next step. |
aac90d0 to
b512447
Compare
|
@clawsweeper re-review Pushed b512447. This addresses the P1 gap: runtime-owned |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Updated the PR body Real behavior proof section to use the required fields ( |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review Corrected the Real behavior proof labels to the policy-recognized names ( |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIF evidence for /btw model resolution.
Motion-trimmed clips: |
|
@clawsweeper re-review Two prior re-review attempts (16:28Z and 16:38Z on 2026-06-11) both got picked up but progress stuck at |
|
@vincentkoc — heads up that ClawSweeper review keeps failing on this PR for what looks like a Codex backend issue rather than anything in the change itself. Sharing the artifacts in case you want to bypass the Root cause (from clawsweeper run 27389971002 job 80945192159 step 13 "Review exact event item"): All 3 Codex retries returned PR-side state is healthy:
If you're OK with it, would you be willing to either review directly or bypass the ClawSweeper rating gate for this one? Happy to provide more evidence or split the diff if that helps. |
|
Thanks @wangwllu for the broader resolver PR, the detailed proof, and the native Telegram evidence. We merged #92226 as the narrower interim fix. The key decision was to stop Working same-runtime |
|
Thanks for the quick fix and the clear framing on the transport/auth boundary — the fail-closed semantics make sense, and the error text users now see is far better than the prior One small ask: is there a tracking issue or rough milestone for the runtime-owned side-question path? I'm a daily user of |




Summary
Fixes #92168.
/btwused a registry-only model lookup, while the main agent loop resolves models throughresolveModelAsyncwith runtime-aware fallback. That made/btwfail for canonical provider aliases such asanthropic/*when they are intentionally routed through a CLI runtime viaagentRuntime.idand no direct provider entry exists in the agent's discoveredmodels.json.This PR aligns
/btwmodel resolution with the main agent path by:resolveModelAsyncinstead of the primitive registry-only resolverReal behavior proof
/btwside questions should resolve the selected session model the same way as the main agent turn when the selected model is a canonical provider alias routed through a CLI/plugin runtime. A metadata-onlyagents.defaults.models["provider/model"]entry withagentRuntime.idshould not fail early withUnknown modeljust because there is no directmodels.providers.<provider>registration.anthropic/<redacted-custom-cli-model>.agents.defaults.models["anthropic/<redacted-custom-cli-model>"].agentRuntime.id = "claude-cli".models.providers.anthropicunregistered, matching the original failing setup./btw what is this repro checking?in an active session./btwstopped in the resolver with a redacted form of:Unknown model: anthropic/<redacted-custom-cli-model>. Found agents.defaults.models[...] but no matching models.providers["anthropic"].models[] entry....skipAgentDiscovery, no provider registration, metadata-onlyagentRuntime.id = "claude-cli") returns a resolved model instead ofUnknown model.npm test -- --run src/agents/btw.test.ts src/agents/embedded-agent-runner/model.test.tspassed 142 tests;npm run tsgo:core:test,oxfmt --check,oxlint, andgit diff --checkall passed./btwnow uses the runtime-aware resolver path and can proceed past model resolution for the original no-models.providers.anthropicconfiguration shape. Any later provider/API/runtime error is outside this resolver bug and no longer appears as the primitive/btwUnknown modelfailure./btwmodel resolution consistency before provider execution.Tests
npm test -- --run src/agents/btw.test.ts src/agents/embedded-agent-runner/model.test.tsnpm run tsgo:core:testnpx oxfmt --check src/agents/btw.ts src/agents/btw.test.ts src/agents/embedded-agent-runner/model.ts src/agents/embedded-agent-runner/model.test.tsnpx oxlint src/agents/btw.ts src/agents/btw.test.ts src/agents/embedded-agent-runner/model.ts src/agents/embedded-agent-runner/model.test.tsgit diff --checkNote:
npm run check:changedcould not run locally because the configured Blacksmith/crabbox wrapper failed its own binary sanity check before executing repository checks.