Skip to content

fix: let owners fork a chat with exec after a subagent or exec completion - #206483

Merged
obviyus merged 1 commit into
mainfrom
fix/fork-caller-authority
Nov 27, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/fork-caller-authority

Conversation

@obviyus

@obviyus obviyus commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

A plugin that forks the current chat with exec (for example better-prompt's /better, which calls api.runtime.subagent.runForkedTurn({ tools: ["read", "ls", "exec"] })) is refused with "This chat's tool policy does not allow read, ls and exec" when the owner uses it in a chat where the latest input is an internal wake: a subagent completion, an exec completion, a cron or sessions_send delivery, or a restart continuation. In an orchestrator chat that is most of the time.

Cause: the fork took its owner flag from the latest stored user row (__openclaw.senderIsOwner). The host stores every internal wake with senderIsOwner: false, whoever started the work. The transcript records who typed an input (attribution), not the authority a run holds. Introduced by #204411.

User Impact

  • An owner (a caller with the operator.admin scope) can fork any chat with exec, whatever the latest input is. /better works after a subagent or exec completion.
  • A caller without owner authority (for example a session writer with operator.sessions.write) still never gets exec. read and ls stay under the session's own policy, unchanged.
  • Sender, group and channel tool policy still follow the anchored turn.

Two plugin-visible behavior changes:

  1. Forks with no admitted operator caller no longer get exec, even on owner turns. A fork started from background work that no Gateway request started (for example an agent_end hook) has no operator grant, so exec is refused there. Before, such a fork got exec when the anchored turn was the owner's. The bundled skill-workshop review requests only ["skill_workshop"] and is unaffected. plugin-sdk-impact for runtime-member:runtime.subagent.runForkedTurn: 0 static references across 2,768 eligible ClawHub releases (2,333 complete, 432 partial, 3 failed coverage); the only bundled consumer is skill-workshop.
  2. An admin calling through a sessionAccess method on another person's owner turn now gets exec. fix(plugins): run session-scoped plugin forks in the admitted session #204411 refused it with a senderId === caller clause. That clause closed nothing: the same admin already ran exec on that turn through a plain operator.write method (its own e2e asserted it). The assertion that refused it is replaced with one that admits it.

Deferred, not written: an ownerAllowFrom decider for channel callers that arrive without an operator grant. No such fork entry point exists today; it lands when one is proven.

Why This Change Was Made

Authority is checked once, when the work starts, by the owner of that check. runPluginForkedTurn already admits the caller (execution.operatorAuthority); forkPluginSession now sets requester.senderIsOwner = operatorAuthority?.grant.owner === true and passes that requester to both prepareSessionFork (exec admission) and runSessionFork (capability profile, sandbox session tools, plugin tool context, memory-write provenance). The flag is an explicit boolean: several consumers restrict only on === false, so a missing flag would widen access.

  • readSessionForkRequesterFromTurn no longer returns senderIsOwner; the anchored turn supplies conversation facts and the model only.
  • prepareSessionFork loses the caller parameter and the senderId === caller clause; its single producer is gone.
  • Prompt-cache keep-warm prewarms (no caller, no tools) pass an explicit false.
  • No SDK type change. SubagentForkedTurnResult is unchanged.
  • Docs: docs/plugins/sdk-runtime.md says exec follows the caller's admitted authority, not the anchored turn.

Production code: +28 / −27 lines (flat). Tests: +135 / −23.

Evidence

Reproduction on the base (merge base 313b211):

  • vitest-source: the new test runs exec on the caller's admitted authority when the latest input is an internal wake fails at its first fork with { status: "refused", reason: "tool_policy" } (owner operator.admin caller, latest user row a stored inter_session/subagent_announce wake with senderIsOwner: false). The session-writer wake case passes on the base, as expected.
  • dist-nodts real Gateway E2E: isolated scratch Gateway on a random port, owner Control UI client (trusted-proxy identity with operator.admin), real Anthropic claude-sonnet-5-5, scratch plugin calling runForkedTurn with ["read", "ls", "exec"] from a sessionAccess method. The agent spawned a real subagent; its completion wake became the latest user row (provenance: inter_session / subagent_announce, senderIsOwner: false, requesterOrigin.operatorProfileId set). Fork result: { status: "refused", reason: "tool_policy" }.

Head:

  • vitest-source, one ocx test call, all green: gateway-plugin-forked-turn-session-tools.e2e.test.ts (4), gateway-plugin-forked-turn.e2e.test.ts (7), session-fork-run.test.ts, prompt-cache-keep-warm.test.ts, session-manager-model-context-limits.test.ts, cron/maintenance-lifecycle.test.ts, cron/maintenance-snapshot.test.ts.
    • Owner caller forks with read/ls/exec after a subagent-completion wake and after an exec-completion (internal_system) wake, through a plain operator method and through a sessionAccess method: settled, exec output present.
    • Session writer (operator.sessions.write) after a wake: exec refused, read/ls settled.
    • A non-admin operator.write caller's fork reaches the plugin tool with senderIsOwner: false (explicit, not missing); the admin caller's fork with true.
  • dist-nodts real Gateway E2E, same script as the base: the latest user row was again a real subagent completion wake (inter_session / subagent_announce, senderIsOwner: false). Fork result: { status: "settled", value: { text: "FORK_EXEC_OK" } }. The recorded provider requests show the fork's exec tool call (echo FORK_EXEC_OK) and its tool result FORK_EXEC_OK, so the command ran, not only the model text.

Live Gateway check after both E2E runs: the ai.openclaw.peanutto pid did not change, and the live config was last written on 2026-11-24, before these runs.

…ored turn

Plugin forks read the owner flag from the latest stored user row. Internal wakes
(subagent and exec completions, cron, sessions_send, restart continuations) are stored
senderIsOwner: false, so an owner's /better fork was refused whenever a wake came last.

- forkPluginSession sets the requester owner flag from the admitted operator grant
  (operator.admin), explicit false otherwise, for both admission and the run.
- readSessionForkRequesterFromTurn no longer returns senderIsOwner.
- prepareSessionFork drops the caller param and the senderId === caller clause.
- Keep-warm prewarms pass an explicit false.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling plugin: file-transfer size: M labels Nov 27, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. labels Nov 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 27, 2026
@clawsweeper

clawsweeper Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR derives plugin-fork owner authority from the admitted caller instead of the anchored transcript message.

Example: An operator.admin caller requests read, ls and exec immediately after a subagent completion.

  • Before: The completion row records senderIsOwner: false, so the fork returns refused: tool_policy.
  • After: The admitted owner can run echo FORK_EXEC_OK under the session's tool policy.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused shared-owner repair with recorded production-path proof, distinct authority regressions and no actionable code findings; exact-head CI remains in progress.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied isolated real-Gateway run exercises a sessionAccess plugin fork after a real subagent completion: base returns tool_policy, while head records echo FORK_EXEC_OK and its tool result; scripted Gateway regressions additionally cover exec wakes and non-owner refusal.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Owners cannot run fork-based plugin helpers after an internal completion without sending another message.
Reason: The repair restores useful owner behavior through existing admission machinery, and its maintainer author explicitly records the plugin-visible tradeoffs.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs a current fork-authority bug, with no blocking code findings.

Reviewed head: 7b97ce48a4377258c5bd42d47f9f08ca0ecbbcf4

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway admits plugin fork requests, combines caller authority with the anchored conversation's policy and model, and passes eligible work to the shared session-fork runner.

flowchart TD
  A[Plugin fork request] --> B[Gateway caller admission]
  C[Anchored conversation facts] --> D[Fork requester]
  B --> D
  D --> E[Session tool policy]
  E --> F[Shared fork runner]
  F --> G[Model and permitted tools]
Loading

Technical review

Best possible solution:

Use the existing admitted caller grant consistently for fork preparation and execution while preserving anchored sender policy and session restrictions.

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

Current-main source establishes the refusal path, and the author records matching before/after live Gateway results; this review performed no runtime reproduction.

Is this the best way to solve the issue?

The patch fixes the shared authority boundary without transcript markers, backfills or another owner producer, and explicitly explains the intentional departure from prior fork policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ee8e86ba2eec.

Provenance checked

  • Fork exec admission changes intended behavior with a stated reason (56f8670: Refuse ineligible exec before model work and restrict session-scoped forks to the owner who sent the anchored turn.)
  • Stored requester attribution changes intended behavior with a stated reason (2a7ca163a57d77e8220965855329791d7d5ec: Reuse the anchored conversation's requester policy and prepared request for background forks; transcript owner attribution was carried with those facts.)
  • Prompt-cache prewarms keeps the original intent (b36ba3f: Keep idle prompt caches warm using tool-free forks of the session's existing request.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned change and current main: The introduced diff replaces transcript-derived owner authority and removes the caller-identity comparison; fetched main retains the original production behavior. (src/gateway/server-plugin-forked-turn.ts:287, 7b97ce48a437)
  • Existing authority producer: decideTurnGrant derives owner from operator.admin; prepareInProcessAgentExecution supplies the admitted operator authority, and both fork preparation and execution receive the same explicit owner boolean. (src/gateway/operator-admission.ts:233, 7b97ce48a437)
  • Synthetic attribution explains the failure: Transcript metadata deliberately clears owner attribution for internal provenance; using that recorded attribution for a newly admitted owner's fork therefore refuses legitimate exec. (src/sessions/user-turn-transcript.metadata.ts:85, 7b97ce48a437)
  • Recorded production-path proof: The full PR body records an isolated Gateway with a real model and real subagent completion: base refuses the fork, while head settles with FORK_EXEC_OK and a recorded exec call and tool result; this review did not execute target code. (7b97ce48a437)
  • Accepted plugin compatibility changes: The maintainer-authored body explicitly accepts refusing exec without an admitted operator caller and allowing admitted admins across anchored senders; the SDK documentation describes the new contract. The bundled Skill Workshop caller requests its own review tool rather than exec. Public docs: docs/plugins/sdk-runtime.md. (docs/plugins/sdk-runtime.md:300, 7b97ce48a437)
  • Prior intent and credited discussion: fix(plugins): run session-scoped plugin forks in the admitted session #204411 deliberately introduced pre-model owner-turn admission. Its landing discussion by obviyus credits etzelm; this PR explains why caller admission should replace that attribution-based restriction. (src/agents/session-fork-run.ts:209, 56f8670c3ec2)

PR surface

Source 0, Tests +112, Docs +4. Total +116 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 27 27 0
Tests 2 135 23 +112
Docs 1 12 8 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 174 58 +116

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test changes Production +27/−27; tests +135/−23 Production remains flat; test growth exercises distinct wake types, RPC admission paths and non-owner restrictions.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #206173
Summary: This PR and the earlier marker-based candidate address exec refusal caused by reading owner authority from completion-message attribution.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: Plugin forks without admitted operator authority lose exec eligibility; the maintainer-authored PR explicitly accepts and documents this behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • merge-risk: 🚨 compatibility: Plugin forks without admitted operator authority lose exec eligibility; the maintainer-authored PR explicitly accepts and documents this behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 27, 2026, 2:56 AM ET / 07:56 UTC.

@obviyus
obviyus merged commit 8b1df01 into main Nov 27, 2026
151 checks passed
@obviyus
obviyus deleted the fix/fork-caller-authority branch November 27, 2026 08:00
@obviyus

obviyus commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 8b1df01. Bug: plugin forks such as /better read the owner flag from the latest stored user row, and internal wakes (subagent or exec completions) are stored as non-owner, so an owner's fork with exec was refused after a wake. Fix: the fork's owner flag now comes from the caller's admitted grant (operator.admin), decided once at fork start; non-owner callers still never get exec. Proof: a real scratch Gateway on the merge base refused an owner's read/ls/exec fork after a real subagent completion wake; the same script on this head settled, and the provider log shows the fork's exec result FORK_EXEC_OK. CI green, local review clean.

vincentkoc added a commit that referenced this pull request Nov 27, 2026
…restoration-ci-189390-20261127

* commit '6feeb50a3f14fbf0aa5167d342f186dc4d67fc18': (9846 commits)
  fix: stop 2026-11-17 main Git checkouts from half-switching on a schema update (#206341)
  refactor(codex): centralize native completion delivery (#206447)
  fix(subagents): finish claimed stops after session rotation (#206405)
  fix: let owners fork a chat with exec after a subagent or exec completion (#206483)
  test(cli): gate agent --local cold-start processes and workers (#206466)
  perf(ci): skip baseline inventory when line-cap debt is empty (#189909)
  refactor(test): share core process-result fixtures (#174149)
  refactor(ci): reuse canonical budget flag parsing (#189480)
  fix: recover Codex chats after oversized requests (#206475)
  fix(agents): skip the bootstrap ritual in one-shot runs (#206477)
  fix(test): preserve stack coordinates in redacted failure reports (#152384)
  fix(gateway): return consistent unavailable response guidance (#191933)
  fix: preserve emphasis in Markdown table row labels (#205349)
  fix(nextcloud-talk): keep webhook spool helpers private (#206470)
  perf(plugins): overlay native receipts once per visible root (#206464)
  fix: keep GitHub comment approvals alive and skip repeat approval on the session PR (#206129)
  perf(config): retain one snapshot for unchanged validation results (#206465)
  refactor(test): reuse canonical secret fixture cleanup (#189492)
  refactor(subagents): own descendant Stop cancellation (#206444)
  refactor(subagents): keep announce cleanup action type private (#206407)
  ...
vincentkoc added a commit that referenced this pull request Nov 27, 2026
* commit 'fd681ab8786e062045fa5ec6261b1b06f60832eb': (2115 commits)
  fix: keep doctor --fix pending checks from creating SQLite sidecars (#206485)
  fix(ci): update iOS screenshot reducer gate (#206497)
  fix: keep chat photo previews sharp within their byte limits (#206461)
  fix: let agents use short Workboard card IDs
  fix(tui): run provider sign-in in the local TUI (#200605)
  improve(config): reduce repeated directory checks for larger agent rosters (#206494)
  perf(test): reuse the Periphery producer workflow snapshot (#189681)
  fix(ci): keep locale assets within the installed package budget (#206492)
  fix: preserve failed Apple chat messages across partial history pages (#205404)
  improve: avoid merging unrelated settings for agent directory lookups (#206489)
  fix: show typing while a queued follow-up turn runs (#201920)
  fix: stop 2026-11-17 main Git checkouts from half-switching on a schema update (#206341)
  refactor(codex): centralize native completion delivery (#206447)
  fix(subagents): finish claimed stops after session rotation (#206405)
  fix: let owners fork a chat with exec after a subagent or exec completion (#206483)
  test(cli): gate agent --local cold-start processes and workers (#206466)
  perf(ci): skip baseline inventory when line-cap debt is empty (#189909)
  refactor(test): share core process-result fixtures (#174149)
  refactor(ci): reuse canonical budget flag parsing (#189480)
  fix: recover Codex chats after oversized requests (#206475)
  ...
vincentkoc added a commit that referenced this pull request Nov 27, 2026
* commit 'fd681ab8786e062045fa5ec6261b1b06f60832eb': (923 commits)
  fix: keep doctor --fix pending checks from creating SQLite sidecars (#206485)
  fix(ci): update iOS screenshot reducer gate (#206497)
  fix: keep chat photo previews sharp within their byte limits (#206461)
  fix: let agents use short Workboard card IDs
  fix(tui): run provider sign-in in the local TUI (#200605)
  improve(config): reduce repeated directory checks for larger agent rosters (#206494)
  perf(test): reuse the Periphery producer workflow snapshot (#189681)
  fix(ci): keep locale assets within the installed package budget (#206492)
  fix: preserve failed Apple chat messages across partial history pages (#205404)
  improve: avoid merging unrelated settings for agent directory lookups (#206489)
  fix: show typing while a queued follow-up turn runs (#201920)
  fix: stop 2026-11-17 main Git checkouts from half-switching on a schema update (#206341)
  refactor(codex): centralize native completion delivery (#206447)
  fix(subagents): finish claimed stops after session rotation (#206405)
  fix: let owners fork a chat with exec after a subagent or exec completion (#206483)
  test(cli): gate agent --local cold-start processes and workers (#206466)
  perf(ci): skip baseline inventory when line-cap debt is empty (#189909)
  refactor(test): share core process-result fixtures (#174149)
  refactor(ci): reuse canonical budget flag parsing (#189480)
  fix: recover Codex chats after oversized requests (#206475)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
…tion (openclaw#206483)

## What Problem This Solves

A plugin that forks the current chat with `exec` (for example better-prompt's `/better`, which calls `api.runtime.subagent.runForkedTurn({ tools: ["read", "ls", "exec"] })`) is refused with "This chat's tool policy does not allow read, ls and exec" when the owner uses it in a chat where the latest input is an internal wake: a subagent completion, an exec completion, a cron or `sessions_send` delivery, or a restart continuation. In an orchestrator chat that is most of the time.

Cause: the fork took its owner flag from the latest stored user row (`__openclaw.senderIsOwner`). The host stores every internal wake with `senderIsOwner: false`, whoever started the work. The transcript records who typed an input (attribution), not the authority a run holds. Introduced by openclaw#204411.

## User Impact

- An owner (a caller with the `operator.admin` scope) can fork any chat with `exec`, whatever the latest input is. `/better` works after a subagent or exec completion.
- A caller without owner authority (for example a session writer with `operator.sessions.write`) still never gets `exec`. `read` and `ls` stay under the session's own policy, unchanged.
- Sender, group and channel tool policy still follow the anchored turn.

Two plugin-visible behavior changes:

1. **Forks with no admitted operator caller no longer get `exec`, even on owner turns.** A fork started from background work that no Gateway request started (for example an `agent_end` hook) has no operator grant, so `exec` is refused there. Before, such a fork got `exec` when the anchored turn was the owner's. The bundled `skill-workshop` review requests only `["skill_workshop"]` and is unaffected. `plugin-sdk-impact` for `runtime-member:runtime.subagent.runForkedTurn`: 0 static references across 2,768 eligible ClawHub releases (2,333 complete, 432 partial, 3 failed coverage); the only bundled consumer is `skill-workshop`.
2. **An admin calling through a `sessionAccess` method on another person's owner turn now gets `exec`.** openclaw#204411 refused it with a `senderId === caller` clause. That clause closed nothing: the same admin already ran `exec` on that turn through a plain `operator.write` method (its own e2e asserted it). The assertion that refused it is replaced with one that admits it.

Deferred, not written: an `ownerAllowFrom` decider for channel callers that arrive without an operator grant. No such fork entry point exists today; it lands when one is proven.

## Why This Change Was Made

Authority is checked once, when the work starts, by the owner of that check. `runPluginForkedTurn` already admits the caller (`execution.operatorAuthority`); `forkPluginSession` now sets `requester.senderIsOwner = operatorAuthority?.grant.owner === true` and passes that requester to both `prepareSessionFork` (exec admission) and `runSessionFork` (capability profile, sandbox session tools, plugin tool context, memory-write provenance). The flag is an explicit boolean: several consumers restrict only on `=== false`, so a missing flag would widen access.

- `readSessionForkRequesterFromTurn` no longer returns `senderIsOwner`; the anchored turn supplies conversation facts and the model only.
- `prepareSessionFork` loses the `caller` parameter and the `senderId === caller` clause; its single producer is gone.
- Prompt-cache keep-warm prewarms (no caller, no tools) pass an explicit `false`.
- No SDK type change. `SubagentForkedTurnResult` is unchanged.
- Docs: `docs/plugins/sdk-runtime.md` says `exec` follows the caller's admitted authority, not the anchored turn.

Production code: +28 / −27 lines (flat). Tests: +135 / −23.

## Evidence

**Reproduction on the base (merge base 824cc36):**
- vitest-source: the new test `runs exec on the caller's admitted authority when the latest input is an internal wake` fails at its first fork with `{ status: "refused", reason: "tool_policy" }` (owner `operator.admin` caller, latest user row a stored `inter_session`/`subagent_announce` wake with `senderIsOwner: false`). The session-writer wake case passes on the base, as expected.
- dist-nodts real Gateway E2E: isolated scratch Gateway on a random port, owner Control UI client (trusted-proxy identity with `operator.admin`), real Anthropic `claude-sonnet-5-5`, scratch plugin calling `runForkedTurn` with `["read", "ls", "exec"]` from a `sessionAccess` method. The agent spawned a real subagent; its completion wake became the latest user row (`provenance: inter_session / subagent_announce`, `senderIsOwner: false`, `requesterOrigin.operatorProfileId` set). Fork result: `{ status: "refused", reason: "tool_policy" }`.

**Head:**
- vitest-source, one `ocx test` call, all green: `gateway-plugin-forked-turn-session-tools.e2e.test.ts` (4), `gateway-plugin-forked-turn.e2e.test.ts` (7), `session-fork-run.test.ts`, `prompt-cache-keep-warm.test.ts`, `session-manager-model-context-limits.test.ts`, `cron/maintenance-lifecycle.test.ts`, `cron/maintenance-snapshot.test.ts`.
  - Owner caller forks with `read`/`ls`/`exec` after a subagent-completion wake and after an exec-completion (`internal_system`) wake, through a plain operator method and through a `sessionAccess` method: settled, exec output present.
  - Session writer (`operator.sessions.write`) after a wake: `exec` refused, `read`/`ls` settled.
  - A non-admin `operator.write` caller's fork reaches the plugin tool with `senderIsOwner: false` (explicit, not missing); the admin caller's fork with `true`.
- dist-nodts real Gateway E2E, same script as the base: the latest user row was again a real subagent completion wake (`inter_session` / `subagent_announce`, `senderIsOwner: false`). Fork result: `{ status: "settled", value: { text: "FORK_EXEC_OK" } }`. The recorded provider requests show the fork's `exec` tool call (`echo FORK_EXEC_OK`) and its tool result `FORK_EXEC_OK`, so the command ran, not only the model text.

Live Gateway check after both E2E runs: the `ai.openclaw.peanutto` pid did not change, and the live config was last written on 2026-11-24, before these runs.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
* fix(runtime): defer optional work under host memory pressure

* style(infra): format memory pressure admission

* style(gateway): format the deferred prewarm check

(cherry picked from commit 9f50802)

Companion audit: #207993 selected later for publication fixture isolation. #206779 required if the new Cron host-memory fixture spoofs platform: preserve native SQLite namespace. #206041/#206230/#206308/#206746 are separate cgroup detection and optimization changes; #206322 is service-aware cron run budget, #206483 forks chat and #206384 changes a main-only warmer.

Release adaptation: Extend the stable optional-memory owner and its existing callers only. Preserve cgroup/Bun/macOS behavior and upstream threshold cases; omit main-only prompt warmer, cgroup diagnosis, and Cron platform-spoof changes.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. plugin: file-transfer proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

1 participant