Repository navigation
Conversation
d391119 to
5a6c3d2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d391119a09
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -596,6 +596,7 @@ export function createSessionsSendTool(opts?: { | |||
| const visibilityGuard = await createSessionVisibilityGuard({ | |||
| action: "send", | |||
| requesterSessionKey: effectiveRequesterKey, | |||
| currentSessionKeys, | |||
There was a problem hiding this comment.
Reject self-send aliases before dispatch
When the caller is the main session, e.g. agentSessionKey is agent:main:main, and the model calls sessions_send with sessionKey: "main" and the default nonzero timeout, this newly lets the alias pass visibility, but the self-send guard just above only checks requesterSessionKey === resolvedKey. The tool can then start a run on the calling session alias instead of returning the intended sessions_send cannot target the calling session error, so it waits behind its own active lane until timeout; the self-send/same-session checks need to use the same alias set before dispatch.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 3:33 AM ET / 07:33 UTC. ClawSweeper reviewWhat this changesThe branch passes requester session aliases through the list, history, and send visibility checks so supported aliases such as Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 11 items remain Keep this PR open as a useful fix candidate, but the same two functional blockers from the prior review remain: it widens a public plugin SDK visibility contract with caller-supplied alias authority, and it lets an aliased synchronous self-send pass visibility then enter the calling session’s active lane. The PR body provides focused mocked/unit validation only, not after-fix operator-visible behavior proof. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw session tools resolve a user-facing session key, check it against session visibility policy, then list sessions, read history, or dispatch a message. This PR changes the requester context supplied to the shared plugin SDK visibility checker. flowchart LR
Requester[Requester session] --> Context[Session tool context]
Target[Target session key] --> Resolve[Session resolution]
Context --> Visibility[Visibility policy]
Resolve --> Visibility
Visibility --> List[List sessions]
Visibility --> History[Read history]
Visibility --> Send[Dispatch message]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch introduces a caller-controlled visibility-equivalence input on a public plugin SDK authorization surface. PR surfaceSource +17, Tests +26, Generated 0. Total +43 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep alias equivalence owned by the core session-resolution/tool boundary, preserve the SDK checker’s authoritative requester/owner inputs, and use the same resolved equivalence when rejecting synchronous self-target sends before dispatch. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: provide a requester alias such as Is this the best way to solve the issue? No. The intended alias behavior is valid, but placing caller-provided alias authority in the public SDK checker is broader than necessary and leaves the related self-target invariant split across two comparisons. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 820cd7c152f7. LabelsLabel justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
5a6c3d2 to
6be0d1d
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
What Problem This Solves
Session tools can resolve a supported display alias such as
mainto the same logical session as the requester, but the visibility guard only recognizes the exact requester key or literalcurrent. Underselfortreevisibility, that mismatch incorrectly rejects the current session after resolution.Summary
selfandtreevisibilitysessions_list,sessions_history, andsessions_sendThis keeps current-session access working when a caller and the session resolver use different supported aliases for the same main session, without broadening visibility to unrelated same-agent sessions.
Evidence
node scripts/run-vitest.mjs run src/agents/tools/sessions-access.test.ts --config test/vitest/vitest.agents-tools.config.ts— 1 file passed, 30 tests passedpnpm format:check -- src/agents/tools/sessions-access.test.ts src/agents/tools/sessions-access.ts src/agents/tools/sessions-history-tool.ts src/agents/tools/sessions-list-tool.ts src/agents/tools/sessions-send-tool.ts src/plugin-sdk/session-visibility.ts— passedpnpm tsgo:core— passedgit diff --check origin/main...HEAD— cleanBehavior addressed: current-session main aliases were rejected by
self/treevisibility after canonical session resolution.Real environment tested: local OpenClaw source checkout on macOS with Node 24 and the repository Vitest/tsgo wrappers.
Exact steps or command run after this patch:
node scripts/run-vitest.mjs run src/agents/tools/sessions-access.test.ts --config test/vitest/vitest.agents-tools.config.tsEvidence after fix: the focused suite passes 30/30 tests, including alias access under both
selfandtreevisibility while an unrelated direct session remains forbidden.Observed result after fix: configured aliases of the requester are accepted as the current session; unrelated same-agent sessions retain the existing visibility error.
What was not tested: a deployed cron-to-channel round trip; deployment and live channel credentials were intentionally unchanged.