Repository navigation
fix(plugins): retain incognito scope for embedded session ownership - #120215
Conversation
…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.
|
🦞🧹
This is fix-only; I will not merge this PR. Re-review progress:
|
|
Codex review: passed. Reviewed August 7, 2026, 7:50 AM ET / 11:50 UTC. ClawSweeper reviewWhat this changesThe 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 readinessKeep 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 Review scores
Verification
How this fits togetherEmbedded-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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +21, Tests +82. Total +103 across 2 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
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.
d6343ec to
d082ed4
Compare
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready proof for exact head
The local changed-gate wrapper could not acquire Crabbox broker authentication; the required hosted exact-head/Testbox gate completed successfully instead. |
|
Merged via squash.
|
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) ...
…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]>
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.