fix(agents): preserve literal current session resolution#93138
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 14, 2026, 11:36 PM ET / 03:36 UTC. Summary PR surface: Source +7, Tests -65. Total -58 across 3 files. Reproducibility: yes. Current-main source still sends raw Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Preserve literal Do we have a high-confidence way to reproduce the issue? Yes. Current-main source still sends raw Is this the best way to solve the issue? No. The PR is too early in the shared resolver path; the safer fix preserves literal Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 663fabbe30eb. Label changesLabel justifications:
Evidence reviewedPR surface: Source +7, Tests -65. Total -58 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
…round-trip The system prompt tells agents to use sessionKey="current" to refer to their own session. Previously, resolveSessionReference sent the literal string "current" to the gateway sessions.resolve action, which rejected it with INVALID_REQUEST and logged a noisy error line on every tool call. The wrapper fell back to requesterInternalKey and succeeded, so the tool worked — but the gateway error was spurious. Add "current" to the well-known client alias check in resolveCurrentSessionClientAlias so it is resolved locally to the requester's session key, matching how TUI/CLI/WebChat client labels are handled. This eliminates the unnecessary gateway round-trip and the error log line. Fixes openclaw#78424
…ution" This reverts commit d9f6c8b5248921c99f43dc222667ffa429b34401.
…ution" This reverts commit 40bf77d06711833c1beaeedf562b60a765a559d6.
…gateway round-trip" This reverts commit d92bc9b91e0840ea5823cd44223c139e434c5ec4.
b131b25 to
47bed13
Compare
|
maintainer repair is land-ready. what changed:
verification:
proof gap: broad |
) * fix(agents): resolve "current" session alias locally without gateway round-trip The system prompt tells agents to use sessionKey="current" to refer to their own session. Previously, resolveSessionReference sent the literal string "current" to the gateway sessions.resolve action, which rejected it with INVALID_REQUEST and logged a noisy error line on every tool call. The wrapper fell back to requesterInternalKey and succeeded, so the tool worked — but the gateway error was spurious. Add "current" to the well-known client alias check in resolveCurrentSessionClientAlias so it is resolved locally to the requester's session key, matching how TUI/CLI/WebChat client labels are handled. This eliminates the unnecessary gateway round-trip and the error log line. Fixes openclaw#78424 * test: update session_status tests for local current-key resolution * test: update session_status tests for local current-key resolution * Revert "test: update session_status tests for local current-key resolution" This reverts commit d9f6c8b5248921c99f43dc222667ffa429b34401. * Revert "test: update session_status tests for local current-key resolution" This reverts commit 40bf77d06711833c1beaeedf562b60a765a559d6. * Revert "fix(agents): resolve "current" session alias locally without gateway round-trip" This reverts commit d92bc9b91e0840ea5823cd44223c139e434c5ec4. * fix(agents): preserve literal current session resolution --------- Co-authored-by: Vincent Koc <[email protected]>
) * fix(agents): resolve "current" session alias locally without gateway round-trip The system prompt tells agents to use sessionKey="current" to refer to their own session. Previously, resolveSessionReference sent the literal string "current" to the gateway sessions.resolve action, which rejected it with INVALID_REQUEST and logged a noisy error line on every tool call. The wrapper fell back to requesterInternalKey and succeeded, so the tool worked — but the gateway error was spurious. Add "current" to the well-known client alias check in resolveCurrentSessionClientAlias so it is resolved locally to the requester's session key, matching how TUI/CLI/WebChat client labels are handled. This eliminates the unnecessary gateway round-trip and the error log line. Fixes openclaw#78424 * test: update session_status tests for local current-key resolution * test: update session_status tests for local current-key resolution * Revert "test: update session_status tests for local current-key resolution" This reverts commit d9f6c8b5248921c99f43dc222667ffa429b34401. * Revert "test: update session_status tests for local current-key resolution" This reverts commit 40bf77d06711833c1beaeedf562b60a765a559d6. * Revert "fix(agents): resolve "current" session alias locally without gateway round-trip" This reverts commit d92bc9b91e0840ea5823cd44223c139e434c5ec4. * fix(agents): preserve literal current session resolution --------- Co-authored-by: Vincent Koc <[email protected]>
) * fix(agents): resolve "current" session alias locally without gateway round-trip The system prompt tells agents to use sessionKey="current" to refer to their own session. Previously, resolveSessionReference sent the literal string "current" to the gateway sessions.resolve action, which rejected it with INVALID_REQUEST and logged a noisy error line on every tool call. The wrapper fell back to requesterInternalKey and succeeded, so the tool worked — but the gateway error was spurious. Add "current" to the well-known client alias check in resolveCurrentSessionClientAlias so it is resolved locally to the requester's session key, matching how TUI/CLI/WebChat client labels are handled. This eliminates the unnecessary gateway round-trip and the error log line. Fixes openclaw#78424 * test: update session_status tests for local current-key resolution * test: update session_status tests for local current-key resolution * Revert "test: update session_status tests for local current-key resolution" This reverts commit d9f6c8b5248921c99f43dc222667ffa429b34401. * Revert "test: update session_status tests for local current-key resolution" This reverts commit 40bf77d06711833c1beaeedf562b60a765a559d6. * Revert "fix(agents): resolve "current" session alias locally without gateway round-trip" This reverts commit d92bc9b91e0840ea5823cd44223c139e434c5ec4. * fix(agents): preserve literal current session resolution --------- Co-authored-by: Vincent Koc <[email protected]>
) * fix(agents): resolve "current" session alias locally without gateway round-trip The system prompt tells agents to use sessionKey="current" to refer to their own session. Previously, resolveSessionReference sent the literal string "current" to the gateway sessions.resolve action, which rejected it with INVALID_REQUEST and logged a noisy error line on every tool call. The wrapper fell back to requesterInternalKey and succeeded, so the tool worked — but the gateway error was spurious. Add "current" to the well-known client alias check in resolveCurrentSessionClientAlias so it is resolved locally to the requester's session key, matching how TUI/CLI/WebChat client labels are handled. This eliminates the unnecessary gateway round-trip and the error log line. Fixes openclaw#78424 * test: update session_status tests for local current-key resolution * test: update session_status tests for local current-key resolution * Revert "test: update session_status tests for local current-key resolution" This reverts commit d9f6c8b5248921c99f43dc222667ffa429b34401. * Revert "test: update session_status tests for local current-key resolution" This reverts commit 40bf77d06711833c1beaeedf562b60a765a559d6. * Revert "fix(agents): resolve "current" session alias locally without gateway round-trip" This reverts commit d92bc9b91e0840ea5823cd44223c139e434c5ec4. * fix(agents): preserve literal current session resolution --------- Co-authored-by: Vincent Koc <[email protected]>
Real behavior proof
sessions.resolvegateway action logsINVALID_REQUESTerror on everysessionKey="current"tool call because the literal string "current" is sent to the gateway as a sessionId lookup, which rejects it. The wrapper falls back correctly, but the gateway error log is spurious on every turn.ac1042b0resolveCurrentSessionClientAliasnow short-circuits forkey="current"whenrequesterInternalKeyis presentnode scripts/run-vitest.mjs run src/agents/tools/sessions-resolution.test.ts— all 17 tests passpnpm build— succeedssessions.resolvecall is made forsessionKey="current"via test assertionexpect(callGatewayMock).not.toHaveBeenCalled()sessionKey="current"andrequesterInternalKeyis set, the alias resolves locally to the requester's session key without any gateway round-trip. NoINVALID_REQUESTerror is logged. The existing TUI/CLI/WebChat client label aliases continue to work unchanged.session_status(sessionKey="current")— the fix is in the resolution layer tested by unit tests, not in a channel-specific path.