Repository navigation
fix: enforce owner policy for session resets [AI] - #118580
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 4:23 AM ET / 08:23 UTC. ClawSweeper reviewWhat this changesThe PR makes Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain This is a focused fix for a current owner-policy bypass: session initialization lets raw ingress admission override the canonical command authorization result. The one-line shared-gate change is correct, but this external PR still needs inspectable after-fix real-behavior proof before merge; the Priority: P1 Review scores
Verification
How this fits togetherIncoming channel messages are admitted at ingress, then command authorization determines whether the sender may perform command actions. Reset detection runs before durable session state is selected or rotated, and its decision is shared with the direct reset-command handler. flowchart LR
A[Incoming channel message] --> B[Ingress admission]
B --> C[Canonical command authorization]
C --> D[Shared reset authorization]
D --> E[Reset command detection]
E --> F[Durable session state]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +57. Total +57 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared canonical authorization check, prove an admitted non-owner cannot rotate the session while an owner can, and merge only after a maintainer reviews that redacted after-fix evidence. Do we have a high-confidence way to reproduce the issue? Yes—current main passes raw command admission into reset detection while the canonical resolver rejects a non-owner in an owner-enforcing channel. The PR's scenario directly constructs that current-main mismatch, though this review did not execute it. Is this the best way to solve the issue? Yes—the shared reset helper is the best fix location because session initialization and direct reset-command handling both use it; a WhatsApp-only guard would leave duplicate policy and sibling drift. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0cad02313a9c. LabelsLabel changes:
Label 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
|
Current-head behavior proofHead: Production boundary exercised: Protected sink: the SQLite-backed reset-boundary mutation that marks the existing durable session as a new logical session while retaining its transcript identity. Scenarios:
Command: Result: The exact assertions are in Environment note: a direct AWS Crabbox lease ( |
1 similar comment
Current-head behavior proofHead: Production boundary exercised: Protected sink: the SQLite-backed reset-boundary mutation that marks the existing durable session as a new logical session while retaining its transcript identity. Scenarios:
Command: Result: The exact assertions are in Environment note: a direct AWS Crabbox lease ( |
Verification before mergeCurrent head: Source review, Codex autoreview, focused validation, and required CI are clean for this head. The current SQLite-backed production-adapter check demonstrates both outcomes:
ClawSweeper accepts the implementation but requests channel-level evidence. The available synthetic QA channel has a different command-owner policy, so it cannot prove this WhatsApp boundary. Live proof requires two dedicated linked WhatsApp QA accounts plus a dedicated group JID; those operator-owned credentials are not available in this run. The AWS attempt also stopped during workspace hydration before executing the scenario. Maintainer action requested: either run the live WhatsApp denied/owner pair and attach redacted artifacts, or explicitly accept the current production-adapter evidence for this head. No source finding remains open. |
ClawSweeper reviewReviewed August 3, 2026, 10:35 AM UTC. What this changesMakes PR surface: Tests +57. Total +57 across 2 files. Merge readinessResult: needs proof before merge. Overall: 🦪 silver shellfish Reviewed head: Review scores
VerificationStatus: mock_only How this fits togetherInbound channel messages carry transport admission and sender identity into auto-reply. Session initialization decides whether reset commands may change durable session state before reply and directive processing continues. flowchart LR
A[Inbound channel message] --> B[Transport admission]
B --> C[Canonical sender authorization]
C --> D{Reset allowed?}
D -- No --> E[Keep current session]
D -- Yes --> F[Update durable session boundary]
F --> G[Continue reply processing]
Decision needed
Before merge
Review detailsBest possible solution: Keep one canonical authorization decision for both reset entry paths, then land it with qualifying channel proof and coordinated private report and release handling. Do we have a high-confidence way to reproduce the issue? Yes—source inspection gives a high-confidence reproduction path: current main accepts raw transport admission when canonical owner authorization denies the reset; this review did not execute the focused scenario. Is this the best way to solve the issue? Yes. Requiring the shared reset gate's canonical authorization result fixes the policy at its owner boundary; ingress- or WhatsApp-specific guards would duplicate policy and drift. AGENTS.md: found_applied Codex review notes: model internal, reasoning high; reviewed against 3832074. Label detailsLabel justifications:
Evidence reviewedPR surface:
|
* origin/main: (25 commits) test(qa): cover plugin authoring contracts (#118821) fix(parallels): keep provider keys out of POSIX job logs (#118840) improve: reduce redundant Code Mode test work (#118815) fix(models): report primary OpenRouter limits in scans (#110855) test: speed up setup inference fixtures (#118811) fix(auto-reply): enforce canonical reset authorization (#118580) docs(gateway): fix invalid heartbeat visibility examples (#118827) fix(plugins): unify HTTP route conflict handling (#118203) test(agents): use prepared auth fixtures (#118816) fix(lmstudio): resolve JIT embedding variants fix(lmstudio): preserve embedding preload and model identity fix(ai): reject binary Codex websocket frames (#111138) fix(deps): bump brace-expansion override to 5.0.9 for HIGH advisory 1130705 (#118804) feat(cli): add session archive and delete commands (#118791) fix(openai): commit eligible final realtime transcription audio safely (#118782) fix(reef): restrict management commands to owners [AI] (#118578) fix(google): honor Cloud SDK credential location and Vertex billing project (#118745) fix(bedrock): preserve private embedding endpoints and AWS routing policy (#118744) fix(voice): make signed callback replay reservations durable and retryable (#118754) fix(openrouter): isolate custom proxy credentials and transport security (#118773) ...
…-state-mutation * origin/main: (22 commits) fix(delivery): renew stable producer leases (#118663) test(mcp): isolate catalog size checks from wall-clock load (#118871) test(ui): add credentials primary QA proof (#118790) fix(slack): prevent stalled presence polling from hanging shutdown (#117478) test(security): cover gateway shared auth modes (#118834) fix(macos): show gateway auth failures in app status (#118841) test(tui): route PTY gateway scenarios through explicit models (#118802) test(qa): add session transcript primary coverage (#118820) fix(browser): protect private observation media and Canvas trust boundaries (#118775) fix(build): restore SDK packages and signed macOS app builds (#118833) test(qa): cover plugin authoring contracts (#118821) fix(parallels): keep provider keys out of POSIX job logs (#118840) improve: reduce redundant Code Mode test work (#118815) fix(models): report primary OpenRouter limits in scans (#110855) test: speed up setup inference fixtures (#118811) fix(auto-reply): enforce canonical reset authorization (#118580) docs(gateway): fix invalid heartbeat visibility examples (#118827) fix(plugins): unify HTTP route conflict handling (#118203) test(agents): use prepared auth fixtures (#118816) fix(lmstudio): resolve JIT embedding variants ...
|
This one-line change is broader than the stated WhatsApp owner-only fix, and it regresses the session-reset tier that #61707 closed as implemented in v2026.4.24. Intended behaviorFrom the PR body / added test: a WhatsApp group sender who is admitted at ingress ( What the patch actually did- if (!params.commandAuthorized && !auth.isAuthorizedSender) {
+ if (!auth.isAuthorizedSender) {
return false;
}
Production impact (OpenClaw 2026.8.1)
That user cannot start a fresh conversation on their own per-peer session. Docs still do not mark This contradicts #61707
The pre-change helper implemented exactly that: deny only when both raw channel admission and canonical command auth fail. The new gate collapses Suggested fixKeep the WhatsApp owner-only protection, but do not make
Alternatively, treat Happy to provide redacted gateway logs if useful. |
What Problem This Solves
Prevents a WhatsApp sender who is admitted at ingress but is outside the configured command-owner policy from rotating durable session state with
/newor/reset.Why This Change Was Made
Session reset detection now uses the same canonical sender authorization result as command handling. Raw transport admission remains an input to that decision, but it can no longer override an owner-only channel policy.
User Impact
Owner-authorized reset commands continue to work. Other admitted participants can no longer change the active session through reset commands when the channel requires owner authorization.
Evidence
node scripts/run-vitest.mjs src/auto-reply/reply/session.test.ts -t "requires canonical command authorization" --reporter verbosegit diff --checkAI-assisted: Yes.