Skip to content

fix: enforce owner policy for session resets [AI] - #118580

Merged
pgondhi987 merged 2 commits into
openclaw:mainfrom
pgondhi987:fix/fix-912
Aug 3, 2026
Merged

pgondhi987 merged 2 commits into
openclaw:mainfrom
pgondhi987:fix/fix-912

Conversation

@pgondhi987

Copy link
Copy Markdown
Contributor

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 /new or /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 verbose
  • Denied control retained the existing session and did not trigger reset processing.
  • Owner control triggered the reset path successfully.
  • git diff --check

AI-assisted: Yes.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 4:23 AM ET / 08:23 UTC.

ClawSweeper review

What this changes

The PR makes /new and /reset session rotation honor the canonical owner-only command policy rather than raw channel admission alone.

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 maintainer label also keeps final handling with a human reviewer.

Priority: P1
Reviewed head: 8ae51786cdbaed830fec00c713e74e6e7b22c437

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is a clean, narrow shared-boundary fix, but the required real behavior proof is currently limited to a mocked/unit test claim.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR body reports a focused Vitest scenario, but unit/mocked coverage is supplemental and no inspectable after-fix runtime output, log, recording, or artifact is provided. Please post redacted real-behavior evidence; updating the PR body should trigger review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports a focused Vitest scenario, but unit/mocked coverage is supplemental and no inspectable after-fix runtime output, log, recording, or artifact is provided. Please post redacted real-behavior evidence; updating the PR body should trigger review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main bypass: The current reset helper rejects only when both raw command admission and canonical authorization are false, so commandAuthorized: true permits reset even if owner-only authorization rejects the sender.
Canonical owner policy: The command resolver makes a sender unauthorized when a loaded channel plugin enforces owner-only commands and the sender is not an owner; the adjacent test covers that policy independently of ingress admission.
Shared owner boundary: Both session initialization and the direct /new//reset command handler call the same reset-authorization helper, so correcting that helper avoids a WhatsApp-specific or one-sided workaround.
Findings None None.
Security None None.

How this fits together

Incoming 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]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports a focused Vitest scenario, but unit/mocked coverage is supplemental and no inspectable after-fix runtime output, log, recording, or artifact is provided. Please post redacted real-behavior evidence; updating the PR body should trigger review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Merging intentionally stops ingress-admitted non-owners from rotating durable session state in owner-only channels; that is the expected policy correction, but it needs visible after-fix proof on the affected command path before merge.
  • Resolve merge risk (P1) - The PR body reports only a focused mocked/unit test command and outcome; it does not provide inspectable real channel or runtime evidence for this external PR.
  • Complete next step (P2) - The patch is correct but requires contributor-supplied real behavior proof and final handling under the existing protected maintainer label; there is no mechanical repair for ClawSweeper to apply.
Agent review details

Security

None.

PR surface

Source 0, Tests +57. Total +57 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 57 0 +57
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 58 1 +57

Review metrics

Metric Value Why it matters
Production vs test delta production 0 net (1 line changed), tests +57 The patch makes a minimal shared authorization correction and adds one focused durable-session regression scenario.

Stored data model

Persistent data-model change detected: serialized state: src/auto-reply/reply/session.test.ts, unknown-data-model-change: src/auto-reply/reply/session.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Require observed authorization proof (recommended)
    Before merge, obtain redacted after-fix runtime evidence showing a non-owner reset leaves the active session unchanged and an owner reset succeeds.
  2. Pause until maintainer validation
    Keep the PR open under the existing maintainer review label if real channel proof cannot be safely captured from the contributor environment.

Technical review

Best 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.

Labels

Label changes:

  • add P1: A non-owner in an owner-only channel can currently trigger reset processing and rotate an active durable session.
  • add merge-risk: 🚨 session-state: The corrected authorization gate changes which existing participants may initiate durable session rotation.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports a focused Vitest scenario, but unit/mocked coverage is supplemental and no inspectable after-fix runtime output, log, recording, or artifact is provided. Please post redacted real-behavior evidence; updating the PR body should trigger review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: A non-owner in an owner-only channel can currently trigger reset processing and rotate an active durable session.
  • merge-risk: 🚨 session-state: The corrected authorization gate changes which existing participants may initiate durable session rotation.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports a focused Vitest scenario, but unit/mocked coverage is supplemental and no inspectable after-fix runtime output, log, recording, or artifact is provided. Please post redacted real-behavior evidence; updating the PR body should trigger review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • joshavant: Current-main blame assigns both the reset helper and the owner-only command decision to the commit that introduced the shared reset-authorization seam. (role: introduced shared authorization behavior; confidence: high; commits: d6f964513f14; files: src/auto-reply/reply/reset-authorization.ts, src/auto-reply/command-auth.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Post redacted after-fix runtime evidence showing that a non-owner reset preserves the session and an owner reset succeeds.
  • Keep the focused regression test as supplemental coverage for the canonical shared authorization boundary.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@pgondhi987

pgondhi987 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Current-head behavior proof

Head: 8ae51786cdbaed830fec00c713e74e6e7b22c437

Production boundary exercised: initSessionState, the session owner that checks reset authorization before durable session rotation.

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:

  • Denied case: an admitted WhatsApp group sender with CommandAuthorized: true, but not present in the configured owner allowlist, sends /new /model openai/gpt-5. The adapter returns resetTriggered: false and preserves the existing session ID. Result: no database reset-boundary mutation is authorized, so the protected reset sink and model-selection handling are not reached.
  • Positive control: the configured owner sends the same command through the same adapter and policy. The adapter returns resetTriggered: true and isNewSession: true, proving that the expected reset path succeeds. Non-ACP resets intentionally preserve the durable session ID for transcript cursor continuity.

Command:

node scripts/run-vitest.mjs src/auto-reply/reply/session.test.ts -t 'requires canonical command authorization' --reporter verbose

Result:

✓ initSessionState reset triggers in WhatsApp groups > requires canonical command authorization before rotating durable session state
Test Files  1 passed (1)
Tests       1 passed | 160 skipped (161)
Duration    7.96s

The exact assertions are in src/auto-reply/reply/session.test.ts: the denied path checks resetTriggered === false and the original session ID; the owner control checks resetTriggered === true and isNewSession === true. The test uses the real SQLite session store and the production session-initialization adapter.

Environment note: a direct AWS Crabbox lease (cbx_2d5f38322b65, run run_5de9c10e38b1) was acquired, but workspace hydration failed before execution because the remote bootstrap could not resolve its TypeScript dependency. The delegated Testbox client was unavailable on this host. The successful result above is therefore local production-adapter evidence, not a live WhatsApp-client transcript.

1 similar comment
@pgondhi987

Copy link
Copy Markdown
Contributor Author

Current-head behavior proof

Head: 8ae51786cdbaed830fec00c713e74e6e7b22c437

Production boundary exercised: initSessionState, the session owner that checks reset authorization before durable session rotation.

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:

  • Denied case: an admitted WhatsApp group sender with CommandAuthorized: true, but not present in the configured owner allowlist, sends /new /model openai/gpt-5. The adapter returns resetTriggered: false and preserves the existing session ID. Result: no database reset-boundary mutation is authorized, so the protected reset sink and model-selection handling are not reached.
  • Positive control: the configured owner sends the same command through the same adapter and policy. The adapter returns resetTriggered: true and isNewSession: true, proving that the expected reset path succeeds. Non-ACP resets intentionally preserve the durable session ID for transcript cursor continuity.

Command:

node scripts/run-vitest.mjs src/auto-reply/reply/session.test.ts -t 'requires canonical command authorization' --reporter verbose

Result:

✓ initSessionState reset triggers in WhatsApp groups > requires canonical command authorization before rotating durable session state
Test Files  1 passed (1)
Tests       1 passed | 160 skipped (161)
Duration    7.96s

The exact assertions are in src/auto-reply/reply/session.test.ts: the denied path checks resetTriggered === false and the original session ID; the owner control checks resetTriggered === true and isNewSession === true. The test uses the real SQLite session store and the production session-initialization adapter.

Environment note: a direct AWS Crabbox lease (cbx_2d5f38322b65, run run_5de9c10e38b1) was acquired, but workspace hydration failed before execution because the remote bootstrap could not resolve its TypeScript dependency. The delegated Testbox client was unavailable on this host. The successful result above is therefore local production-adapter evidence, not a live WhatsApp-client transcript.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

Verification before merge

Current head: 8ae51786cdbaed830fec00c713e74e6e7b22c437

Source review, Codex autoreview, focused validation, and required CI are clean for this head. The current SQLite-backed production-adapter check demonstrates both outcomes:

  • an admitted non-owner is denied reset processing and retains the existing session;
  • the configured owner reaches reset processing and starts a new logical session while retaining the durable non-ACP transcript ID.

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.

@pgondhi987

pgondhi987 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor Author

ClawSweeper review

Reviewed August 3, 2026, 10:35 AM UTC.

What this changes

Makes /new and /reset use canonical sender authorization before changing durable session state, with owner and non-owner WhatsApp regression coverage.

PR surface: Tests +57. Total +57 across 2 files.

Merge readiness

Result: needs proof before merge.

Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦞 diamond lobster

Reviewed head: 8ae51786cdba

Review scores

  • Overall: 🦪 silver shellfish
  • Proof: 🦪 silver shellfish (mock_only)
  • Patch quality: 🦞 diamond lobster
  • Security: cleared

Verification

Status: mock_only

How this fits together

Inbound 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]
Loading

Decision needed

  • Question: Should /new and /reset always follow canonical owner authorization on owner-enforced channels, and what channel-level proof is required before this fix lands?
  • Rationale: Source, documentation, and tests support canonical enforcement, but the protected label, private report tracking, affected release, and fail-closed behavior require a security owner to confirm landing and release handling.
  • Likely owner: steipete - He authored the shared reset helper and recent canonical command-authorization work.
    Options:
  1. Confirm owner enforcement (recommended)
    Approve the shared canonical policy, require qualifying channel proof, and coordinate the patched release and report handling.
  2. Define a narrow exception
    If admitted non-owners should retain resets on a specific surface, add an explicit typed policy rather than restoring raw admission as a bypass.

Before merge

  • [P0] The latest release still contains the affected authorization behavior, so report and patched-release coordination remain necessary.
  • [P0] The shared gate intentionally stops admitted non-owners from resetting sessions under owner-enforced policy; qualifying channel proof is still missing for the observable fail-closed behavior.
  • Provide stronger current-head behavior proof.
Review details

Best 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 details

Label justifications:

  • P0: The latest release permits an admitted non-owner to bypass an explicit owner-only command policy and mutate session state.
  • merge-risk: 🚨 compatibility: Existing admitted non-owner reset workflows under owner-enforced configurations will stop working after merge, intentionally but observably.
  • merge-risk: 🚨 session-state: The shared authorization gate controls whether a durable session reset occurs, and its channel-level behavior lacks qualifying proof.
Evidence reviewed

PR surface:

Area Files Added Removed Net
Source 1 1 1 +0
Tests 1 57 0 +57
Docs 0 0 0 +0
Config 0 0 0 +0
Generated 0 0 0 +0
Other 0 0 0 +0
Total 2 58 1 +57
  • Current-main behavior: Current main still lets raw transport admission independently authorize a reset when canonical owner authorization denies it.
  • Patch implementation: The branch requires the canonical authorization result before either reset path can proceed.
  • Canonical policy owner: Command authorization explicitly rejects non-owners when a channel enforces owner-only commands and resolves owner identity centrally.
  • Session entry point: Session initialization consults the shared authorization gate before parsing reset triggers and performing lifecycle mutation.
  • WhatsApp owner policy: The bundled WhatsApp plugin declares that commands require owner authorization.
  • Regression coverage: The added test covers a transport-admitted non-owner retaining the existing session and an owner successfully triggering reset through the SQLite-backed session adapter.
  • Owner-policy history: Prior merged work by pgondhi987 established that native transport authorization must not bypass channel owner enforcement.
  • Reset-helper provenance: The shared reset helper carried the permissive admission-or-canonical condition through the April deduplication work.
  • Documented authorization contract: Documentation says owner-enforced channels require a configured owner identity or internal administrator scope; wildcard channel admission is insufficient.
  • Release provenance: The latest release still contains the permissive reset condition, and no release tag contains the proposed head.
  • Posted validation: The author reported one focused passing Vitest scenario with denied and owner controls; this is meaningful regression evidence but remains test-harness proof.
  • Exact-head checks: The supplied check context reports the main CI gate, security-fast, session-accessor guards, type checks, and focused quality lanes successful on the reviewed head.

@pgondhi987
pgondhi987 merged commit 5c1c9f4 into openclaw:main Aug 3, 2026
28 checks passed
vincentkoc added a commit that referenced this pull request Aug 3, 2026
* 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)
  ...
vincentkoc added a commit that referenced this pull request Aug 3, 2026
…-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
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
@eightHundreds

eightHundreds commented Aug 13, 2026 •

Copy link
Copy Markdown

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 behavior

From the PR body / added test: a WhatsApp group sender who is admitted at ingress (commandAuthorized: true) but is outside an owner-only channel policy (enforceOwnerForCommands: true) must not rotate durable session state with /new or /reset.

What the patch actually did

-  if (!params.commandAuthorized && !auth.isAuthorizedSender) {
+  if (!auth.isAuthorizedSender) {
     return false;
   }

isAuthorizedSender is not “owner-only channel policy”. Once commands.ownerAllowFrom is non-empty (doctor / first pairing bootstrap writes this), resolveCommandAuthorization sets requireOwner, and isAuthorizedSender becomes owner-gated for every channel — including Feishu/Lark DMs that do not set enforceOwnerForCommands.

Production impact (OpenClaw 2026.8.1)

  • Channel: Feishu DM, session.dmScope: per-channel-peer (one session per user)
  • channels.feishu.allowFrom: ["*"] — the user can chat
  • commands.ownerAllowFrom lists a few operators; commands.allowFrom is unset
  • Feishu plugin does not set enforceOwnerForCommands
  • A non-owner user sends /new on their own DM
  • Result: Ignoring /reset from unauthorized sender, session is not rotated, no user-visible error

That user cannot start a fresh conversation on their own per-peer session. Docs still do not mark /new as owner-only (docs/tools/slash-commands.md).

This contradicts #61707

/new and /reset are authorized from the original channel authorization path, while other slash commands still honor commands.allowFrom.

The pre-change helper implemented exactly that: deny only when both raw channel admission and canonical command auth fail. The new gate collapses /new onto the same owner list used for /config and exec approvals.

Suggested fix

Keep the WhatsApp owner-only protection, but do not make /new owner-only globally.

Alternatively, treat /new / /reset as baseline commands again, and use rejectNonOwnerCommand only on channels that opt into owner-enforced commands.

Happy to provide redacted gateway logs if useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants