Skip to content

fix(agents): restore global subagent model default priority over agent own model#58823

Open
joeykrug wants to merge 29 commits into
openclaw:mainfrom
joeykrug:fix/subagent-model-precedence-global-default
Open

fix(agents): restore global subagent model default priority over agent own model#58823
joeykrug wants to merge 29 commits into
openclaw:mainfrom
joeykrug:fix/subagent-model-precedence-global-default

Conversation

@joeykrug

@joeykrug joeykrug commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #58822.

  • Restores correct subagent model precedence in resolveSubagentConfiguredModelSelection: global agents.defaults.subagents.model now takes priority over the parent agent's own model.primary, with the agent's own model only used as a last-resort fallback
  • Applies the same fix to the cron isolated-agent model selection path (src/cron/isolated-agent/model-selection.ts) and the shared resolveSubagentModelConfigSelectionResult helper in src/agents/agent-scope.ts
  • Updates existing tests from Agents: fix subagent model precedence #58003 to assert the corrected behavior and adds new coverage for main-agent, named-agent, and explicit-override scenarios

Background

PR #58003 reordered resolveSubagentConfiguredModelSelection to prefer agentConfig.model over agents.defaults.subagents.model. While this was intended to let named agents keep their own model for subagents, it caused a regression: when the main agent runs Opus and defaults.subagents.model is GPT-5.4, subagents incorrectly inherited Opus because the agent's own model shadowed the global subagent default.

The correct precedence is:

  1. agentConfig.subagents.model — explicit per-agent subagent config (highest)
  2. agents.defaults.subagents.model — global subagent default
  3. agentConfig.model — agent's own model (last-resort fallback)

Test plan

  • pnpm test src/agents/model-selection.test.ts — 105 tests pass
  • pnpm test src/cron/isolated-agent.model-formatting.test.ts — 32 tests pass
  • pnpm test src/agents/openclaw-tools.subagents.sessions-spawn.model.test.ts — 11 tests pass
  • pnpm test src/agents/subagent-spawn.model-session.test.ts — 1 test passes
  • pnpm test src/gateway/session-utils.test.ts — 84 tests pass
  • pnpm test src/gateway/sessions-patch.test.ts — 34 tests pass
  • Test: main agent (Opus) with global subagent default (GPT-5.4) → subagents use GPT-5.4
  • Test: named agent without per-agent subagents.model → uses global default
  • Test: falls back to agent own model when no global default set
  • Test: explicit model override in spawn always wins

Real behavior proof

Behavior addressed: Subagent model resolution for a main agent whose own model differs from agents.defaults.subagents.model. Before this PR, an Opus-running agent with defaults.subagents.model = openai/gpt-5 still produced Opus subagents because the agent's own model shadowed the global subagent default in resolveSubagentConfiguredModelSelection, in the shared resolveSubagentModelConfigSelectionResult helper, and in the cron isolated-agent path. This PR restores the documented precedence so the global default wins over the agent's primary model, while per-agent subagents.model still takes the very top slot.

Real environment tested: Linux x86_64 (Node v24.15.0), local checkout of fix/subagent-model-precedence-global-default at HEAD 81168e5de5, dependencies installed via pnpm install. Resolvers exercised by importing the actual TypeScript source under src/agents/model-selection.ts and src/agents/agent-scope.ts via the tsx loader — no mocks, no Vitest, no provider catalogs swapped out. The cron isolated-agent path uses the same resolveSubagentModelConfigSelectionResult helper, so the asserted source values cover that resolver too.

Exact steps or command run after this patch:

$ cd pr-58823
$ pnpm install --prefer-offline
$ node --import tsx scripts/proof/pr-58823-subagent-precedence.mjs

The script (scripts/proof/pr-58823-subagent-precedence.mjs, committed in this PR for reviewer reproducibility) constructs three real OpenClawConfig shapes, calls resolveSubagentModelConfigSelectionResult, resolveSubagentConfiguredModelSelection, and resolveSubagentSpawnModelSelection on each, and asserts both the resolved model ref and the selection source label (subagent / default-subagent / agent).

Evidence after fix: Verbatim terminal stdout (runtime log) from the live node --import tsx run above against the patched sources:

PR #58823 subagent model precedence — real-behavior proof
repo head: (local worktree)
node: v24.15.0

--- scenario A — global default beats agent primary ---
input.agentConfig.model              = anthropic/claude-opus
input.defaults.subagents.model       = openai/gpt-5
input.agentConfig.subagents.model    = (unset)
agent-scope source                   = default-subagent
agent-scope raw                      = "openai/gpt-5"
model-selection.resolveConfigured()  = openai/gpt-5
model-selection.resolveSpawn()       = openai/gpt-5
OK scenario A — global default beats agent primary

--- scenario B — per-agent override wins ---
input.agentConfig.model              = anthropic/claude-opus
input.defaults.subagents.model       = openai/gpt-5
input.agentConfig.subagents.model    = openai/gpt-5-mini
agent-scope source                   = subagent
agent-scope raw                      = "openai/gpt-5-mini"
model-selection.resolveConfigured()  = openai/gpt-5-mini
model-selection.resolveSpawn()       = openai/gpt-5-mini
OK scenario B — per-agent override wins

--- scenario C — falls through to agent primary ---
input.agentConfig.model              = anthropic/claude-opus
input.defaults.subagents.model       = (unset)
input.agentConfig.subagents.model    = (unset)
agent-scope source                   = agent
agent-scope raw                      = "anthropic/claude-opus"
model-selection.resolveConfigured()  = anthropic/claude-opus
model-selection.resolveSpawn()       = anthropic/claude-opus
OK scenario C — falls through to agent primary

PROOF PASSED — subagent model precedence follows: per-agent > defaults.subagents > agent primary

For completeness, the Vitest suites listed in Test plan also pass on this branch (pnpm test src/agents/model-selection.test.ts → 105 passed; pnpm test src/cron/isolated-agent.model-formatting.test.ts → 32 passed; etc.), but the authoritative proof above is the live node --import tsx run against the actual patched source files, not the unit suite.

Observed result after fix:

  • Scenario A (Opus main agent, defaults.subagents.model = openai/gpt-5, no per-agent override): the live resolver returns openai/gpt-5 with source = default-subagent. Before this PR it returned anthropic/claude-opus with source = agent — the exact bug from fix(agents): subagent model precedence — global default shadowed by parent agent's own model #58822.
  • Scenario B (per-agent subagents.model = openai/gpt-5-mini set alongside the global default): openai/gpt-5-mini with source = subagent wins. Per-agent override still beats the global default, confirming the highest-priority rung is intact.
  • Scenario C (neither per-agent subagents.model nor defaults.subagents.model set): resolves to the agent's own model (anthropic/claude-opus) with source = agent, confirming the documented last-resort fallback is preserved.

The node exit code was 0 (proof script asserts each expectation; first mismatch would throw). The agent-scope source labels are produced by the shared resolveSubagentModelConfigSelectionResult helper used by both src/agents/model-selection.ts and src/cron/isolated-agent/model-selection.ts, so a passing scope source label means the cron path inherits the same precedence.

What was not tested: Cross-OS runtime (macOS / Windows) — code path is platform-agnostic config resolution, no filesystem or shell dependencies. Live spawn of an actual subagent process against a remote model provider — the resolver returns the same model ref regardless of whether the downstream spawn succeeds, and the spawn path is exercised by src/agents/openclaw-tools.subagents.sessions-spawn.model.test.ts (11 passing). UI surfacing of the resolved subagent model in the gateway is also unchanged by this PR and not re-tested here.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Apr 1, 2026
@greptile-apps

greptile-apps Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a model-selection precedence regression introduced in PR #58003. It restores the correct priority order in both resolveSubagentConfiguredModelSelection (src/agents/model-selection.ts) and the cron isolated-agent path (src/cron/isolated-agent/model-selection.ts): per-agent subagents.model → global defaults.subagents.model → agent's own model, replacing the incorrect ordering that had the agent's own model shadowing the global subagent default.

  • The two-line swap in each file is minimal and correct, and both paths are now consistently aligned.
  • Updated tests accurately capture the regression scenario (main agent on Opus + global subagent default GPT-5.4 → subagents use GPT-5.4) and add four new cases covering the full priority matrix.
  • No unrelated changes; no new dependencies introduced.

Confidence Score: 5/5

Safe to merge — minimal, targeted fix with good regression-test coverage and no collateral changes.

All findings are P2 or lower. The logic change is a correct two-line swap applied consistently across both code paths, the updated and new tests directly cover the regression and the full priority matrix, and no unrelated code is touched.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(agents): restore global subagent mod..." | Re-trigger Greptile

@joeykrug joeykrug force-pushed the fix/subagent-model-precedence-global-default branch 3 times, most recently from 155066c to d588fb4 Compare April 8, 2026 04:50
@steipete

steipete commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.

Keep this PR open. Current main still implements and tests the opposite subagent model precedence, while the docs support the reporter's expectation that agents.defaults.subagents.model is the spawned sub-agent default. The PR is also paired with open same-author issue #58822 via closing syntax, and overlapping PR #72877 is still open rather than merged.

Best possible solution:

Keep this PR open for maintainer review. If the documented contract is intended, land this PR or a narrow equivalent, ideally with explicit allowlist validation for resolved subagent defaults and sessions_spawn.model; if #58003's named-agent precedence is the intended contract, update docs/tools/subagents.md and docs/gateway/config-tools.md, then close #58822 and this PR with that product decision. Also compare with open PR #72877 before choosing the canonical fix.

What I checked:

  • Current helper precedence is opposite of this PR: resolveSubagentConfiguredModelSelection checks per-agent subagents.model, then the agent's own model, then agents.defaults.subagents.model. That is the ordering this PR proposes to reverse. (src/agents/model-selection.ts:245, 7120f5b25487)
  • Cron path still mirrors current opposite precedence: The isolated cron model-selection path checks agentConfigOverride.subagents.model, then agentConfigOverride.model, then cfg.agents.defaults.subagents.model. (src/cron/isolated-agent/model-selection.ts:71, 7120f5b25487)
  • Checked-in tests pin the opposite contract: The current main unit test is named prefers the agent primary model over agents.defaults.subagents.model and expects the agent primary model to win over the global subagent default. (src/agents/model-selection.test.ts:1528, 7120f5b25487)
  • Cron regression test also pins agent model over global subagent default: The cron formatting test expects anthropic/claude-opus-4-6 from the agent override to win over ollama/llama3.2:3b from agents.defaults.subagents.model. (src/cron/isolated-agent.model-formatting.test.ts:525, 7120f5b25487)
  • Docs support the PR's expected default behavior: The subagent docs say the model inherits the caller unless agents.defaults.subagents.model or per-agent agents.list[].subagents.model is set, and that explicit sessions_spawn.model still wins. Public docs: docs/tools/subagents.md. (docs/tools/subagents.md:136, 7120f5b25487)
  • Config docs describe global subagent model as the spawned default: The config docs describe agents.defaults.subagents.model as the default model for spawned sub-agents and say omission means sub-agents inherit the caller's model. Public docs: docs/gateway/config-tools.md. (docs/gateway/config-tools.md:373, 7120f5b25487)

Remaining risk / open question:

  • The intended product contract is unresolved: current code/tests favor named-agent primary models, while current docs favor a configured global subagent default overriding caller inheritance.
  • Merging as-is should account for allowlist behavior: defaultModel is implicitly allowed, and the PR would make agents.defaults.subagents.model the effective default in more subagent-session cases.
  • The normal sessions_spawn model override path still resolves and persists a model string before visible allowlist/catalog validation; the Aisle findings are concrete enough for maintainer review rather than cleanup closure.
  • Overlapping PR fix(agents): apply subagent spawn model selection #72877 covers this precedence plus runtime model persistence, so maintainers should choose the canonical implementation path instead of closing this PR as obsolete before another fix lands.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 7120f5b25487.

@joeykrug joeykrug force-pushed the fix/subagent-model-precedence-global-default branch from 9a24cf6 to 0cc6234 Compare April 26, 2026 04:25
joeykrug and others added 2 commits April 26, 2026 13:42
…t own model

PR openclaw#58003 reordered resolveSubagentConfiguredModelSelection to prefer
agentConfig.model over agents.defaults.subagents.model. This caused the
main agent's own model to shadow the global subagent default — e.g. when
the main agent runs Opus and defaults.subagents.model is GPT-5.4,
subagents incorrectly inherited Opus instead of GPT-5.4.

Restore the correct precedence:
1. agentConfig.subagents.model  (explicit per-agent subagent config)
2. agents.defaults.subagents.model  (global subagent default)
3. agentConfig.model  (agent own model, last-resort fallback)

Apply the same fix to the cron isolated-agent model selection path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add regression tests for resolveSubagentSpawnModelSelection covering the
no-subagents-config 3-tier precedence:

1. session-level modelOverride wins over everything
2. agents.list[].model wins over agents.defaults.model
3. agents.defaults.model is used when neither override is set

These complement the resolveSubagentConfiguredModelSelection tests added
in the prior fix commit by pinning the spawn-time resolution path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joeykrug joeykrug force-pushed the fix/subagent-model-precedence-global-default branch from 4645342 to 5f5e960 Compare April 26, 2026 18:13
@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed June 7, 2026, 11:09 PM ET / 03:09 UTC.

Summary
This PR reorders the shared subagent model-selection helper so per-agent subagent config wins first, then agents.defaults.subagents.model, then the agent primary model, with updated cron/fallback tests and a proof script.

PR surface: Source +7, Tests +251, Other +127. Total +385 across 7 files.

Reproducibility: yes. Source inspection shows current main still has helper and cron/fallback paths where agentConfig.model wins over agents.defaults.subagents.model, while docs and the direct resolver expect the global subagent default to win.

Review metrics: 1 noteworthy metric.

  • Existing model precedence changed: 1 existing default-precedence order changed. The diff changes how agents.defaults.subagents.model is prioritized relative to agents.list[].model, which is an upgrade-sensitive provider/default surface.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

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

Rank-up moves:

Risk before merge

  • [P2] Merging changes an existing precedence path for users who configured both a named agent primary model and agents.defaults.subagents.model; cron and fallback helper callers may switch provider and auth route after upgrade.
  • [P1] The open broader runtime PR at fix(subagent): resolve runtime model from subagent default instead of parent primary #72984 covers this same precedence plus runtime persistence, so maintainers should avoid landing two competing partial fixes.
  • [P1] The PR adds a one-off proof script under scripts/proof; it is useful review evidence, but maintainers may prefer permanent regression tests over PR-specific script surface.

Maintainer options:

  1. Choose the canonical subagent-model fix (recommended)
    Decide whether this narrow precedence PR or the broader runtime-persistence PR should land, then update or close the other path so one implementation owns the provider switch.
  2. Accept the precedence switch deliberately
    If maintainers want the documented global default to win, merge only after the PR records the upgrade-visible provider/auth behavior for existing configs.
  3. Pause for the broader runtime fix
    If runtime persistence and parent override handling are required for correctness, pause or close this narrower PR after the broader fix becomes the viable canonical target.

Next step before merge

  • [P2] The next action is maintainer judgment on the documented precedence contract and the canonical choice between this PR and the broader runtime PR, not an autonomous repair.

Security
Cleared: The diff does not add dependencies, CI permissions, secret handling, network downloads, or package-resolution changes.

Review findings

  • [P1] Record the provider-switch upgrade path before reordering defaults — src/agents/agent-scope.ts:461-472
Review details

Best possible solution:

Land one canonical subagent-model fix that aligns the shared resolver, cron/fallback behavior, docs, regression tests, and upgrade note for the provider/auth precedence change.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows current main still has helper and cron/fallback paths where agentConfig.model wins over agents.defaults.subagents.model, while docs and the direct resolver expect the global subagent default to win.

Is this the best way to solve the issue?

Unclear as a merge path. The shared-helper reorder is a plausible narrow fix, but the best solution requires maintainer agreement on the compatibility contract and whether this PR or the broader runtime PR should be canonical.

Full review comments:

  • [P1] Record the provider-switch upgrade path before reordering defaults — src/agents/agent-scope.ts:461-472
    Changing this shared candidate order makes agents.defaults.subagents.model win over agentConfig.model for helper, cron, and fallback callers. Existing users who configured both can silently move subagent runs from a named-agent provider/auth profile to the global subagent provider, so this needs an explicit maintainer-approved upgrade contract or compatibility note before merge.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 181238fb5304.

Label changes

Label justifications:

  • P2: This is a normal-priority agent model-selection regression fix with limited blast radius but real provider-routing impact.
  • merge-risk: 🚨 compatibility: Existing configs with both a named agent model and a global subagent default can resolve to a different model after merge.
  • merge-risk: 🚨 auth-provider: The changed precedence can move subagent cron/fallback paths onto a different provider and auth profile.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body includes after-fix live terminal output from a Node/tsx run against patched source that exercises the relevant resolver scenarios.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix live terminal output from a Node/tsx run against patched source that exercises the relevant resolver scenarios.
Evidence reviewed

PR surface:

Source +7, Tests +251, Other +127. Total +385 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 9 2 +7
Tests 4 264 13 +251
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 127 0 +127
Total 7 400 15 +385

What I checked:

  • Current direct resolver already follows the documented order: resolveSubagentConfiguredModelSelection on current main checks agentConfig.subagents.model, then agents.defaults.subagents.model, then agentConfig.model. (src/agents/model-selection.ts:326, 181238fb5304)
  • Current shared helper still uses the opposite order: resolveSubagentModelConfigSelectionResult currently places agentConfig.model before agents.defaults.subagents.model, so helper callers can still select the agent primary model. (src/agents/agent-scope.ts:448, 181238fb5304)
  • Cron path consumes the shared helper: The isolated cron model-selection path delegates to resolveSubagentModelConfigSelectionResult, so the helper ordering controls whether cron records the source as agent or subagent. (src/cron/isolated-agent/model-selection.ts:90, 181238fb5304)
  • Current tests still pin the stale helper/cron behavior: Current main tests expect resolveSubagentModelConfigSelection and cron formatting to prefer the agent primary model over agents.defaults.subagents.model in helper-driven cases. (src/agents/agent-scope.test.ts:1043, 181238fb5304)
  • Docs support the PR's global subagent default contract: The subagent docs say native sub-agents inherit the caller unless agents.defaults.subagents.model or a per-agent subagent model is set, and the config docs call agents.defaults.subagents.model the default model for spawned sub-agents. Public docs: docs/tools/subagents.md. (docs/tools/subagents.md:142, 181238fb5304)
  • Regression provenance: Commit e394262 changed resolveSubagentConfiguredModelSelection and the cron path to put the agent model before the global subagent default. (src/agents/model-selection.ts:440, e394262bd87e)

Likely related people:

  • neeravmakwana: Merged history for commit e394262 shows the prior PR changed the direct and cron subagent model precedence to put agent primary before global subagent default. (role: introduced prior precedence; confidence: high; commits: e394262bd87e; files: src/agents/model-selection.ts, src/cron/isolated-agent/model-selection.ts, src/agents/model-selection.test.ts)
  • vincentkoc: Current-main blame in this shallow checkout attributes the current consolidated agent-scope, model-selection, and cron model-selection lines to the latest main snapshot commit, and recent release history also touched repository skills/baselines around this area. (role: recent area contributor; confidence: medium; commits: a4e78aec4b6a, 2e08f0f4221f; files: src/agents/agent-scope.ts, src/agents/model-selection.ts, src/cron/isolated-agent/model-selection.ts)
  • steipete: The prior detailed review on this PR mapped the same docs-versus-current-main mismatch and called out the overlapping broader runtime PR as a maintainer decision point. (role: recent reviewer; confidence: medium; files: src/agents/model-selection.ts, src/agents/agent-scope.ts, src/cron/isolated-agent/model-selection.ts)
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.

@clawsweeper clawsweeper Bot added the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label May 24, 2026
…; resolve conflicts (transport-stream, runs.test, preaction.test)
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 3, 2026
…ack tests

PR openclaw#58823's subagent-precedence fallback tests (agent-scope + cron
isolated-agent) asserted legacy 'openai-codex/gpt-5.x', but their configs
use 'openai/gpt-5.x' and the resolver returns the configured fallbacks
verbatim (no aliasing) — so the expected value cannot be openai-codex. Per
AGENTS.md, openai-codex is folded into openai (legacy input only), so the
canonical runtime value is openai/*. The flip behavior (global
defaults.subagents.model fallbacks win over the agent's own model) is
correctly implemented in agent-scope.ts; only the test expectations were
wrong. Fixes the 2 failing CI shards (agentic-agents-core-runtime,
core-runtime-cron-isolated-agent).
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 3, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 3, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(agents): subagent model precedence — global default shadowed by parent agent's own model

3 participants