Skip to content

fix(agents): subagents of scheduled runs get the guest toolsBySender["*"] entry - #188442

Open
nxmxbbd wants to merge 8 commits into
openclaw:mainfrom
nxmxbbd:fix/senderless-child-tool-snapshot
Open

nxmxbbd wants to merge 8 commits into
openclaw:mainfrom
nxmxbbd:fix/senderless-child-tool-snapshot

Conversation

@nxmxbbd

@nxmxbbd nxmxbbd commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #188441
Related: #178815 (broader consolidation of child authority; this change only restores the spawn snapshot for one case)

What Problem This Solves

Fixes: a subagent spawned by an isolated scheduled run gets the guest toolsBySender["*"] entry when it starts, even though the run itself does not apply sender policy (a run capped with toolsAllow, or a run of a job an owner created).

User Impact

User impact: subagents (and their own subagents) of such runs now get the same sender policy as the run: the tool snapshot recorded when they were spawned, as released versions do. Current global, agent, provider, sandbox and sub-agent restrictions still apply.

The guest "*" entry no longer applies to these children in place of the run's policy, which has three visible effects, all matching the run itself:

  • its denies no longer remove tools the run had;
  • tools that only the "*" entry grants (for example an optional plugin tool in its alsoAllow) no longer reach these children, as they never reached the run;
  • the children are no longer treated as sender-restricted: like the run, they may start helpers of other agents, and the sender-only confinement (working directory, agent and session-root pinning, ACP root rules, the delegated deny floor, the session permission policy) does not apply to them.

Unchanged:

  • runs that apply sender policy themselves (for example a webhook run) and their subagents still get the "*" entry, like the run;
  • children of turns that have a sender keep that sender's current entry;
  • senderless work sent to such a child from any other session, from a later or retried run of the same job, or by any other turn opened on the run's own session (another job's session: target, a hook request naming that session key, an operator turn) still resolves current sender policy;
  • runs on a shared or named session (main and session: targets, including names shaped like run keys) never record the exception;
  • children spawned before this change keep today's behavior.

Not changed (same as main, no regression):

  • turns placed on a worker environment do not record the exception yet: their tool authority is prepared before the run is admitted, so their children keep today's behavior;
  • visible children (sessions_spawn with visible: true, or sessions.create) do not carry it: their creation path does not persist the record;
  • uncapped runs on CLI backends (tools served over the Gateway MCP loopback) do not record it: that surface resolves a senderless turn with when-sender-id, so it is not marked;
  • ACP children the run spawns directly (runtime: "acp") get no sub-agent envelope from a scheduled run (as on main), so the record is not read for them;
  • a capped run whose own turn has a group restriction records a sender restriction instead.

Why This Change Was Made

Since #157806, a child's admission that carries its requester's origin resolves current requester policy again from that origin. A scheduled run's origin has its run session key but no sender, so the lookup fell through to "*", whether or not the run applied sender policy, and nothing a child's later admission can read recorded which it was.

The spawning turn now records it next to the child's inherited snapshot, and a later admission keeps the snapshot only when the request comes from that same run occurrence: its own turn stamps its requester origin with its fresh per-run session key, so another turn opened on the same session (another job, a hook, an operator) never counts as the run.

Docs: the nesting.md tool-policy line now describes main's behavior since #157806 (senderless work that carries a requester origin re-resolves current sender policy; released versions kept the snapshot for every senderless child run) and states this exception, which restores the snapshot only for a run's own work.

How the exception is recorded and checked

The record is inheritedToolPolicySource: "scheduled-run" together with inheritedToolPolicyRunSessionKey, the run's own per-run session. The host writes both only when the spawning turn resolved without sender policy, with no sender and no operator, on a per-run session that the isolated runner created fresh for this run. That last fact comes from the run's admitted scheduled execution context (set only for detached isolated or current runs whose run key is new), never from the shape of the session key. sessions.patch does not accept either field, plugin extension slots cannot claim their names (reserved), and patching a child's inherited allow or deny list drops the exception.

A later admission keeps the snapshot only when the request origin is that same run: senderless, no operator, its session key equal to the recorded one, and stamped by that run's own turn. The run's own turn stamps the requester origin it hands to its tools with its per-run session key (scheduledRunSessionKey, set only from the same host fact that records the exception, copied only from an already captured origin, never from flat request input); its sub-agents inherit that origin unchanged. The new check reads only the child's own row; it adds no parent or intermediate row reads (an explicit delegation grant keeps its existing lineage check), so compaction, model fallback or the post-prompt sync of the run session cannot invalidate an admitted child's prepared policy. Nested children receive the exception and the run key from their parent's own admission. Completion batches keep it only when every completing child records the same run. Any other origin-bearing admission drops it. SessionEntry (exported through the plugin SDK) gains the "scheduled-run" source value and the optional run key.

Housekeeping (line caps): hasCliSessionReuseMetadata moves unchanged from run-prompt-executor.ts to run-cli-session.ts; the new sessions.patch rows live in sessions-patch.subagent-policy.test.ts.

Evidence

Built Gateway from this branch and, for the main column, the same build with every changed source file swapped back to main (b9dd04d047f); scripted model; toolsBySender: { "*": { deny: ["read"] } }; capped runs use a toolsAllow that includes read. Each cell is what the run's child got when it called read on a sentinel file in that turn (offered and returned the file / refused / not offered).

Turn that reaches run A's child main this PR
Run A's own turn spawns the child not offered returned
Run A's own turn sends the child more work (sessions_send) not offered returned
Grandchild spawned by that child not offered returned
Run A's run session rewritten while the child is admitted (compaction-style row rotation) not offered returned
Fresh child after upgrading from 2026.10.8, 2026.10.9 or 2026.11.3 (the pre-upgrade child row stays unmarked) not offered returned
Another job whose sessionTarget is session:<run A's key> sends to the child not offered refused (current "*" policy)
A hook request naming run A's session key sends to the child not offered refused (current "*" policy)
A forced re-run of the job after run A failed (new run key) sends to the child not offered refused (current "*" policy)
Gateway restarted mid-run (run A aborted, never resumed), then a turn on run A's key sends to the child not offered refused (current "*" policy)
Operator chat.send on run A's key sends to the child returned returned
Job on a persistent session: target (not a per-run session) not offered not offered
Webhook-triggered run (applies "*" itself): its child not offered not offered
Group turn with a sender (the repo's QA-lab Telegram Bot API stub): its child returned (sender's own entry) returned

"Refused" rows: the call is refused at execution with "read is not available in this turn" under the current "*" policy. Unlike main, where read is never offered, it stays listed because it was offered on the run's own earlier turn (definitions stay pinned within a session). Runs hosted by the Codex harness are not exercised end to end here.

  • src/agents/requester-tool-policy.test.ts: the record (only a run's own turn on its fresh session; not a run-shaped key without the runner's fact, another session, sender policy, an operator, a sender or a group restriction), the check (child, nested child, blank sender kept; legacy child, a mark without its key, another session, the run's stamp on another session, a later run, operator, sender re-resolve), side effects, origin-free resume, completion batches, own-row capability reads, and a prepared read replayed after the run's row is rewritten.
  • Stamp rows: requester-origin.test.ts (only from a captured origin, carried only for the same session), conversation-capability-profile.test.ts / tool-resolution.scheduled-run-origin.test.ts (only the run's own turn on its fresh session stamps), gateway-caller-context.test.ts, agent-tools.delegated-authority.test.ts, mcp-http.scheduled-run-origin.test.ts (callers and loopback calls keep the stamped origin).
  • codex-subagent-tool-policy.test.ts: the Codex harness's retained requester facts for a run child name only the child's row.
  • Spawn rows (native; ACP via acp-spawn-policy.test-support.ts, mutant only): run key and exception persist only together. Execution context rows: the fresh run session is exposed only for a detached run on its own fresh session. sessions.patch rows (sessions-patch.subagent-policy.test.ts): a patched ceiling drops the exception, never a sender restriction.
  • RED: each changed test file run alone against main's production source fails its new rows on their assertions in 8 files, e.g. keeps the sender snapshot for a child of a senderless scheduled run: expected { allow: undefined, deny: [ …(2) ] } to be undefined (main applies the "*" deny to the child). requester-origin.test.ts, execution-context-admission.test.ts and isolated-agent.session-identity.test.ts call helpers main does not have, so they fail on the missing helper rather than on a behavioral assertion and their rows are covered by the mutants below; codex-subagent-tool-policy.test.ts passes on main by design (it pins that a run child's harness facts name only the child's row).
  • Mutants: 30 single-condition mutants of the fix (each dropping one check of the record, the occurrence check, the stamp or a carrier; three re-anchored after the code moved) each turn the intended row red; none survives.
  • tsgo:core, tsgo:core:test, oxlint, oxfmt on the touched files, check:test-lines-ratchet and git diff --check: clean.
  • Test cost: +871 test lines; the 471 over the 400-line allowance are recorded in config/test-lines-allocations/scheduled-run-child-tool-snapshot.txt (rows on each owner of the record, the run-key check and the stamp; the table above is the end-to-end proof). Per-file test time (pnpm test <file> --maxWorkers=1), base -> head: requester-tool-policy.test.ts 11.2 -> 12.4 s (+38 tests), isolated-agent.session-identity.test.ts 27.3 -> 30.8 s (two rows on the real isolated runner); the other changed files within 0.5 s of base, including conversation-capability-profile.test.ts (44.1 -> 43.6 s, over 30 s on main) and agent-tools.delegated-authority.test.ts (29.9 -> 29.8 s, with the three caller rows folded in instead of a new file); new files tool-resolution.scheduled-run-origin.test.ts 12.0 s, mcp-http.scheduled-run-origin.test.ts 12.9 s, sessions-patch.subagent-policy.test.ts 10.7 s (mostly transform of the Gateway modules they test). CI seconds once available.

A subagent spawned by an isolated scheduled run resolved toolsBySender again
when it started, from the run's senderless origin, and got the "*" entry even
when the run itself resolved without sender policy (a run capped with
toolsAllow, or an owner's internal run). The child then lost tools the run
had, and got any grants or side effects of the "*" entry the run never applied.

Record at spawn, on the host side, that the spawning turn was such a run:
"scheduled-run" next to the inherited snapshot, together with the run's own
per-run session key. It is recorded only for a turn on a per-run session the
isolated runner created fresh for this run (a fact from the run's admitted
scheduled context, never the key's shape), with no sender and no operator.

A per-run session key can still be targeted by other turns (another job
with that session target, a hook with a request session key, an operator),
so the key alone does not identify the run. The run's own turn therefore
stamps its requester origin with its session key when its tools are built;
the stamp is taken only from that host result, is carried by origin copies
of the same run (Gateway loopback tool calls, the outer run's caller
identity, inputs the run queued), and is never read from request content.

A later admission keeps the child's spawn snapshot only when its origin
carries that stamp and is that same run: senderless, no operator, the same
session key. The check reads only the child's own row, so rewrites of the
run session (compaction, model fallback, post-prompt sync) do not invalidate
an admitted child. Nested children receive the record from their parent's
admission. Any other turn on the run's session, a run aborted by a Gateway
restart or retried under a new key, runs that apply sender policy, shared or
named sessions, and children spawned before this change keep resolving
current sender policy as before.
@clawsweeper

clawsweeper Bot commented Oct 30, 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 extensions: codex size: XL labels Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Maintainer security review required

This external contributor PR changes sensitive security components. A maintainer must review these changes before merging.

Current SHA: a05ca0fcc382b40ebfefe6c940449d30d1de175c

These sensitive security changes were made:

  • src/agents/delegated-tool-policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/requester-tool-policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/tool-resolution-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/worker-environments/worker-tool-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

After reviewing the changes, post a new PR comment containing only approval commands, each on its own line:

/allow-security-sensitive-change

A later push requires a fresh approval comment.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Preserves a scheduled run’s inherited tool snapshot for descendants handling work from that same run occurrence.

Example: An isolated automation allows read and sessions_spawn while toolsBySender["*"].deny contains read.

  • Before: The automation can read a file, but its child and grandchild are not offered read.
  • After: Children handling that occurrence’s work can read the file within their inherited ceiling and current non-sender restrictions.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused repair with production-path evidence and no actionable code findings; enforced approval remains separate from patch quality.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Reported built-Gateway runs with a scripted provider exercise the changed requester-policy owner through cron spawning, child reads, sessions_send, and grandchildren, including unrelated-origin controls and released-state upgrades; Codex runtime E2E is not claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Scheduled helpers lose tools their spawning automation was authorized to use and can acquire unrelated wildcard-policy effects.
Reason: Restores the documented scheduled-tool snapshot contract for the reported native execution path without adding configuration or undertaking the broader authority redesign.

Regression provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR repairs a current-main scheduled-delegation regression; no actionable introduced defects were found, and current-head maintainer security approval remains required.

Priority: P2
Reviewed head: a05ca0fcc382b40ebfefe6c940449d30d1de175c

Before merge

  • Await maintainer action - A maintainer must review the sensitive changes and approve head a05ca0f using the repository’s security approval command.

Findings

None.

Agent review details

How this fits together

Cron admits an occurrence, tool preparation captures its requester policy, spawn persists the child’s ceiling, and later admissions combine that ceiling with applicable current restrictions.

flowchart TD
  A[Cron occurrence admission] --> B[Prepared requester policy]
  B --> C[Stamped requester origin]
  B --> D[Persisted child tool snapshot]
  C --> E[Child execution admission]
  D --> E
  E --> F[Filtered tool execution]
Loading

Technical review

Best possible solution:

Retain this occurrence-scoped repair in the existing requester-policy and spawn owners while preserving current restrictions for unrelated admissions.

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

Current-main source shows origin-bearing scheduled children selecting current wildcard sender policy, and the linked report supplies matching built-Gateway tool listings.

Is this the best way to solve the issue?

The repair addresses the lost occurrence distinction at the existing policy owner, preserves inherited ceilings, and avoids adding parent-row dependencies or a parallel authority resolver.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Origin-bearing child admission changes intended behavior with a stated reason (fd2a6ca: Resolve current permissions for preserved requester identity when delegated work starts.)
  • Scheduled sender-policy exemption keeps the original intent (d8f1f09: Keep explicitly capped senderless automations from losing creator-authorized tools to fresh wildcard sender overlays.)
  • Sender-restricted spawn confinement keeps the original intent (9698a5b: Confine restricted senders to hidden same-agent helpers while retaining independent automation authority.)
  • Persisted child tool envelope keeps the original intent (3372088: Preserve effective requester tool ceilings for verified descendants instead of guessing sender identity.)
  • Cron prompt-executor helper relocation keeps the original intent (9646e87: Separate prompt execution from its dispatcher without changing execution behavior; the relocated CLI reuse predicate remains unchanged.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main still contains the reported path: Origin-bearing persisted children resolve current sender policy again, allowing a senderless scheduled origin to select the wildcard entry; current main has no scheduled-occurrence exception. (src/agents/requester-tool-policy.ts:375, 2e1b61901c5d)
  • Exception is restricted to the spawning occurrence: The resolver requires a persisted scheduled-run source, its recorded run key, and a matching stamped senderless, non-operator requester origin; other admissions retain current-policy resolution. (src/agents/requester-tool-policy.ts:424, a05ca0fcc382)
  • Persisted-state compatibility: The SessionEntry additions are optional, unmarked children retain existing behavior, and public ceiling patches clear the scheduled-run exception; the PR reports upgrades from 2026.10.8, 2026.10.9, and 2026.11.3 with legacy child rows left unmarked. (src/config/sessions/types.ts:422, a05ca0fcc382)
  • Production-entry-point evidence: The PR reports built-Gateway sentinel reads for direct children, sessions_send, grandchildren, and upgrades, with negative controls for hooks, later occurrences, shared sessions, and webhook runs; Codex end-to-end execution is expressly excluded.
  • Current-head approval gate: GitHub reports the reviewed head as mergeable, with the CI gate failing and security review pending because a maintainer must approve this revision; these are approval gates rather than demonstrated diff-caused test failures. (a05ca0fcc382)
  • Historical intent supports the narrow repair: fix(cron): senderless runs lose authorized tools #112661 intentionally exempts explicitly capped scheduled work from fresh sender overlays, while fix(agents): block visible and cross-agent spawns for restricted senders #165418 preserves independently authorized automations and confines actual sender-restricted work. (src/agents/conversation-capability-profile.ts:171, d8f1f098e58e)

PR surface

Source +259, Tests +871, Docs 0, Other +2. Total +1132 across 57 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 42 337 78 +259
Tests 13 875 4 +871
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 57 1215 83 +1132

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 +337/-78; tests and support +875/-4 Production growth carries one occurrence distinction through existing owners; the larger test delta covers admission, persistence, transport, and identity boundaries.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #188441
Summary: This PR is the focused repair candidate for the linked scheduled-child snapshot regression.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The regression disrupts delegated scheduled work on installations with applicable wildcard sender policy, with limited blast radius.
  • merge-risk: 🚨 compatibility: The exported SessionEntry contract gains a scheduled-run source value and optional run-session key; legacy rows remain unchanged and upgrade behavior is documented.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • 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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-30T15:17:35.140Z sha 1f4336c :: blocked before merge. :: [P2] Preserve real exports or explain isolation in the new MCP mocks
  • reviewed 2026-10-30T18:53:41.307Z sha bb51184 :: blocked before merge. :: none
  • reviewed 2026-10-30T20:09:36.158Z sha 163521d :: blocked before merge. :: none
  • reviewed 2026-10-31T09:24:10.084Z sha f9bd4d5 :: blocked before merge. :: none
  • reviewed 2026-10-31T12:13:21.004Z sha 9fb77d7 :: blocked before merge. :: none

Reviewed November 15, 2026, 8:19 AM ET / 13:19 UTC (Revision 6).

The config and before-tool-call mocks in mcp-http.scheduled-run-origin.test.ts
now spread the real module via importOriginal and override only the export
the test needs, as the mock-export ratchet requires. The tool resolver mock
stays closed with a mock-isolation note: the real resolver loads the whole
Gateway tool surface, while these rows only check the origin it hands back.
The test-line allocation covers the added lines.
@nxmxbbd

nxmxbbd commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

…d-tool-snapshot

Resolve src/cron/isolated-agent/run-prompt-executor.ts after openclaw#188514 moved
resolveCliChildAbortSignal into run-admission.ts: use main's helper, keep
hasCliSessionReuseMetadata in run-cli-session.ts, and keep the scheduled-run
freshRunSessionKey binding.
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 30, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 30, 2026
@nxmxbbd

nxmxbbd commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. label Oct 30, 2026
…d-tool-snapshot

Resolve src/agents/agent-tools.delegated-authority.test.ts after openclaw#188552
appended its prepared-write tests: keep both test blocks and the combined
gateway-caller-context import. The import now replaces main's one-line
import, so the exact test-line allocation drops from 868 to 867.
@GoatInAHat

Copy link
Copy Markdown
Contributor

The current CI failure at 9394b5faf2c8c386964d7c6851e570f675a522bb is the test-line ratchet: 6,314,267 lines against a 6,313,225 ceiling. The existing +867 allocation already matches the +867 test delta. Comparing the exact CI base with the tested merge leaves the same inherited 1,042-line shortfall; this is not a missing allocation for the new tests, although the current gate still blocks it.

The security guard separately requires fresh maintainer approval for the current SHA. The earlier no-findings review covered 163521ddf981e230387ee40c241947daf36a771e, so it does not clear the current-head gates. Could the baseline be reconciled with current main and the review evidence refreshed after that update?

…d-tool-snapshot

No conflicts. Picks up main's restored test-line headroom (openclaw#188780); the
allocation stays 867.
@nxmxbbd

nxmxbbd commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@GoatInAHat

Copy link
Copy Markdown
Contributor

Fresh exact-head CI at f9bd4d5985e2d2323e22d60da2ea0f01864422c3 (run 41187986208) has three failing jobs whose traces point at main-side test fixtures rather than this diff:

  • checks-node-changed-12: src/gateway/x-publication-owner-composition.e2e.test.ts reaches src/plugins/legacy-sdk-resource-host.ts:231 and fails with Gateway SDK resource host is not bound. Main's fix(test): bind SDK hosts in direct Gateway fixtures #189244 ("fix(test): bind SDK hosts in direct Gateway fixtures", merged 09:47Z) repairs this fixture after this run started.
  • checks-node-changed-compact-small-1: subagent-spawn.production-boundary.test.ts fails at the same unbound-host guard through the plugin subagent registry persistence fixture, with 120s timeouts and a swarm scheduler run already exists: host-capacity fixture collision. That test-support file is unchanged by this PR and has no SDK resource host binding under fix: refuse late plugin state work during Gateway shutdown #189008's admission guard.
  • checks-node-changed-compact-large-1: test/cron-message-read.integration.test.ts:812 fails with Claude Code process exited with code 1, also outside this diff.

Merging current main again should pick up #189244 for the publication case. The subagent-spawn fixtures need the same host binding upstream before this head can go green. ClawSweeper's fresh review of this head found no actionable code findings; the remaining merge block is maintainer security approval for the sensitive changes.

…d-tool-snapshot

No conflicts. Picks up main's SDK host binding for the X publication
fixture (openclaw#189244); the allocation stays 867.
@nxmxbbd

nxmxbbd commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
…d-tool-snapshot

Conflicts:
- src/agents/agent-tools.ts: main moved tool assembly into
  agent-tools.assembly.ts; the run-key pass-through next to
  inheritedToolPolicySource moves with it.
- src/agents/harness/codex-subagent-tool-policy.test.ts: keep both
  appended tests.
- src/cron/execution-context-admission.test.ts: import both sides'
  registry helpers.

The test-line record now covers the growth above main's 400-line
allowance (openclaw#197602): 871 net test lines, record 471.
- Main's embedded-runner mock rename (openclaw#190017) left the scheduled-run
  session identity rows on the old mock; use the file's runner mock.
- Main brought subagent-spawn.ts to its 700-line cap. The spawn's
  tool-policy source rule (sender, or a scheduled-run mark only with
  its run key) moves into inheritedToolPolicySourcePatch beside the
  inherited allow/deny patches; native spawn, its session patch and
  ACP spawn share it instead of repeating it, and the native spawn
  passes delegation.policy directly instead of a single-use alias.
  No behavior change.
@nxmxbbd

nxmxbbd commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Nov 15, 2026

This branch has not been deployed

No deployments
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 extensions: codex gateway Gateway runtime 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-review-required security-sensitive-changed size: XL status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Subagents of isolated scheduled runs get the guest toolsBySender["*"] entry instead of their parent's snapshot

2 participants