Repository navigation
fix: agents_list reports routing alias instead of the resolved model - #123044
Conversation
agents_list exposed the raw configured primary (routing alias) as the model field while agentRuntime was derived from the resolved model, giving agents two contradictory identities. Publish the resolved provider/model from resolveDefaultModelForAgent instead, matching the gateway agents.list fix (openclaw#122907).
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 6:09 AM ET / 10:09 UTC. ClawSweeper reviewWhat this changesThis PR changes agents_list to return the resolved provider/model identity rather than a configured routing alias, and adds alias-resolution regression coverage. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still exposes the raw configured primary in this tool, while the PR makes it match the already-resolved runtime identity. The patch is a focused owner-boundary fix with no blocking findings. Priority: P2 Review scores
Verification
How this fits togetheragents_list is a built-in agent tool that lists permitted subagent targets. It reads agent configuration and model selection, then returns model and runtime metadata used by an agent to choose spawn targets. flowchart LR
A[Agent configuration] --> B[Model resolver]
C[agents_list request] --> D[Agent-list tool]
B --> D
D --> E[Resolved model metadata]
E --> F[Runtime metadata]
E --> G[Subagent spawn decisions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +43. Total +41 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the focused tool projection fix so every agent-facing model/runtime pair describes the same resolved model, while leaving operator-facing configured-model views unchanged. Do we have a high-confidence way to reproduce the issue? Yes. A configured model alias takes the raw-primary branch on current main while runtime metadata takes the resolved-model branch; the PR body also supplies an exact-head before/after real-config transcript. Is this the best way to solve the issue? Yes. Using the same resolved model already supplied to runtime metadata removes the split at the tool projection boundary; changing the resolver or operator-facing configured-model displays would be broader and incorrect. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2278ca6952ea. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…penclaw#123044) agents_list exposed the raw configured primary (routing alias) as the model field while agentRuntime was derived from the resolved model, giving agents two contradictory identities. Publish the resolved provider/model from resolveDefaultModelForAgent instead, matching the gateway agents.list fix (openclaw#122907).
Related: #122907 (same invariant fixed on the gateway
agents.listsurface)Related gap finding:
agents-list-model-alias(free-text issue, evidence level B — runtime before/after repro)What Problem This Solves
Fixes an issue where the
agents_listtool reported a routing-layer model alias (e.g. a ClawHub router ref such asclawrouter/openai/gpt-5.6) as an agent'smodel, while the same entry'sagentRuntimewas derived from the resolved model. Agents consuming the tool for subagent spawn and model decisions saw two contradictory identities for the same agent.Why This Change Was Made
agents_listhad the same projection split that gatewayagents.listhad before #122907: themodelfield came from the raw configured primary (resolveAgentEffectiveModelPrimary, aliases unresolved) while runtime metadata usedresolveDefaultModelForAgent. The tool now publishes the canonical resolved provider/model — the sameresolvedModelalready feedingagentRuntime— so displayed identity and capabilities describe one model. Aliases remain routing-only; no hardcoded model ids. Agents without a configured model now see the resolved default model (previouslymodelwas omitted), consistent with the runtime metadata already emitted.User Impact
Agents using
agents_listsee the model that will actually run instead of a routing token, keeping spawn/runtime decisions consistent. Operator-facing surfaces (modelsCLI, system-agent overview) still show the authored config value.Evidence
CI proof: resolved model identity from an initialized config (before/after)
Real behavior proved at exact immutable heads through the production config pipeline: a real
openclaw.jsonis written into an isolated state dir (OPENCLAW_STATE_DIRunder a tempHOME) and loaded by the real config loader — no config mocks — then the realagents_listtool executes and its output is captured. The identical scenario runs at both SHAs; machine-readable[proof]markers record the observed behavior.7eaf2fccf7ca9f2c22215324e3b5a04e19ac02e6bf93d5aaf8269898710e4bf82fe94496eddce4a9Before markers (raw routing alias leaks into
model; unconfigured agent omitsmodel):After markers (resolved canonical model published; resolved default now visible):
src/agents/tools/agents-list-tool.test.ts: 7 passed — new regression test covers the alias scenario; the twomodel: undefinedexpectations updated to the resolved default.tsgo:core(incremental): clean.oxlint: 0 warnings / 0 errors.oxfmt,git diff --check: clean.openclaw-pr-reviewpassed with best-fix verdictbest.