Skip to content

fix(agents): inherit subagent thinking defaults#84007

Open
stevenepalmer wants to merge 5 commits into
openclaw:mainfrom
stevenepalmer:fix-subagent-thinking-defaults
Open

fix(agents): inherit subagent thinking defaults#84007
stevenepalmer wants to merge 5 commits into
openclaw:mainfrom
stevenepalmer:fix-subagent-thinking-defaults

Conversation

@stevenepalmer
Copy link
Copy Markdown
Contributor

@stevenepalmer stevenepalmer commented May 19, 2026

Summary

  • Subagent spawns now inherit the requester session's persisted thinking level when the spawn request and agent config do not specify one.
  • The fallback order is explicit spawn thinking, requester agent subagent default, target agent subagent default, global subagent default, then requester session thinking.
  • Existing explicit/configured thinking behavior is unchanged.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Motivation

A user-selected session thinking level should carry into subagents by default. Before this change, a parent session could run with one thinking setting while a child session silently lost that setting unless the spawn request or config repeated it.

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: sessions_spawn(runtime="subagent") now preserves requester session thinking as the final fallback when no explicit or configured subagent thinking is set.
  • Real environment tested: Local OpenClaw checkout in a Linux container, on branch fix-subagent-thinking-defaults.
  • Exact steps or command run after this patch:
    • ./node_modules/.bin/vitest run src/agents/subagent-spawn.test.ts --config test/vitest/vitest.agents.config.ts
    • ./node_modules/.bin/vitest run src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts --config test/vitest/vitest.unit-fast.config.ts
  • Evidence after fix: Terminal output captured from the patched branch:
    $ git branch --show-current
    fix-subagent-thinking-defaults
    
    $ ./node_modules/.bin/vitest run src/agents/subagent-spawn.test.ts --config test/vitest/vitest.agents.config.ts
    Test Files  1 passed
    Tests       10 passed
    
    $ ./node_modules/.bin/vitest run src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts --config test/vitest/vitest.unit-fast.config.ts
    Test Files  1 passed
    Tests       5 passed
    
  • Observed result after fix: The spawn-path coverage persists the inherited requester thinkingLevel onto the child session, while explicit/configured thinking continues to take precedence.
  • What was not tested: A live provider-backed subagent run.

Root Cause (if applicable)

The subagent thinking resolver only knew about explicit spawn input and configured subagent defaults. It did not receive requester session thinking, so it had no way to preserve the caller's persisted thinking level.

Regression Test Plan (if applicable)

  • Coverage level:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
    • src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts
    • src/agents/subagent-spawn.test.ts
  • Locked-in scenario: caller session thinking is inherited only after explicit and configured subagent thinking options are absent.
  • Existing coverage before this patch covered explicit and configured defaults, but not caller-session inheritance.

User-visible / Behavior Changes

Subagents spawned without explicit or configured subagent thinking now inherit the requester session's thinking level.

Diagram (if applicable)

explicit spawn thinking
  -> requester agent subagent thinking
  -> target agent subagent thinking
  -> global subagent thinking
  -> requester session thinking

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • No security-impacting changes identified.

Repro + Verification

Environment

  • OS: Linux container
  • Runtime/container: Local OpenClaw checkout
  • Model/provider: N/A; tests use mocked spawn/runtime paths
  • Integration/channel: N/A
  • Relevant config: test config with agents.defaults.subagents.thinking and mocked requester session store entries

Steps

  1. Run the focused resolver test.
  2. Run the focused subagent spawn test.
  3. Confirm explicit/configured thinking still wins.
  4. Confirm requester thinking is persisted to the child session only when no higher-precedence thinking is set.

Expected

Subagent thinking precedence is explicit spawn value, requester agent default, target agent default, global default, then requester session thinking.

Actual

The new tests match that precedence and verify child-session persistence.

Evidence

Included evidence:

  • Focused test commands and passing results are listed above under real behavior proof.

Human Verification (required)

  • Verified scenarios: resolver precedence and child-session persistence.
  • Edge cases checked: explicit thinking still overrides defaults; global default still overrides requester thinking.
  • Not verified: live provider-backed subagent execution.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • Upgrade steps: N/A

Risks and Mitigations

  • Risk: a child session may now use a higher thinking effort when the parent session is configured that way.
  • Mitigation: explicit spawn thinking and configured subagent defaults still take precedence.

Pi real behavior proof — 2026-05-20

Behavior or issue addressed:

  • Verifies native sessions_spawn(runtime="subagent") thinking-default inheritance on the PR branch, including persisted child-session thinkingLevel behavior.

Real environment tested:

  • Real Raspberry Pi node: pi-claw.
  • Architecture/kernel: aarch64, Linux 6.18.29+rpt-rpi-2712.
  • Branch checkout on Pi: stevenepalmer:fix-subagent-thinking-defaults.
  • Commit tested: 558cbe2.

Exact steps or command run after this patch:

node scripts/test-projects.mjs   src/agents/subagent-spawn.test.ts   src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts

Evidence after fix:

[test] starting test/vitest/vitest.unit-fast.config.ts
src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts
  6 tests passed

[test] starting test/vitest/vitest.agents.config.ts
src/agents/subagent-spawn.test.ts
  11 tests passed

[test] passed 2 Vitest shards in 24.92s

Observed result after fix:

  • The Pi branch checkout passed the sessions_spawn thinking-default and persisted child-session thinkingLevel coverage.
  • Tested precedence: explicit spawn -> requester agent config -> target agent config -> global config -> requester session thinking.

What was not tested:

  • No paid external model provider call was made; the proof focuses on the native spawn planning/session persistence behavior that controls the thinkingLevel default.

Live native sessions_spawn proof — 2026-05-20

Behavior or issue addressed:

  • Adds the rank-up proof ClawSweeper requested: a live native sessions_spawn(runtime="subagent") run with omitted child thinking, showing the child inherited the parent thinking level.

Real environment tested:

  • Running OpenClaw gateway: 2026.5.18.
  • Parent session: agent:main:dashboard:c0098499-aab4-4abe-a285-e866e299c320.
  • Child session: agent:main:subagent:6ba2b844-766e-40a5-9a9e-808364c22bef.
  • Run id: 9592e938-8b19-4309-84cf-46bb60227c85.
  • Auth/account values are redacted below.

Exact steps or command run after this patch:

1. Read parent session status.
2. Call native sessions_spawn with runtime="subagent" and no thinking field:
   taskName: pr_84007_live_thinking_proof
   task: Live proof for PR #84007. Reply exactly: PR_84007_CHILD_DONE
   cleanup: keep
   context: isolated
3. Read child session status after completion.
4. Inspect child runtime trajectory for session.started/model.completed evidence.

Evidence after fix:

Parent session status:
OpenClaw 2026.5.18
Model: openai-codex/gpt-5.5
Session: agent:main:dashboard:c0098499-aab4-4abe-a285-e866e299c320
Execution: direct · Runtime: OpenAI Codex · Think: medium · Text: low

sessions_spawn input:
{
  "runtime": "subagent",
  "mode": "run",
  "taskName": "pr_84007_live_thinking_proof",
  "cleanup": "keep",
  "context": "isolated",
  "task": "Live proof for PR #84007. Reply exactly: PR_84007_CHILD_DONE"
}

sessions_spawn result:
{
  "status": "accepted",
  "childSessionKey": "agent:main:subagent:6ba2b844-766e-40a5-9a9e-808364c22bef",
  "runId": "9592e938-8b19-4309-84cf-46bb60227c85",
  "mode": "run",
  "taskName": "pr_84007_live_thinking_proof",
  "modelApplied": true
}

Child session status:
OpenClaw 2026.5.18
Model: openai/gpt-5.5
Session: agent:main:subagent:6ba2b844-766e-40a5-9a9e-808364c22bef
Tasks: latest succeeded · subagent · Live proof for PR #84007. Reply exactly: PR_84007_CHILD_DONE
Execution: direct · Runtime: OpenAI Codex · Think: medium · Text: low

Child trajectory excerpts:
session.started:
  sessionKey=agent:main:subagent:6ba2b844-766e-40a5-9a9e-808364c22bef
  runId=9592e938-8b19-4309-84cf-46bb60227c85
  provider=openai-codex
  modelId=gpt-5.5
  authProfileId=[REDACTED]

model.completed:
  assistantTexts=["PR_84007_CHILD_DONE"]
  timedOut=false
  promptError=null

Observed result after fix:

  • The parent live session was running with Think: medium.
  • The native sessions_spawn call omitted the thinking field.
  • The created child subagent session also ran with Think: medium and completed the assigned task.
  • This shows the child inherited the parent thinking level for a live native subagent spawn.

What was not tested:

  • I did not include private auth profile values or full prompts in this proof; those were redacted.
  • Separate Raspberry Pi branch-checkout proof remains above for the PR branch tests on aarch64.

@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 May 19, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 19, 2026

Codex review: needs maintainer review before merge. Reviewed May 25, 2026, 10:45 PM ET / 02:45 UTC.

Summary
The PR changes native subagent spawn planning so omitted child thinking falls back through configured subagent defaults and the requester session’s effective thinking level, with focused tests for that precedence.

PR surface: Source +84, Tests +388. Total +472 across 7 files.

Reproducibility: yes. Current main docs promise caller inheritance, while the current resolver and spawn path do not pass caller thinking into the plan; the linked issue also provides concrete transcript evidence.

Review metrics: 1 noteworthy metric.

  • Thinking fallback chain: 1 changed resolution chain. Subagent spawn now treats requester subagent config and caller effective thinking as part of default resolution, which affects upgrade and cost behavior.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • Wait for checks-node-agentic-agents to finish before merge.

Risk before merge

  • Existing subagent spawns that omitted thinking may now run at the parent/effective thinking level, including higher-cost thinking, unless explicit spawn thinking or configured subagent defaults override it.
  • One relevant check, checks-node-agentic-agents, was still in progress during review, so merge should wait for that gate to finish.

Maintainer options:

  1. Land after checks complete (recommended)
    Accept the intentional inheritance behavior once the remaining agentic check finishes, because explicit spawn thinking and configured subagent defaults still take precedence.
  2. Add an opt-out before merge
    If maintainers do not want omitted child thinking to inherit parent cost or rigor by default, add an explicit compatibility path or documented config default before landing.

Next step before merge
No mechanical repair remains; maintainers should wait for the remaining check and accept the intentional compatibility/session-state behavior before merge.

Security
Cleared: No concrete security or supply-chain regression found; the diff changes local session/default resolution and tests without dependency, permission, token, workflow, or network-surface changes.

Review details

Best possible solution:

Land the focused agents fix after required checks finish, preserving explicit/configured subagent thinking precedence ahead of requester inheritance.

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

Yes. Current main docs promise caller inheritance, while the current resolver and spawn path do not pass caller thinking into the plan; the linked issue also provides concrete transcript evidence.

Is this the best way to solve the issue?

Yes. The PR fixes the missing resolver input at the native spawn seam, keeps explicit and configured subagent thinking ahead of caller inheritance, and adds focused regression coverage for the precedence.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 609d70d35e4f.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted after-fix live native subagent output plus Pi branch-checkout proof and focused rerun output for the final narrowed branch.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes redacted after-fix live native subagent output plus Pi branch-checkout proof and focused rerun output for the final narrowed branch.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 automation: Current PR review merge-risk labels are merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This fixes a real native subagent session-state/default bug with limited but user-visible orchestration impact.
  • merge-risk: 🚨 compatibility: Users who omitted child thinking may see different model effort and cost after upgrade.
  • merge-risk: 🚨 session-state: The patch changes which thinkingLevel is persisted onto child session rows during native subagent spawn.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes redacted after-fix live native subagent output plus Pi branch-checkout proof and focused rerun output for the final narrowed branch.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted after-fix live native subagent output plus Pi branch-checkout proof and focused rerun output for the final narrowed branch.
Evidence reviewed

PR surface:

Source +84, Tests +388. Total +472 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 5 88 4 +84
Tests 2 393 5 +388
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 481 9 +472

Acceptance criteria:

  • node scripts/test-projects.mjs src/agents/subagent-spawn.test.ts src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts
  • pnpm -s check:test-types
  • git diff --check upstream/main...HEAD

What I checked:

  • Current docs contract: The user-facing subagent docs say sessions_spawn thinking inherits the caller unless global or per-agent subagent thinking is configured, and explicit sessions_spawn.thinking still wins. Public docs: docs/tools/subagents.md. (docs/tools/subagents.md:143, 609d70d35e4f)
  • Current main resolver omits caller thinking: Current main resolves thinking from explicit input, target subagent config, and global subagent config only; it has no requester/caller fallback. (src/agents/subagent-spawn-thinking.ts:19, 609d70d35e4f)
  • PR adds requester/caller fallback: The PR resolver adds requester subagent config ahead of target/global config and uses caller thinking as the final fallback. (src/agents/subagent-spawn-thinking.ts:24, fb4c336ff31c)
  • PR passes requester state into planning: The PR reads requester session/effective thinking and passes requester config plus caller thinking into resolveSubagentModelAndThinkingPlan. (src/agents/subagent-spawn.ts:945, fb4c336ff31c)
  • PR tests inherited and configured thinking: The PR adds spawn-path tests for persisted requester thinking, off, requester agent defaults, selected-model thinking, runtime-model thinking, global defaults, and requester subagent policy precedence. (src/agents/subagent-spawn.test.ts:266, fb4c336ff31c)
  • Real behavior proof supplied: The PR body includes redacted live native sessions_spawn(runtime="subagent") output where parent Think: medium is inherited by the child, plus Pi branch-checkout proof and latest focused test reruns after the branch was narrowed. (fb4c336ff31c)

Likely related people:

  • steipete: Current main blame on the subagent thinking resolver and spawn planning lines points to 65a210553b; history also shows 7b36fa extracting the subagent spawn planning seams and 6c0cdf updating subagent model override behavior. (role: recent area contributor; confidence: high; commits: 65a210553b6c, 7b36fa76726a, 6c0cdf43e48e; files: src/agents/subagent-spawn.ts, src/agents/subagent-spawn-thinking.ts, src/agents/subagent-spawn-plan.ts)
  • Vincent Koc: Recent history on src/agents/subagent-spawn-thinking.ts includes the cycle/leaf type extraction that touched this narrow resolver file. (role: adjacent owner; confidence: medium; commits: 74e7b8d47b18; files: src/agents/subagent-spawn-thinking.ts)
  • brokemac79: Recent src/agents/subagent-spawn.ts history includes subagent completion handoff work near the same native subagent runtime surface. (role: recent adjacent contributor; confidence: medium; commits: f4b92f5e6c70; files: src/agents/subagent-spawn.ts)
  • martingarramon: Reviewed this PR’s precedence wording and Pi proof in the GitHub discussion and left LGTM on the intended order. (role: reviewer; confidence: medium; files: src/agents/subagent-spawn-thinking.ts, src/agents/subagent-spawn.test.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 rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. proof: supplied External PR includes structured after-fix real behavior proof. labels May 19, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 19, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 19, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels May 19, 2026
Copy link
Copy Markdown
Contributor

@martingarramon martingarramon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback chain in resolveSubagentThinkingOverride is correctly ordered and the session-state read is safe (readRequesterThinkingLevel catches errors and returns undefined, so a missing or unreadable session store doesn't break spawning). One documentation mismatch to fix before merge:

PR body description doesn't match code

The summary says the fallback order is "explicit spawn thinking, target agent subagent default, global subagent default, then requester session thinking." But the code places requesterAgentConfig.subagents.thinking before targetAgentConfig.subagents.thinking in resolvedThinkingDefaultRaw, and the test "prefers requester-agent subagent thinking over target-agent subagent thinking" confirms this is intentional. The correct order is: explicit spawn → requester agent config → target agent config → global config → requester session thinking.

The body should document this precedence clearly so maintainers can consciously approve it.

Core implementation: confirmed correct

readRequesterThinkingLevel reads entry.thinkingLevel from the requester's session store — the right source. The thinkingCandidateRaw fallback order is correctly guarded: params.thinkingOverrideRaw || resolvedThinkingDefaultRaw || params.callerThinkingRaw. Config-derived values take precedence over session state.

@stevenepalmer
Copy link
Copy Markdown
Contributor Author

@martingarramon thanks for the catch.

I updated the PR body to match the implemented precedence exactly:

explicit spawn -> requester agent config -> target agent config -> global config -> requester session thinking.

No code change was needed because the resolver/tests already enforce this order.

@stevenepalmer
Copy link
Copy Markdown
Contributor Author

Pi proof for PR #84007 is now complete.

Environment:

  • Real Raspberry Pi node: pi-claw
  • Architecture/kernel: aarch64, Linux 6.18.29+rpt-rpi-2712
  • Branch checkout on Pi: stevenepalmer:fix-subagent-thinking-defaults
  • Commit tested: 558cbe261a

Commands run on the Pi via the paired OpenClaw node host:

node scripts/test-projects.mjs \
  src/agents/subagent-spawn.test.ts \
  src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts

Result:

[test] starting test/vitest/vitest.unit-fast.config.ts
src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts
  6 tests passed

[test] starting test/vitest/vitest.agents.config.ts
src/agents/subagent-spawn.test.ts
  11 tests passed

[test] passed 2 Vitest shards in 24.92s

This covers the requested sessions_spawn(runtime="subagent") thinking-default behavior and the persisted child-session thinkingLevel cases on the Pi branch checkout. The tested precedence is:

explicit spawn -> requester agent config -> target agent config -> global config -> requester session thinking

Main also restored the Pi node exec approval file after the proof run.

@martingarramon
Copy link
Copy Markdown
Contributor

The description now matches the implemented precedence. Pi proof looks clean — aarch64 kernel, branch checked out directly, 5 thinking-inheritance tests pass. LGTM.

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 20, 2026

ClawSweeper PR egg

✨ Hatched: 🥚 common Frosted Merge Sprite

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: watches the merge queue.
Image traits: location review cove; accessory rollback rope; palette seafoam, black, and opal; mood determined; pose peeking out from the egg shell; shell smooth pearl shell; lighting subtle sparkle highlights; background tiny shells and proof notes.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Frosted Merge Sprite in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@stevenepalmer
Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

I moved the real Pi proof into the PR body using the exact proof field labels.

Proof summary:

  • Real Raspberry Pi node: pi-claw
  • aarch64 Linux 6.18.29+rpt-rpi-2712
  • Branch checkout: stevenepalmer:fix-subagent-thinking-defaults
  • Commit tested: 558cbe2
  • Command: node scripts/test-projects.mjs src/agents/subagent-spawn.test.ts src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts
  • Result: 2 Vitest shards passed in 24.92s; 6 sessions_spawn thinking-default tests + 11 subagent spawn tests passed.

martingarramon also reviewed the updated precedence wording and Pi proof and left LGTM: #84007 (comment)

@stevenepalmer
Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added the requested rank-up proof to the PR body: redacted live native sessions_spawn output showing inherited child thinking level.

Key evidence:

  • Parent live session: Think: medium.
  • Native sessions_spawn(runtime="subagent") call omitted the thinking field.
  • Spawn result accepted child session agent:main:subagent:6ba2b844-766e-40a5-9a9e-808364c22bef.
  • Child live session status after completion: Think: medium.
  • Child trajectory shows session.started/model.completed for run 9592e938-8b19-4309-84cf-46bb60227c85 and assistant output PR_84007_CHILD_DONE.

I redacted auth/account details and did not paste full prompts. The earlier Pi proof remains in the PR body for branch-checkout aarch64 test coverage.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels May 20, 2026
@clawsweeper clawsweeper Bot added 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 merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels May 21, 2026
@stevenepalmer
Copy link
Copy Markdown
Contributor Author

PR-Machine stale-base refresh for fix-subagent-thinking-defaults.

Pushed merge commit 3c7b0906749491b62c846cc4e4f48a19c1d8eba4 to bring the branch up to current upstream/main.

Validation run after the merge:

  • CI=true COREPACK_HOME=/home/node/.openclaw/workspace/agents/pr-machine/workspace/.corepack pnpm -s vitest run src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts src/agents/subagent-spawn.test.ts — passed (3 files, 33 tests)
  • CI=true COREPACK_HOME=/home/node/.openclaw/workspace/agents/pr-machine/workspace/.corepack pnpm -s check:test-types — passed
  • git diff --check upstream/main...HEAD — passed

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 21, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 21, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 May 21, 2026
@martingarramon
Copy link
Copy Markdown
Contributor

LGTM holds on 3c7b090 — the PR-Machine merge commit doesn't touch the author's diff. Original review stands.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 22, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 22, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 22, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 22, 2026
@stevenepalmer
Copy link
Copy Markdown
Contributor Author

Pushed a2cf6a089a to resolve the persisted caller-model thinking fallback.

Validation:

  • pnpm -s vitest run src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts --config test/vitest/vitest.unit-fast.config.ts passed (1 file, 9 tests)
  • pnpm -s vitest run src/agents/subagent-spawn.test.ts --config test/vitest/vitest.agents.config.ts passed (1 file, 17 tests)
  • pnpm -s check:test-types passed
  • git diff --check upstream/main...HEAD passed

@clawsweeper re-review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 22, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@martingarramon
Copy link
Copy Markdown
Contributor

Body updated. The documented precedence now puts requester agent subagent default before target agent subagent default, matching resolvedThinkingDefaultRaw and the test expectation. LGTM.

@stevenepalmer
Copy link
Copy Markdown
Contributor Author

Updated fix-subagent-thinking-defaults with 36812f3cea to merge current upstream/main and resolve the subagent thinking conflict.

Validation passed:

  • node scripts/test-projects.mjs src/agents/subagent-spawn.test.ts src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts
  • pnpm -s check:test-types
  • git diff --check upstream/main...HEAD
  • git merge-tree --write-tree HEAD upstream/main

@clawsweeper re-review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 26, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@stevenepalmer
Copy link
Copy Markdown
Contributor Author

Updated fix-subagent-thinking-defaults with fb4c336ff3 to narrow the branch to the subagent thinking implementation and focused tests only.

Removed the unrelated generated viewer/template/script/UI/extension churn from the PR diff by rebuilding the branch on current upstream/main.

Validation passed:

  • node scripts/test-projects.mjs src/agents/subagent-spawn.test.ts src/agents/openclaw-tools.subagents.sessions-spawn-applies-thinking-default.test.ts
  • pnpm -s check:test-types
  • git diff --check upstream/main...HEAD
  • git merge-tree --write-tree HEAD upstream/main

@clawsweeper re-review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 26, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@martingarramon
Copy link
Copy Markdown
Contributor

PR body documents the precedence as explicit spawn → requester agent config → target agent config → global config → requester session thinking, matching subagent-spawn-thinking.ts:22–27. CI green. LGTM.

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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sessions_spawn(runtime="subagent") ignores inherited/per-agent subagent thinking defaults and initializes children at low

2 participants