Skip to content

fix(plugins): retain incognito scope for embedded session ownership - #120215

Merged
steipete merged 3 commits into
mainfrom
clawsweeper/issue-openclaw-openclaw-120178
Aug 8, 2026
Merged

steipete merged 3 commits into
mainfrom
clawsweeper/issue-openclaw-openclaw-120178

Conversation

@clawsweeper

@clawsweeper clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #120178.

Thanks @dailylights for the reproduction. The registry validated an agent-scoped session key but discarded its scope before its session-ID/file ownership scan. Carry the effective agent and incognito sentinel store path into that scan, preserving explicit targets, cross-agent/store validation, and locked-session rejection.

Release-note context: embedded-agent L1 extraction no longer fails to resolve SQLite scope for incognito sessions when the caller supplies a session key and session ID without an explicit agent ID.

Apply labels: clawsweeper:autogenerated, clawsweeper:autofix.

@clawsweeper clawsweeper Bot added clawsweeper Tracked by ClawSweeper automation clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge labels Aug 7, 2026
chelsealong pushed a commit to chelsealong/openclaw that referenced this pull request Aug 7, 2026
…t sessions

resolveRunSessionExecutionOwner() authorized runEmbeddedAgent() calls by
passing whatever agentId the caller supplied straight through to the
ownership scan. For a fresh incognito/dashboard/cron session with no
stored entry yet, callers only pass a sessionKey, so agentId stayed
undefined and the scan's listSessionEntries() lookup threw "Cannot
resolve SQLite session scope without an agent id" (openclaw#120178).

Derive the missing agentId from the call's own sessionKey via
resolveAgentIdFromSessionKey() when possible. Scoped to this one call
site (not the shared assertSessionIdentitiesOwned helper) because it is
the only one with a single session identity guaranteed to describe the
target session; the gateway-request call site folds three independently
caller-controlled key fields together and must not get this fallback.

Superseded by openclaw#120215, opened while this fix was in
review; not opened as a PR.
@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor Author

🦞🧹
ClawSweeper autofix is enabled.

  • Head: d6343eccde80
  • Label: clawsweeper:autofix
  • Action: exact-head review queued (workflow sweep.yml, event repository_dispatch).
  • Flow: review this head, repair/rebase only if needed, then re-review the exact repaired head until no actionable findings remain.

This is fix-only; I will not merge this PR.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Aug 7, 2026
@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex review: passed. Reviewed August 7, 2026, 7:50 AM ET / 11:50 UTC.

ClawSweeper review

What this changes

The PR derives the agent and incognito SQLite store from one embedded-agent session key before scanning supplied session IDs or session files for ownership.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this is a focused, correct candidate fix for the linked current bug; current main still performs the ownership scan without the session key’s incognito scope, and no new blocker was found.

Priority: P2
Reviewed head: d6343eccde801343621d23e8625581ec22a6ff01

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-covered owner-boundary repair with no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This ClawSweeper bot-authored PR is exempt from the external-contributor real-behavior-proof gate; focused source, regression coverage, and exact-head CI are available.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This ClawSweeper bot-authored PR is exempt from the external-contributor real-behavior-proof gate; focused source, regression coverage, and exact-head CI are available.
Evidence reviewed 6 items Current-main gap: Current main still calls the session-entry scan with the caller-provided scope only, so an agent-scoped incognito key is no longer available to that scan.
Accessor contract: The read-only list path deliberately supplies an empty session key while resolving SQLite scope, so it cannot recover incognito scope unless the caller carries agent and store facts forward.
Proposed owner-boundary repair: The PR derives canonical agent and incognito store scope from the sole key, rejects explicit agent conflicts, and passes that scope into the existing ownership scan.
Findings None None.
Security None None.

How this fits together

Embedded-agent plugin runs validate that supplied session identities belong to the requested agent and SQLite store before execution. The registry resolves that scope, scans the session store, then either runs the agent or rejects cross-agent, cross-store, or locked-session use.

flowchart LR
  A[Plugin embedded-agent request] --> B[Session key plus IDs or files]
  B --> C[Ownership resolver]
  C --> D[Agent and incognito SQLite scope]
  D --> E[Session ownership scan]
  E --> F[Run embedded agent]
  E --> G[Reject invalid ownership]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; GitHub reports it cleanly mergeable, but merge should still use the normal exact-head checks or a refresh before landing.
  • Complete next step (P2) - No repair lane is needed: the existing autofix PR already contains the focused owner-boundary repair and this review found no mechanical defect to address.
Agent review details

Security

None.

PR surface

Source +21, Tests +82. Total +103 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 23 2 +21
Tests 1 82 0 +82
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 105 2 +103

Review metrics

Metric Value Why it matters
Production versus test delta production +23/-2 (net +21); tests +82/-0 (net +82) The production growth is justified by carrying one canonical scope across the existing ownership scan; focused tests cover both acceptance and rejection paths.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #120178
Summary: This PR is the focused candidate repair for the canonical incognito embedded-session ownership report.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the canonical registry-level scope propagation after normal exact-head merge checks, keeping existing cross-agent, cross-store, and locked-session rejection intact.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the canonical registry-level scope propagation after normal exact-head merge checks, keeping existing cross-agent, cross-store, and locked-session rejection intact.

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

Yes—source-reproducible: current main drops the session key before the SQLite list scan, while that scan needs the key-derived incognito scope to resolve ownership.

Is this the best way to solve the issue?

Yes. Carrying the sole key’s already-canonical scope at the registry ownership boundary fixes the lost fact without changing the shared SQLite accessor or widening the plugin API.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 01cc71060d6c.

Labels

Label justifications:

  • P2: This repairs a bounded embedded-agent session-ownership failure without evidence of a broad runtime outage.
  • 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: This ClawSweeper bot-authored PR is exempt from the external-contributor real-behavior-proof gate; focused source, regression coverage, and exact-head CI are available.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Direct blame ties the current ownership-scan region to the commit that established this resolver path. (role: introduced session-ownership scan; confidence: high; commits: 374e05f09278; files: src/plugins/registry-runtime.ts, src/config/sessions/session-store-path.ts)
  • steipete: Feature history shows sustained work in the registry runtime and session-scope area. (role: historical session-runtime contributor; confidence: medium; files: src/plugins/registry-runtime.ts, src/config/sessions/session-accessor.sqlite-scope.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Use normal exact-head merge checks after refreshing the behind-base state if required.

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 (1 earlier review cycle)
  • reviewed 2026-08-07T11:42:59.224Z sha d6343ec :: passed. :: none

clawsweeper Bot and others added 2 commits August 8, 2026 15:58
Keep the shared multi-identity gateway checker fail-closed while carrying the exact embedded session key agent and incognito store into its ID/file scan. Add real SQLite proof for accepted and foreign locked identities in one incognito store.
@steipete
steipete force-pushed the clawsweeper/issue-openclaw-openclaw-120178 branch from d6343ec to d082ed4 Compare August 8, 2026 23:02
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete steipete self-assigned this Aug 8, 2026
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Please review exact head 16eb3a1856ba1df18ffe3b646b7010a772d964df; the post-rewrite push was formatting-only.

@clawsweeper

clawsweeper Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor Author

🦞🧹
ClawSweeper re-review requested.

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

Re-review progress:

@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Land-ready proof for exact head 16eb3a1856ba1df18ffe3b646b7010a772d964df:

The local changed-gate wrapper could not acquire Crabbox broker authentication; the required hosted exact-head/Testbox gate completed successfully instead.

@steipete
steipete merged commit 61b4194 into main Aug 8, 2026
120 checks passed
@steipete
steipete deleted the clawsweeper/issue-openclaw-openclaw-120178 branch August 8, 2026 23:59
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 9, 2026
Punchcard-Session: amber-workshop-workshop-36

* origin/main: (28 commits)
  perf(doctor): keep bundled doctor contract closures dependency-light (#120698)
  fix(elevenlabs): preserve repeated committed speech segments (#120792)
  fix(ai): fence Responses replay metadata (#120777)
  fix(ai): invalidate stale compaction replay (#120786)
  fix(telegram): clean up every failed webhook startup phase (#120788)
  fix(codex): preserve configured MCP tools in scheduled turns (#120366)
  fix(ui): show dev checkout commit lag in Updates (#120769)
  fix(agents): repair XML-polluted tool names (#113814)
  fix(discord): remove only the bot own reactions (#120785)
  fix(macos): complete ChatGPT subscription setup (#120782)
  fix(plugins): surface safe administrator install warnings (#120783)
  fix(release): keep upgrade survivor sessions fresh (#120778)
  fix(providers): preserve realtime tool-result delivery ownership (#120776)
  fix(plugins): retain incognito scope for embedded session ownership (#120215)
  fix(elevenlabs): surface realtime provider error events (#120772)
  fix(agents): preserve exact steering delivery ownership (#120770)
  fix(telegram): prevent session-count routing slowdown (#120774)
  fix(agents): preserve authoritative background process outcomes (#120754)
  test(process): make Linux adapter wiring portable (#120741)
  fix(diagnostics-prometheus): send Content-Length on metrics HEAD responses (#120212)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 9, 2026
…penclaw#120215)

* fix(plugins): retain incognito scope for embedded session ownership

* fix(plugins): scope embedded ownership at run boundary

Keep the shared multi-identity gateway checker fail-closed while carrying the exact embedded session key agent and incognito store into its ID/file scan. Add real SQLite proof for accepted and foreign locked identities in one incognito store.

* style(plugins): format SQLite ownership regression

---------

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper Tracked by ClawSweeper automation P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

[BUG] L1 Extraction Fails: Cannot resolve SQLite session scope without an agent id for incognito sessions

1 participant