Skip to content

fix: visible work sessions belong to the requester - #155349

Merged
VACInc merged 7 commits into
mainfrom
openclaw/fix-requester-session-ownership-20260922
Sep 22, 2026
Merged

VACInc merged 7 commits into
mainfrom
openclaw/fix-requester-session-ownership-20260922

Conversation

@roboclaw-bot

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

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes visible Team sessions created by sessions_spawn being assigned to the spawning agent even when the verified human requester owns the parent session.

User Impact

New visible child sessions inherit human ownership only when the trusted active requester profile matches the parent session's effective human owner. Different owners, unlinked or missing requesters, agent-owned parents, and system-triggered spawns keep the requesting agent as owner. Existing target ownership is never replaced.

Why This Change Was Made

The Gateway now derives ownership from the lifecycle-locked parent, canonicalizes merged profile aliases through the resident profile catalog, and commits the owner atomically with a genuinely new child. The same requester authority crosses local, signed-runtime, and worker-backed spawn paths. Owner reassignment shares the session lifecycle fence, so a queued or revoked caller cannot race child creation. Required-sandbox creator provenance remains intact without masquerading as human ownership.

Evidence

  • Matching, mismatched, missing, channel-only, agent-owned, system-triggered, merged-profile, required-sandbox, existing-target, worker, lifecycle-race, and queued-revocation regressions pass.
  • 452 affected regression tests across 11 files passed in 143.51s wall time.
  • The focused ownership, worker, and lifecycle slice passed 92 tests in 30.95s wall time.
  • ClawSweeper's archive-recovery finding was repaired; 32 regressions covering fresh owned creation beside a failed unrelated archive, lifecycle publication, and child custody passed in 28.66s wall time.
  • ClawSweeper's assignment-authorization finding was repaired; 60 regressions prove shared, read-only, and suggest assignment remains available to eligible write-scoped callers while role-capped and revoked callers remain denied.
  • ClawSweeper's receipt-label finding was repaired through the existing identity projection; 148 spawn-tool regressions pass, including an ID-only stored agent owner with a configured Roboclaw label.
  • pnpm check:changed passed on the final candidate, including formatting, line caps, production and test typechecks, lint, dead exports, database guards, import-cycle checks, and policy guards.
  • pnpm docs:check-links passed with 14,313 internal links checked and 0 broken links.
  • Astra's final exact-diff review reported scoped-clean after all actionable findings were repaired.

Contributed by: Vito

Work sessions

@clawsweeper

clawsweeper Bot commented Sep 22, 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 22, 2026 01:57
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 22, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 7:08 AM ET / 11:08 UTC (Revision 7).

ClawSweeper review

What this changes

New visible work sessions inherit a matching verified human requester’s ownership, preserve existing owners, and report the stored owner in spawn receipts.

Merge readiness

✅ Ready for maintainer review

Keep open: the ownership improvement remains absent from current main, the prior findings are addressed, and no new blocking defect was found. The protected maintainer PR remains a useful landing candidate.

Priority: P2
Reviewed head: ae8388f04926b8db84528c5e55fbf80b42812745

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent implementation with meaningful ownership and authorization coverage and no remaining actionable finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The trusted bot PR is exempt from ordinary contributor live-proof requirements. Reviewed Gateway/SQLite regressions exercise ownership selection, existing targets, and revoked custody; these are supplemental tests, not a claimed live run. Compatibility is supported by existing owner columns and new-entry-only assignment, with no migration or backfill.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The trusted bot PR is exempt from ordinary contributor live-proof requirements. Reviewed Gateway/SQLite regressions exercise ownership selection, existing targets, and revoked custody; these are supplemental tests, not a claimed live run. Compatibility is supported by existing owner columns and new-entry-only assignment, with no migration or backfill.
Evidence reviewed 9 items Pinned scope and review continuity: Reviewed the introduced delta from 5b8e08b to ae8388f. The latest head has no file changes from the previously reviewed 7a6e50f. The supplied test merge is stale and was not used to attribute base-branch changes to this PR.
Current main still lacks the behavior: Current main derives spawn creator isolation but does not assign the matching requester as initial owner; its visible-spawn receipt still unconditionally names the requesting agent.
Latest release comparison: The v2026.9.5 source also returns an agent owner in visible-spawn receipts. No released implementation of this requested receipt behavior was established.
Findings None None.
Security None None.

How this fits together

The Gateway creates visible work sessions requested by agents running locally or on workers. It records responsibility in SQLite and returns ownership information for receipts and session presentation, while creator identity continues to govern access.

flowchart TD
  A[Agent requests visible work] --> B[Verify live requester authority]
  B --> C[Lock parent and child lifecycle]
  C --> D{Requester matches human owner?}
  D -->|Yes| E[Select human owner]
  D -->|No| F[Select spawning agent]
  E --> G[Commit new session and owner]
  F --> G
  G --> H[Return stored owner receipt]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +189, Tests +479, Docs 0. Total +668 across 29 files.

View PR surface stats
Area Files Added Removed Net
Source 18 262 73 +189
Tests 9 573 94 +479
Docs 2 3 3 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 29 838 170 +668

Review metrics

Metric Value Why it matters
Production versus test growth Production net +189 lines; tests and test support net +479 lines Production growth supports requester propagation and atomic ownership assignment, with most added coverage exercising custody, compatibility, and authorization.

Technical review

Best possible solution:

Keep ownership selection in the Gateway creation owner, persist it atomically for new sessions, and preserve creator-based access and existing assignments.

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

Not applicable as an established-contract bug: the prior documentation explicitly assigned visible spawns to the agent. Current-main source confirms that behavior; this PR introduces requester-matching ownership inheritance.

Is this the best way to solve the issue?

Yes. The patch extends the existing creation and ownership writers, uses trusted requester context, and preserves existing assignments without introducing a competing ownership store.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded improvement to responsibility attribution for visible work sessions, with no demonstrated core outage or urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The trusted bot PR is exempt from ordinary contributor live-proof requirements. Reviewed Gateway/SQLite regressions exercise ownership selection, existing targets, and revoked custody; these are supplemental tests, not a claimed live run. Compatibility is supported by existing owner columns and new-entry-only assignment, with no migration or backfill.

Evidence

What I checked:

  • Pinned scope and review continuity: Reviewed the introduced delta from 5b8e08b to ae8388f. The latest head has no file changes from the previously reviewed 7a6e50f. The supplied test merge is stale and was not used to attribute base-branch changes to this PR. (ae8388f04926)
  • Current main still lacks the behavior: Current main derives spawn creator isolation but does not assign the matching requester as initial owner; its visible-spawn receipt still unconditionally names the requesting agent. (src/agents/tools/sessions-spawn-visible.ts:687, 6b13f55aaf71)
  • Latest release comparison: The v2026.9.5 source also returns an agent owner in visible-spawn receipts. No released implementation of this requested receipt behavior was established. (src/agents/tools/sessions-spawn-visible.ts:516, ec9c1a13db89)
  • Ownership and access remain separate: Inheritance requires the verified requester to match the effective human parent owner, resolving profile aliases when needed; other cases select the spawning agent. The Gateway derives this under lifecycle custody and independently preserves required-sandbox creator provenance. Sharing authorization continues to use creator identity. (src/config/sessions/session-entry-provenance.ts:39, ae8388f04926)
  • Authority checked at the write boundary: Owner reassignment acquires the lifecycle fence and invokes the router-composed authorization guard inside the SQLite assignment transaction. Worker claims retain the original operator authority and revalidate it alongside run and placement liveness; the executor carries those checks to child creation and dispatch. (src/gateway/server-methods/sessions-mutations.ts:362, ae8388f04926)
  • Existing-state compatibility and prior repairs: Initial ownership uses the existing owner-column writer within the new-row transaction; existing targets receive no inherited assignment. The fresh-upsert callback avoids unrelated archive recovery. Reviewed regressions cover existing-owner preservation, failed unrelated archives, queued revocation, visibility-authorized assignment, and configured receipt labels. (src/config/sessions/session-accessor.entry-mutation.ts:127, ae8388f04926)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • roboclaw-bot: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: 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 (6 earlier review cycles)
  • reviewed 2026-09-22T02:05:16.167Z sha 3a571e3 :: needs changes before merge. :: [P3] [P3] Update the documented visible-session ownership contract
  • reviewed 2026-09-22T02:21:54.569Z sha 8d39708 :: blocked before merge. :: [P2] [P2] Keep owner assignment from triggering unrelated archive recovery
  • reviewed 2026-09-22T03:06:03.928Z sha 048deac :: blocked before merge. :: [P2] [P2] Keep owner assignment from triggering unrelated archive recovery
  • reviewed 2026-09-22T03:50:00.176Z sha fc19a26 :: needs changes before merge. :: [P3] [P3] Preserve display labels when selecting the stored receipt owner
  • reviewed 2026-09-22T04:11:03.959Z sha 7a6e50f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-22T04:25:26.730Z sha 7a6e50f :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 22, 2026
@VACInc VACInc self-assigned this Sep 22, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 22, 2026
@VACInc

VACInc commented Sep 22, 2026

Copy link
Copy Markdown
Member

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Sep 22, 2026
@clawsweeper clawsweeper Bot added 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. labels Sep 22, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 22, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@VACInc
VACInc merged commit 00f7785 into main Sep 22, 2026
190 checks passed
@VACInc
VACInc deleted the openclaw/fix-requester-session-ownership-20260922 branch September 22, 2026 12:07
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
* fix(sessions): preserve requester ownership on visible spawns

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

* docs(sessions): describe inherited visible-session owners

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

* fix: constrain spawned session ownership

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

* fix: isolate initial owner persistence

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

* fix: preserve assignment visibility authorization

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

* fix: preserve owner labels in spawn receipts

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

* chore: refresh CI after main repairs

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

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: VACInc <[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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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