Repository navigation
fix: session_status 'current' resolves to live run session instead of stale sandbox key (#76708) - #76995
Conversation
|
Codex review: passed. Summary Reproducibility: yes. Source inspection shows current main gives Next step before merge Security Review detailsBest possible solution: Merge this PR after exact-head automerge and CI gates pass, keeping sandbox policy identity separate from live run identity and retaining the new regression and Telegram QA coverage. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main gives Is this the best way to solve the issue? Yes. The PR is the narrow maintainable fix: it adds a separate live run-session identity for semantic current lookups while preserving sandbox/tool-policy identity and explicit cross-session denial. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 02b9dbde394b. |
06bceb7 to
5a3334a
Compare
|
E2E follow-up pushed in What I verified:
Fixes added:
Passing verification after the fix:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f470f2f to
f604b90
Compare
… stale sandbox key (#76708)
- Track isSemanticCurrentRequest before key rewrite - Skip early explicit-agent-key visibility check for current requests - Add isSemanticCurrentRequest to shouldTreatVisibilityTargetAsSelf - Fix test to use default/tree visibility instead of 'all' - Add negative guard test for explicit cross-session key rejection
f604b90 to
c3c964e
Compare
|
/clawsweeper automerge |
|
🦞✅ Source: What merged:
Automerge notes:
The automerge loop is complete. Automerge progress:
|
… stale sandbox key (openclaw#76708) (openclaw#76995) Summary: - The PR threads a live `runSessionKey` through embedded tool construction, updates `session_status({sessionKey:"current"})` resolution, and adds unit, Telegram QA, workflow, and changelog coverage for openclaw#76708. - Reproducibility: yes. Source inspection shows current main gives `session_status` only the sandbox/requester ... plus PR follow-up describe a focused Telegram Docker scenario that fails pre-fix and passes with this head. Automerge notes: - PR branch already contained follow-up commit before automerge: fix: preserve session visibility semantics for runSessionKey (openclaw#76708) - PR branch already contained follow-up commit before automerge: fix: cover Telegram current session status Validation: - ClawSweeper review passed for head c3c964e. - Required merge gates passed before the squash merge. Prepared head SHA: c3c964e Review: openclaw#76995 (comment) Co-authored-by: Alex Knight <[email protected]> Co-authored-by: Alex Knight <[email protected]>
… stale sandbox key (#76708) (#76995)
Summary:
- The PR threads a live `runSessionKey` through embedded tool construction, updates `session_status({sessionKey:"current"})` resolution, and adds unit, Telegram QA, workflow, and changelog coverage for #76708.
- Reproducibility: yes. Source inspection shows current main gives `session_status` only the sandbox/requester ... plus PR follow-up describe a focused Telegram Docker scenario that fails pre-fix and passes with this head.
Automerge notes:
- PR branch already contained follow-up commit before automerge: fix: preserve session visibility semantics for runSessionKey (#76708)
- PR branch already contained follow-up commit before automerge: fix: cover Telegram current session status
Validation:
- ClawSweeper review passed for head c3c964ecfd5b8a1be4d44b8ad7d4c60085bc78da.
- Required merge gates passed before the squash merge.
Prepared head SHA: c3c964ecfd5b8a1be4d44b8ad7d4c60085bc78da
Review: openclaw/openclaw#76995 (comment)
Co-authored-by: Alex Knight <[email protected]>
Co-authored-by: Alex Knight <[email protected]>
… stale sandbox key (#76708) (#76995)
Summary:
- The PR threads a live `runSessionKey` through embedded tool construction, updates `session_status({sessionKey:"current"})` resolution, and adds unit, Telegram QA, workflow, and changelog coverage for #76708.
- Reproducibility: yes. Source inspection shows current main gives `session_status` only the sandbox/requester ... plus PR follow-up describe a focused Telegram Docker scenario that fails pre-fix and passes with this head.
Automerge notes:
- PR branch already contained follow-up commit before automerge: fix: preserve session visibility semantics for runSessionKey (#76708)
- PR branch already contained follow-up commit before automerge: fix: cover Telegram current session status
Validation:
- ClawSweeper review passed for head c3c964ecfd5b8a1be4d44b8ad7d4c60085bc78da.
- Required merge gates passed before the squash merge.
Prepared head SHA: c3c964ecfd5b8a1be4d44b8ad7d4c60085bc78da
Review: openclaw/openclaw#76995 (comment)
Co-authored-by: Alex Knight <[email protected]>
Co-authored-by: Alex Knight <[email protected]>
… stale sandbox key (openclaw#76708) (openclaw#76995) Summary: - The PR threads a live `runSessionKey` through embedded tool construction, updates `session_status({sessionKey:"current"})` resolution, and adds unit, Telegram QA, workflow, and changelog coverage for openclaw#76708. - Reproducibility: yes. Source inspection shows current main gives `session_status` only the sandbox/requester ... plus PR follow-up describe a focused Telegram Docker scenario that fails pre-fix and passes with this head. Automerge notes: - PR branch already contained follow-up commit before automerge: fix: preserve session visibility semantics for runSessionKey (openclaw#76708) - PR branch already contained follow-up commit before automerge: fix: cover Telegram current session status Validation: - ClawSweeper review passed for head c3c964e. - Required merge gates passed before the squash merge. Prepared head SHA: c3c964e Review: openclaw#76995 (comment) Co-authored-by: Alex Knight <[email protected]> Co-authored-by: Alex Knight <[email protected]>
… stale sandbox key (openclaw#76708) (openclaw#76995) Summary: - The PR threads a live `runSessionKey` through embedded tool construction, updates `session_status({sessionKey:"current"})` resolution, and adds unit, Telegram QA, workflow, and changelog coverage for openclaw#76708. - Reproducibility: yes. Source inspection shows current main gives `session_status` only the sandbox/requester ... plus PR follow-up describe a focused Telegram Docker scenario that fails pre-fix and passes with this head. Automerge notes: - PR branch already contained follow-up commit before automerge: fix: preserve session visibility semantics for runSessionKey (openclaw#76708) - PR branch already contained follow-up commit before automerge: fix: cover Telegram current session status Validation: - ClawSweeper review passed for head c3c964e. - Required merge gates passed before the squash merge. Prepared head SHA: c3c964e Review: openclaw#76995 (comment) Co-authored-by: Alex Knight <[email protected]> Co-authored-by: Alex Knight <[email protected]>
… stale sandbox key (openclaw#76708) (openclaw#76995) Summary: - The PR threads a live `runSessionKey` through embedded tool construction, updates `session_status({sessionKey:"current"})` resolution, and adds unit, Telegram QA, workflow, and changelog coverage for openclaw#76708. - Reproducibility: yes. Source inspection shows current main gives `session_status` only the sandbox/requester ... plus PR follow-up describe a focused Telegram Docker scenario that fails pre-fix and passes with this head. Automerge notes: - PR branch already contained follow-up commit before automerge: fix: preserve session visibility semantics for runSessionKey (openclaw#76708) - PR branch already contained follow-up commit before automerge: fix: cover Telegram current session status Validation: - ClawSweeper review passed for head c3c964e. - Required merge gates passed before the squash merge. Prepared head SHA: c3c964e Review: openclaw#76995 (comment) Co-authored-by: Alex Knight <[email protected]> Co-authored-by: Alex Knight <[email protected]>
… stale sandbox key (#76708) (#76995)
Summary:
- The PR threads a live `runSessionKey` through embedded tool construction, updates `session_status({sessionKey:"current"})` resolution, and adds unit, Telegram QA, workflow, and changelog coverage for #76708.
- Reproducibility: yes. Source inspection shows current main gives `session_status` only the sandbox/requester ... plus PR follow-up describe a focused Telegram Docker scenario that fails pre-fix and passes with this head.
Automerge notes:
- PR branch already contained follow-up commit before automerge: fix: preserve session visibility semantics for runSessionKey (#76708)
- PR branch already contained follow-up commit before automerge: fix: cover Telegram current session status
Validation:
- ClawSweeper review passed for head c3c964ecfd5b8a1be4d44b8ad7d4c60085bc78da.
- Required merge gates passed before the squash merge.
Prepared head SHA: c3c964ecfd5b8a1be4d44b8ad7d4c60085bc78da
Review: openclaw/openclaw#76995 (comment)
Co-authored-by: Alex Knight <[email protected]>
Co-authored-by: Alex Knight <[email protected]>
… stale sandbox key (#76708) (#76995)
Summary:
- The PR threads a live `runSessionKey` through embedded tool construction, updates `session_status({sessionKey:"current"})` resolution, and adds unit, Telegram QA, workflow, and changelog coverage for #76708.
- Reproducibility: yes. Source inspection shows current main gives `session_status` only the sandbox/requester ... plus PR follow-up describe a focused Telegram Docker scenario that fails pre-fix and passes with this head.
Automerge notes:
- PR branch already contained follow-up commit before automerge: fix: preserve session visibility semantics for runSessionKey (#76708)
- PR branch already contained follow-up commit before automerge: fix: cover Telegram current session status
Validation:
- ClawSweeper review passed for head c3c964ecfd5b8a1be4d44b8ad7d4c60085bc78da.
- Required merge gates passed before the squash merge.
Prepared head SHA: c3c964ecfd5b8a1be4d44b8ad7d4c60085bc78da
Review: openclaw/openclaw#76995 (comment)
Co-authored-by: Alex Knight <[email protected]>
Co-authored-by: Alex Knight <[email protected]>
Summary
Fixes #76708
session_status({sessionKey: "current"})was resolving to a stale Telegram direct session key instead of the live run session when the tool was constructed with a sandbox/policy session key.Root Cause
In
runEmbeddedAttempt,sandboxSessionKey(derived fromparams.sandboxSessionKey) is passed assessionKeyintocreateOpenClawCodingTools. When a user callssession_status({sessionKey: "current"}), the resolution logic uses this sandbox key as the requester identity, which can resolve to the stale Telegram direct session instead of the actual live run session (agent:main:main).Fix
Thread a new
runSessionKeyoption through the tool creation chain:createSessionStatusTool→createOpenClawTools→createOpenClawCodingToolsrunEmbeddedAttemptandcompactEmbeddedPiSessionDirectOncepass the liveparams.sessionKeyasrunSessionKeywhen it differs fromsandboxSessionKeysessionKey: "current"is requested andrunSessionKeyis available, it resolves directly to the live run sessionThis preserves sandbox/tool-policy enforcement (which uses
sandboxSessionKey) while fixing user-visible status reporting.Tests
pnpm test src/agents/openclaw-tools.session-status.test.ts— 47/47 passedpnpm test src/agents/pi-embedded-runner/compact.hooks.test.ts— 39/39 passedNew regression test verifies that when a session store has both a stale Telegram direct session and a live main session,
session_status({sessionKey: "current"})returns the live session.Changelog
Entry added to
CHANGELOG.mdunder Unreleased > Fixes.