Skip to content

fix: restore session owner assignment for non-owner agent turns - #154239

Merged
roboclaw-bot merged 8 commits into
mainfrom
openclaw/fix-session-owner-assignment-20260921
Sep 30, 2026
Merged

roboclaw-bot merged 8 commits into
mainfrom
openclaw/fix-session-owner-assignment-20260921

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #125057

What Problem This Solves

Fixes: an agent can create a visible work session but cannot assign it to the verified channel requester when its turn lacks Gateway-owner authority.

User Impact

Live admitted agent turns can assign responsibility to a registered person or configured agent and read back the stored owner, including for non-admin Discord requesters. Non-owner channel turns receive assignment only unless they already have operator-write authority; those operators retain their existing bounded archive, restore, and Stop controls. Settings, deletion, global group changes, and cloud-profile discovery remain owner-gated. Senderless system management and explicit tool denies are preserved.

The administrator-attested channel/profile link is still required to identify “me.” Assignment does not create identity links, grant the assignee’s privileges, change creator/sharing authority, migrate existing owners, or change conditional visible-spawn inheritance. Another registered human remains a valid handoff target under the existing UI/RPC contract. Their personal USER.md supplies preferences on later eligible turns; personal prompt selection is not a secrecy boundary or permission to access that person’s credentials.

Why This Change Was Made

Expose a narrow assignment action through the existing sessions tool, bind it to a live admitted turn, and retain the canonical assignment writer and dispatch/commit authorization checks. CLI tool projection and the final MCP grant consume the same admission. Standalone HTTP or attached sessions cannot gain assignment merely through transport binding.

The conflict repair preserves current main’s scoped session controls, multiperson user selection, personal-tool execution wrapper, and collector Stop restriction. Original contributor ancestry is retained. The previously landed CI planner and SQLite export repairs are now inherited from main; the separate row-packing PR is not a dependency.

Evidence

  • Current candidate b0ce03d35a85 (tree-identical signing of reviewed 237f7e2d709c) passed 268 distinct cases across 11 files (269 executions, including one CLI replay after restoring current-main fixture cleanup). Initial selection: 266 cases / 10 files, 297.38 seconds wrapper wall. The additional multiperson selection and cleanup replay passed in 97.07 seconds wrapper wall.
  • The real MCP HTTP case resolves the admitted Discord fixture, creates an agent-owned session, assigns a human, reads the persisted owner back, and preserves creator/visibility. It also covers standalone attach and revoked grants, plus foreign-human bootstrap without borrowing the assignee’s authority. Case duration: 20.662 seconds. No assignment writer or MCP dispatcher is mocked.
  • Existing operator-control final effects and revocation/replacement negatives: 10 passed. Archive/restore/Stop/collector composition: 13 passed. Full CLI preparation: 117 passed. These counts overlap the 268-case total.
  • Three affected type graphs, targeted lint on 27 TypeScript files, formatting, diff checks, and staged line/suppression ratchets passed. Independent Codex P0–P2 AutoReview completed both chunks with zero actionable findings (scoped-clean, not an unrestricted whole-repository review). The only subsequent source edit was a mechanically equivalent boolean simplification.
  • All four changed docs passed MDX checks. The broad anchor audit has 53 failures identical to pinned main, with no introduced or resolved failures; external ClawHub fragments remain unverified.

This is keyless, isolated Linux production-boundary proof, not live Discord/model execution or a Team deployment. No full build or full repository suite was run, and CI was not manually dispatched or rerun. Hosted review and required CI are tracked separately on the published head.

Prior regression evidence and human-target review clarification

Earlier revisions passed 382 initial focused cases, 52 channel-authority cases, 39 MCP-cache cases, 37 compatibility cases, 60 restored senderless-management cases, and a 22-case integrated replay. Those are historical scoped results, not current-head full-suite evidence. Restoring the old whole-tool owner gate reproduced missing-tool discovery; restoring the overly restrictive absent-owner predicate reproduced the real senderless list-to-archive failure. Fixed bytes passed both controls.

The hosted revision-4/5 foreign-human finding identified a reachable personal-context effect, but requester-only targets would change the existing assignment contract. The public RPC/UI permit handoffs to any registered person by an identified, appropriately scoped caller with session visibility. Assigned-owner personal-context selection was deliberately introduced in #154980; it does not select the current sender or grant the assignee’s authority.

The expanded real MCP fixture assigns a different registered administrator, reads back that owner, prepares fresh member-sender admission, and exercises the bootstrap boundary. The assignee’s preferences are selected as documented; requester metadata remains the member, senderIsOwner stays false, no operator principal is created, and personal-instructions access still requires authenticated requester authority. This joined bootstrap/admission proof remains in the current passing selection. No requester-only restriction or assignee-privilege borrowing was introduced.

Worked on by

Work sessions


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 21, 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.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 21, 2026 01:13
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

Current revision: b0ce03d35a850a00f4285cb03c25800b572c1f38

This PR no longer changes files in the maintainer security-review tier.

Separate CODEOWNERS requirements still apply to security policy and enforcement files.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 29, 2026, 9:42 PM ET / September 30, 2026, 01:42 UTC (Revision 6).

ClawSweeper review

What this changes

The branch lets admitted non-owner agent turns assign a visible session to a registered person or configured agent, while preserving narrower session controls and documenting the resulting owner behavior.

Merge readiness

✅ Ready for maintainer review

Current main still withholds the sessions tool from admitted non-owner agent turns without operator-write authority. The merged visible-spawn fix covers initial ownership in a narrower case, and a maintainer explicitly confirmed that later assignment remains needed. The latest branch addresses the prior authority finding with production-boundary coverage.

Priority: P2
Reviewed head: b0ce03d35a850a00f4285cb03c25800b572c1f38

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The branch has focused production-boundary authority proof and a coherent repair, with ordinary exact-head merge gates still pending.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The pinned-head reported run includes a real loopback HTTP client calling the production Gateway assignment path, SQLite owner readback for the requester and a different registered human, later requester-authority checks, and attach/revocation negatives before another write. This is isolated boundary proof rather than live Discord execution. No stored-data format changes are introduced.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The pinned-head reported run includes a real loopback HTTP client calling the production Gateway assignment path, SQLite owner readback for the requester and a different registered human, later requester-authority checks, and attach/revocation negatives before another write. This is isolated boundary proof rather than live Discord execution. No stored-data format changes are introduced.
Evidence reviewed 10 items Current-main gap: Current main excludes sessions for non-owner loopback callers unless they have session-control authority; the requested assignment-only surface remains absent.
Introduced action gate: The pinned PR exposes assignment to explicit non-owner turns and rejects their other sessions actions.
Live caller binding: Assignment requires an admitted caller for non-owner turns and carries its current-authority assertion into Gateway dispatch.
Findings None None.
Security None None.

How this fits together

Channel and CLI agent turns receive a Gateway-admitted tool set. A session assignment passes through the sessions tool and Gateway authorization before the existing SQLite writer stores the owner, which later session views and eligible personal-context selection consume.

flowchart LR
  A[Channel or CLI turn] --> B[Run admission]
  B --> C[Session tool action gate]
  C --> D[Gateway visibility and live authority]
  D --> E[SQLite owner writer]
  E --> F[Session views and later context]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +145, Tests +854, Docs +10. Total +1009 across 31 files.

View PR surface stats
Area Files Added Removed Net
Source 11 223 78 +145
Tests 16 1140 286 +854
Docs 4 19 9 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 31 1382 373 +1009

Review metrics

Metric Value Why it matters
Production and test lines production +223/−78; tests +1140/−286 Production growth carries admission and assignment through existing owners, while the larger test delta covers real Gateway and authority boundaries.
Non-owner capability 1 assignment action exposed The permission expansion is deliberately limited to owner assignment for admitted turns.

Root-cause cluster

Relationship: canonical
Canonical: #154239
Summary: This PR owns the remaining admitted non-owner assignment path; related merged PRs established the ownership model, initial visible-spawn ownership, and later personal-context selection.

Members:

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

Technical review

Best possible solution:

Keep the existing Gateway assignment writer as the single authority for owner changes and land the bounded non-owner tool path after the native merge gates pass.

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

Yes. Current-main tool resolution excludes sessions for the described non-owner turn without operator-write authority; this review established the path from source but did not execute it.

Is this the best way to solve the issue?

Yes. The branch reuses the established assignment writer and handoff contract, and its real HTTP boundary test covers the previously disputed foreign-human target and forbidden callers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 858993c1a41c.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded multi-user session workflow without evidence of a broad runtime outage.
  • merge-risk: 🚨 session-state: A merge allows more admitted turns to change the stored session owner, which affects later owner views and personal-context selection.
  • merge-risk: 🚨 security-boundary: The diff changes which agent turns can reach assignment, with live-admission, visibility, attach, and revocation boundaries covered by the new test.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The pinned-head reported run includes a real loopback HTTP client calling the production Gateway assignment path, SQLite owner readback for the requester and a different registered human, later requester-authority checks, and attach/revocation negatives before another write. This is isolated boundary proof rather than live Discord execution. No stored-data format changes are introduced.
  • proof: sufficient: Contributor real behavior proof is sufficient. The pinned-head reported run includes a real loopback HTTP client calling the production Gateway assignment path, SQLite owner readback for the requester and a different registered human, later requester-authority checks, and attach/revocation negatives before another write. This is isolated boundary proof rather than live Discord execution. No stored-data format changes are introduced.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RoboClaw: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • VACInc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-21T01:22:06.406Z sha 5344c61 :: needs real behavior proof before merge. :: [P1] Preserve the owner gate for standalone MCP attach callers
  • reviewed 2026-09-21T05:36:16.356Z sha 615cefd :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T06:37:50.231Z sha a3f7f94 :: blocked before merge. :: [P1] Preserve scheduled session-management actions
  • reviewed 2026-09-28T07:47:25.554Z sha 2f63d62 :: needs real behavior proof before merge. :: [P1] Authorize non-owner human assignment targets
  • reviewed 2026-09-28T07:54:38.948Z sha 2f63d62 :: needs real behavior proof before merge. :: [P1] Bind non-owner human assignment to an authorized target

roboclaw-bot and others added 2 commits September 21, 2026 05:07
Expose only responsibility assignment without Gateway-owner posture. Require affirmative owner authority for other session actions and retain standalone invocation restrictions.

Co-authored-by: VACInc <[email protected]>
Keep standalone MCP attach grants outside the non-owner assignment exception. Reuse canonical CLI admission, fence execution through the existing Gateway commit guard, and prove the real HTTP-to-SQLite authority chain.

Co-authored-by: VACInc <[email protected]>
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/fix-session-owner-assignment-20260921 branch from 5344c61 to 615cefd Compare September 21, 2026 05:28
@VACInc

VACInc commented Sep 22, 2026

Copy link
Copy Markdown
Member

Related to #155349, which is now merged. That change assigns a newly created visible child to the verified human requester only when the requester matches the parent session’s effective human owner. This PR remains necessary: it separately permits a live admitted non-owner agent turn to use the assignment-only sessions.assignOwner path for cases that still start agent-owned (including mismatched, unlinked, agent-owned, or system-triggered spawns) and for intentional later responsibility changes. Please rebase onto current main and retain that bounded assignment behavior; do not close this PR as superseded.

@VACInc VACInc closed this Sep 27, 2026
roboclaw-bot and others added 2 commits September 28, 2026 06:15
Reconcile the original assignment-only repair with current runtime contracts. Preserve live caller authority, creator and sharing policy, and the existing assignment writer. Prove linked Discord requester creation, MCP assignment, and stored-owner readback with attach and revocation controls.

Co-authored-by: steipete <[email protected]>
Integrate main through the already-landed fix for the inherited chat-attachments max-lines failure. Assignment production paths are unchanged by this integration.

Co-authored-by: steipete <[email protected]>
Restrict only explicit non-owner turns to assignment while preserving existing scheduled/system management. Keep live admission mandatory for assignment without affirmative ownership, restore senderless regression fixtures, and route the real MCP server test through its existing server owner.

Co-authored-by: steipete <[email protected]>
Integrate a08479a for the observed PR matrix-preflight failure. The assignment delta is unchanged, the current workflow-cap planner fits 84 GitHub and 81 hybrid jobs, and the isolated assignment/management boundary proof and affected type graphs pass on the integrated tree.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

The senderless-management finding is fixed in 2f63d62: only explicit non-owner turns receive assignment-only actions; existing senderless management remains unchanged, and the original fixture posture is restored rather than injecting ownership. Live admission is still mandatory for assignment without affirmative ownership. The compatibility revision passed 37 boundary cases plus 60 restored management cases; the integrated current-main tree passed another 22 real Gateway/MCP/factory cases and affected type graphs. The already-landed CI repair a08479a resolves the matrix failure without depending on the separate packing PR. Native local review is READY; please review this exact corrected head.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Sep 28, 2026
Preserve the existing general human handoff contract. Exercise an actual non-owner Discord MCP assignment to another registered human, its persisted personal bootstrap selection, and fresh requester authority without borrowing the assignee identity. Clarify the same contract in ownership and tool documentation. Include Peter's canonical assertReliabilityForcedExit export repair for the inherited CI type failure.

Co-authored-by: steipete <[email protected]>
Reconcile with current main while preserving live admitted assignment, participant selection, and bounded operator controls.

Co-authored-by: steipete <[email protected]>
@clawsweeper clawsweeper Bot added 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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 30, 2026
@roboclaw-bot
roboclaw-bot merged commit 53c39cd into main Sep 30, 2026
205 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/fix-session-owner-assignment-20260921 branch September 30, 2026 01:56
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…claw#154239)

* fix: restore session owner assignment for non-owner agent turns

Expose only responsibility assignment without Gateway-owner posture. Require affirmative owner authority for other session actions and retain standalone invocation restrictions.

Co-authored-by: VACInc <[email protected]>

* fix: require admitted authority for session handoffs

Keep standalone MCP attach grants outside the non-owner assignment exception. Reuse canonical CLI admission, fence execution through the existing Gateway commit guard, and prove the real HTTP-to-SQLite authority chain.

Co-authored-by: VACInc <[email protected]>

* fix: preserve senderless session management

Restrict only explicit non-owner turns to assignment while preserving existing scheduled/system management. Keep live admission mandatory for assignment without affirmative ownership, restore senderless regression fixtures, and route the real MCP server test through its existing server owner.

Co-authored-by: steipete <[email protected]>

* fix: verify handoff context and repair assignment CI

Preserve the existing general human handoff contract. Exercise an actual non-owner Discord MCP assignment to another registered human, its persisted personal bootstrap selection, and fresh requester authority without borrowing the assignee identity. Clarify the same contract in ownership and tool documentation. Include Peter's canonical assertReliabilityForcedExit export repair for the inherited CI type failure.

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: VACInc <[email protected]>
Co-authored-by: steipete <[email protected]>
amittell added a commit to amittell/openclaw that referenced this pull request Oct 11, 2026
…nventory

Run A (all --changed shards at a25baa1) failed 16 tests, all in
fork-pinned areas. Each is TEST-DRIFT: the fork behaviour holds on 10.1
and only the test setup changed upstream. Each fix has a revert control
that fails for the right reason.

- attempt-prompt-context (Telegram current-message carrier, v3/v4):
  openclaw#163471 replaced the BEGIN/END internal-context wrapper with an
  "OpenClaw runtime context:" label applied at model send. The fork's
  carrierText still states the body. Control: without carrierText the v3
  case fails on a bare "openclaw#19452:".
- session-context (runtime carriers at compaction boundaries, 3, an
  upstream test): openclaw#161281 pins the summary exactly, and the fork's
  checkpoint line collides with that. The cut point is unchanged from
  9.9. Controls: no checkpoint line -> 14/21; a cut between the carrier
  and its user -> 19/21.
- pending-inputs.redrive: openclaw#163582 made listSessionPendingInputs async.
  Control: without the fork's terminal block, 10.1 admits a fresh turn
  for a committed source turn ("expected true to be false").
- agent-runner-failure-reply (3) and assistant-failure (1): the 10.1 copy
  from openclaw#163381, under this carry's precedent (the fork keeps its
  classification and takes 10.1's copy). The transport cases now also
  assert "not took too long"; without that, the old negatives passed with
  the fork code removed. assistant-failure asserts the FailoverError
  fields (provider, model) in place of the old text. The 9.9 build did
  not rotate profiles on this path either (probe at 9eea409).
- owner-only-tool-stubs (4) and attempt.owner-only-tool-stubs (2): openclaw#154239
  makes non-owner turns use the real `sessions` tool, limited to
  assign_owner, rather than denying it. Alex, 2026-10-11: take upstream's
  rule. The tests therefore expect every owner-only tool except
  `sessions` to be stubbed. openclaw#164296 makes the tool-surface bridge add the
  Tool Search controls itself, so the attempt test covers Tool Search
  off, on, and Code Mode. Controls: with the fork's stub shaping off,
  5/8; with the refusal line removed, 0/4.

Also adds src/agents/owner-only-tool-stub-marker.ts to
scripts/pr-lib/wrapper-components.txt. tool-policy.ts has imported it since
the 9.9 carry and it was never listed, which failed eager-import-closure.
With the line, eager-import-closure is 18/18 and pr-wrappers 217/217.
amittell added a commit to amittell/openclaw that referenced this pull request Oct 12, 2026
…n and its spawned sessions

openclaw#154239 (53c39cd, in v2026.10.1) gives an explicit non-owner turn the sessions tool limited
to assign_owner, targeting `sessionKey ?? current`, scoped only by tools.sessions.visibility.
That defaults to `all`, and sessions.assignOwner is a visibility-authorized Gateway method, so
on a default config any group member who can trigger the agent can reassign the owner of every
non-incognito session on the Gateway. Measured at 6757492 (non-owner channel turn, live
admitted run, real in-process router and SQLite store):

  visibility unset (all), default agentToAgent: current, same agent (by key and by session id)
                                                and another agent's session all reassigned
  all + agentToAgent disabled, or agent:        current and same agent reassigned
  tree or self:                                 current only

The owner field is written with sessions.changed; a human assignee's USER.md is selected on
later turns of that session, and the assignee passes the creator-or-assignee clause for stop.
Neither rh-bot nor mac-mini sets tools.sessions or tools.agentToAgent.

Fix: for senderIsOwner === false, resolvePatchTarget also checks the resolved target at `tree`
visibility (when the configured visibility is not already `self`), after the configured check
and before the owner write. The current session (default, by key or by session id) never
reaches the check; a session this conversation spawned passes it, so upstream's spawn-then-
assign flow keeps working. Owner and senderless callers, and every other action, are unchanged.
The non-owner tool descriptions now say "the current session or a session it spawned".

Test (src/gateway/local-request-context.session-tools.non-owner-assign.test.ts, routed to the
gateway database-workers project): non-owner and owner callers x visibility unset and `agent` x
targets current (default, key, session id), spawned child, same agent (key, session id), other
agent; each case asserts the exact set reassigned, the refusal reason, and that refused rows
are untouched. 4/4. Non-owner: current and spawned child allowed, same agent and other agent
refused by the new rule (other agent by `agent` visibility when configured). Owner: everything
allowed except other agent under `agent`.

Controls, each failing 2/4 (the non-owner cases):
- check removed: same agent (key, id) and other agent come back "allowed".
- check moved after the owner write: the refusal fires but the row was already written
  (expected {owner} to deeply equal undefined).
- check moved before resolution (refuse any sessionKey): current by key and by id and the
  spawned child become refused.
- fixture child without spawnedBy lineage: the spawned child becomes refused.

Upstream: server.mcp-session-owner.test.ts 1/1 (fails 1/1 under a current-session-only rule),
sessions-tool.owner 9/9, agent-tools.session-owner 3/3; sessions-tool*, owner-only stub tests
10 files 86/86; session-archive, session-rename, mcp-http.personal-authority 4 files 21/21 with
this test. tsgo:core and tsgo:test:src rc=0, oxlint rc=0, oxfmt clean, prompt snapshots current,
vitest config guards 515/515, check:line-cap-ratchet --base v2026.10.1^{commit} lists the same
35 pre-existing entries as at 6757492.
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 maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

2 participants