Skip to content

fix: preserve config-selected subagent model overrides#92573

Merged
steipete merged 2 commits into
openclaw:mainfrom
arkyu2077:fix/issue-92486
Jun 14, 2026
Merged

fix: preserve config-selected subagent model overrides#92573
steipete merged 2 commits into
openclaw:mainfrom
arkyu2077:fix/issue-92486

Conversation

@arkyu2077

@arkyu2077 arkyu2077 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve provenance for configuration-selected subagent model overrides so child execution does not discard them as legacy fallback state
  • cover default subagent models, per-agent subagent models, target-agent primary models, and bare configured model IDs
  • keep the ordinary global runtime default unpinned so normal model selection remains unchanged

Verification

  • node scripts/run-vitest.mjs src/agents/openclaw-tools.subagents.sessions-spawn.model.test.ts src/agents/subagent-spawn.model-session.test.ts src/agents/agent-scope.test.ts src/agents/subagent-spawn.test.ts src/agents/agent-command.live-model-switch.test.ts src/agents/model-selection.test.ts (265 tests passed)
  • node scripts/run-oxlint.mjs src/agents/subagent-spawn-plan.ts src/agents/subagent-spawn.ts src/agents/openclaw-tools.subagents.sessions-spawn.model.test.ts src/agents/subagent-spawn.model-session.test.ts
  • pnpm exec oxfmt --write --threads=1 src/agents/subagent-spawn-plan.ts src/agents/subagent-spawn.ts src/agents/openclaw-tools.subagents.sessions-spawn.model.test.ts src/agents/subagent-spawn.model-session.test.ts
  • git diff --check
  • fresh local and full-branch autoreview: no actionable findings

Real behavior proof

Behavior addressed: A subagent model selected from configuration was persisted as an automatic override without origin metadata, then discarded before child execution as if it were a legacy fallback.

Real environment tested: Live OpenClaw gateway and real OpenAI API. Parent model openai/gpt-5.5; configured child models openai/gpt-5.4 and bare gpt-5.4.

Exact steps or command run after this patch: Ran targeted temporary live Vitest probes through OPENCLAW_LIVE_TEST=1 node scripts/run-vitest.mjs, starting the real gateway, having GPT-5.5 invoke sessions_spawn without a model argument, waiting for the child run, then reading the child registry and assistant transcript. Repeated with bare configured model gpt-5.4 and target default provider openai.

Evidence after fix: Copied live output from the real gateway runs:

[subagent-config-model] {"parentModel":"openai/gpt-5.5","childConfiguredModel":"openai/gpt-5.4","childRunModel":"openai/gpt-5.4","childTranscriptProvider":"openai","childTranscriptModel":"gpt-5.4"}
[subagent-config-bare] {"configuredModel":"gpt-5.4","resolvedModel":"gpt-5.4","transcriptProvider":"openai","transcriptModel":"gpt-5.4"}

Observed result after fix: The parent made a real sessions_spawn tool call, and both child executions used GPT-5.4 exactly as configured. The qualified-model scenario passed in 48.69 seconds; the bare-model scenario passed in 39.10 seconds.

What was not tested: No Anthropic live call was needed because this change does not alter provider transports, request payloads, tool schemas, or OpenAI/Anthropic tool-call handling. The exercised OpenAI path confirms the existing official tool-call flow remains functional.

Closes #92486

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 13, 2026
@clawsweeper

clawsweeper Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 12, 2026, 10:07 PM ET / 02:07 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

PR surface: Source +28, Tests +49. Total +77 across 4 files.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: vector/embedding metadata: src/agents/subagent-spawn.model-session.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Result: rating does not apply to this item.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Review did not complete, so no work-lane recommendation was made.
Review details

Best 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 ded3a9305876.

Label changes

Label changes:

  • add rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.

Label justifications:

  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
Evidence reviewed

PR surface:

Source +28, Tests +49. Total +77 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 29 1 +28
Tests 2 49 0 +49
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 78 1 +77

What I checked:

  • failure reason: codex execution failed.
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stderr: {\n+ agentSessionKey: "agent:main:main",\n+ agentChannel: "guildchat",\n+ },\n+ );\n+\n+ expect(result.status).toBe("accepted");\n+ const [, persistedEntry] = Object.entries(persistedStore ?? {})[0] ?? [];\n+ expect(persistedEntry?.modelOverrideSource).toBe("auto");\n+ expect(persistedEntry?.modelOverrideFallbackOriginProvider).toBe("minimax");\n+ expect(persistedEntry?.modelOverrideFallbackOriginModel).toBe("MiniMax-M2.7");\n+ });\n });".
  • codex stdout: No stdout captured.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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 keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor

Land-ready verification for f5539a99a4c0a73aa95e745d3c236d135c92802a:

  • 265 focused agent/model tests passed via node scripts/run-vitest.mjs.
  • Focused oxlint, oxfmt, and git diff --check passed.
  • Fresh local and full-branch autoreview found no actionable issues.
  • Live OpenAI proof: GPT-5.5 made a real sessions_spawn tool call with no model argument; the configured child ran and recorded openai/gpt-5.4.
  • Live bare-model proof: configuration gpt-5.4 inherited the target agent's openai provider and the child transcript recorded openai/gpt-5.4.

This patch changes only subagent model-selection provenance. It does not change provider transports, request payloads, tool schemas, or OpenAI/Anthropic tool-call handling. No Anthropic live call was run for that reason.

@openclaw-barnacle openclaw-barnacle Bot added triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 14, 2026
@steipete
steipete merged commit d4a74b4 into openclaw:main Jun 14, 2026
186 of 193 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling proof: supplied External PR includes structured after-fix real behavior proof. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subagent model override from agents.defaults.subagents.model is silently discarded (modelOverrideSource:"auto" matches legacy-cleanup heuristic)

2 participants