Skip to content

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

Open
BingqingLyu wants to merge 581 commits into
mainfrom
fork-pr-58823-fix-subagent-model-precedence-global-default
Open

fix(agents): restore global subagent model default priority over agent own model#1771
BingqingLyu wants to merge 581 commits into
mainfrom
fork-pr-58823-fix-subagent-model-precedence-global-default

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes openclaw#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)
  • Updates existing tests from Agents: fix subagent model precedence openclaw/openclaw#58003 to assert the corrected behavior and adds new coverage for main-agent, named-agent, and explicit-override scenarios

Background

PR openclaw#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 — 71 tests pass
  • pnpm test -- src/cron/isolated-agent.subagent-model.test.ts — 5 tests pass
  • pnpm test -- src/gateway/sessions-patch.test.ts — 27 tests pass
  • New test: main agent (Opus) with global subagent default (GPT-5.4) → subagents use GPT-5.4
  • New test: named agent without per-agent subagents.model → uses global default
  • New test: falls back to agent own model when no global default set
  • New test: explicit model override in spawn always wins

🤖 Generated with Claude Code

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

steipete and others added 30 commits April 27, 2026 13:42
* fix(opencode): expose claude thinking levels

* test(opencode): cover adaptive claude thinking bounds

* docs(changelog): credit opencode thinking contributor

---------

Co-authored-by: haishmg <4529977+haishmg@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
…law#72806)

* fix: preserve requester route for subagent completion delivery

* fix(agents): preserve requester subagent completion routes

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
steipete and others added 30 commits April 27, 2026 21:37
Add a manual macOS CodeQL security shard scoped to app sources. Verified with profile=macos-security on Blacksmith in 16m55s.
Remediate current-profile CodeQL findings for file SecretRef id validation and release workflow job permissions. Includes changelog credit. Thanks @vincentkoc.
…Message voice-memo bubbles via BlueBubbles (openclaw#72586)

End-to-end testing on macOS + BlueBubbles + ElevenLabs walked through three CAF flavors before landing on the format Apple's Messages.app actually emits when a user records a native iMessage voice memo:

- PCM int16 @ 44.1 kHz CAF: BlueBubbles' internal `afconvert -f m4af -d aac` conversion fails; the original CAF reaches iMessage but renders with 0 s duration.
- AAC @ 22.05 kHz mono CAF: BlueBubbles' conversion succeeds and the server silently downgrades the delivery, sending the converted MP3 as a generic audio attachment.
- **Opus @ 24 kHz mono CAF**: byte-identical to the descriptor block Apple's Messages.app produces; BlueBubbles passes it through unchanged and iMessage renders a native voice-memo bubble with proper duration and waveform UI.

Adds an opt-in `tts.voice.preferAudioFileFormat` channel capability and a macOS `afconvert`-backed pre-transcode in the speech-core pipeline. BlueBubbles declares `preferAudioFileFormat: "caf"`. Other channels are unaffected. Falls back to the original buffer when the host platform, the source/target pair, or the transcoder process can't produce the preferred container — so non-Darwin hosts and unsupported provider combinations are unchanged.

Also adds a `caff` magic-byte sniff in `src/media/mime.ts` so the auto-reply host-local-media validator (which uses `file-type` and didn't recognize CAF natively) accepts the buffer instead of dropping it as "⚠️ Media failed."

Fixes openclaw#72506.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Filter SwiftPM dependency build results from the manual macOS CodeQL shard before upload. Verified with workflow sanity, local jq filtering, and profile=macos-security branch proof in 15m54s. PR CI has the same unrelated extensions/memory-core timeout failure currently present on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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