fix(subagents): keep thread-bound spawns isolated by default#79050
fix(subagents): keep thread-bound spawns isolated by default#79050jalehman wants to merge 2 commits into
Conversation
Avoid implicit requester transcript forks for thread-bound native subagent spawns unless context="fork" or threadBindings.defaultSpawnContext="fork" is explicitly configured. Refs #78055
|
Codex review: needs changes before merge. Summary Reproducibility: yes. The current-main source path is clear: omitted Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Update the remaining Matrix docs, then land the shared fallback and regression coverage once exact-head checks are green while leaving broader stale announce freshness on #78055. Do we have a high-confidence way to reproduce the issue? Yes. The current-main source path is clear: omitted Is this the best way to solve the issue? Yes, with one docs cleanup. Changing the shared thread-binding policy fallback is the narrowest runtime fix because explicit Full review comments:
Overall correctness: patch is correct Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 95a1c915312a. Re-review progress:
|
What
Reapplies the intended #78060 repair on a fresh OpenClaw-owned branch after the original contributor PR was accidentally closed with an unrelated empty head. Thread-bound native
sessions_spawnnow defaults omittedcontexttoisolated, while explicitcontext: "fork"and explicitthreadBindings.defaultSpawnContext: "fork"continue to fork.Why
#78055 reports subagent sessions inheriting unrelated requester transcript history. The original #78060 carried the right fix, but its contributor branch now points at
f2458d8828de71997ffa290aa2dc6e1177d06b57, which is already onmainand leaves the closed PR with no files. This PR supersedes #78060 and restores the intended behavior change.Attribution
This PR preserves the original contributor commit as the first commit on the branch:
41facf822677757f29fe5f3b103a143a341d17cccherry-picks original commit901404acf60043fa3b95fcfdf57c5244c2143495, authored by Eva (agent)<eva+agent-78055@100yen.org>.90619451037ffd39022a00267a6911200832f2b3is the Josh-authored sync commit for generated config docs, type comments, and changelog.Changes
Testing
node scripts/test-projects.mjs src/channels/thread-bindings-policy.test.ts src/agents/subagent-spawn.context.test.ts- passed, 2 Vitest shardspnpm config:docs:check- passedpnpm config:channels:check- passedpnpm config:schema:check- passedpnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/.generated/config-baseline.sha256 docs/channels/discord.md docs/concepts/session-tool.md docs/gateway/config-agents.md docs/gateway/config-channels.md docs/tools/subagents.md src/agents/subagent-spawn.context.test.ts src/channels/thread-bindings-policy.ts src/channels/thread-bindings-policy.test.ts src/config/bundled-channel-config-metadata.generated.ts src/config/schema.help.ts src/config/types.base.ts src/config/types.discord.ts extensions/discord/src/config-ui-hints.ts extensions/telegram/src/config-ui-hints.ts- passedgit diff --check- passedpnpm tsgo:test:src- failed on unrelated current-main OpenAI fixture typing insrc/agents/openai-transport-stream.test.tsandsrc/agents/pi-embedded-runner/openai-stream-wrappers.test.ts; this branch does not touch those filesRefs #78055. Supersedes #78060.