Repository navigation
fix(auto-reply): restore channel-authorized /new and /reset on non-owner-enforced channels - #125618
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 3:15 AM ET / 07:15 UTC. ClawSweeper reviewWhat this changesThe branch restores Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open. Current main still denies reset whenever ordinary command authorization is false, so the reported regression remains; the proposed private reset-only tier repairs that split without an introduced correctness finding. Exact-head CI is still in progress before merge. Priority: P1 Review scores
Verification
How this fits togetherInbound channel messages pass admission and central command authorization before reset handlers can change session lifecycle state. The PR adds a private reset-only outcome to that shared decision rather than granting ordinary command authority. flowchart LR
A[Inbound channel message] --> B[Channel admission]
B --> C[Command authorization]
C --> D{Denied, reset-only, or commands}
D --> E[Session reset handlers]
D --> F[Ordinary command handlers]
E --> G[Durable session lifecycle]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +41, Tests +327, Docs +6. Total +374 across 11 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep reset-only authorization private inside the central policy owner, retain the explicit-denial and owner-enforcement controls, and merge once the exact current head’s required checks are green. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main rejects reset at Is this the best way to solve the issue? Yes. The branch puts the closed reset-only decision in the existing command-authorization owner and both reset entry points consume it, avoiding a raw-admission bypass or public SDK expansion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c28cf4fb7563. LabelsLabel 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
HistoryReview history (5 earlier review cycles)
|
|
Added the requested real-behavior boundary proof to the PR body: drove the actual |
|
Made the requested SDK-compat fix: |
|
Looked into the "Add real behavior proof" ask (live Feishu/Lark output or an ephemeral-Gateway verdict JSON). Live Feishu/Lark transport proof isn't producible here: Correction to my own earlier claim: the PR body says no checked-in mock-gateway harness exists for this boundary — that's wrong. No code or test changes in this pass. The previously posted driven-handler trace and unit tests are unchanged; per the review's own "Accept mock-only evidence" option, that disposition is a maintainer call. |
|
Addressed the P1 finding: exposed Added a regression case ("denies a channel-admitted sender excluded by a configured commands.allowFrom") that fails on pre-fix code ( Also clean: I did not attempt a new ephemeral-Gateway/live-channel run for this pass — the existing unit/boundary proof already covers the changed branch, and the prior attempt at that harness was reported as flaky for unrelated reasons. |
|
Ran the ephemeral-Gateway |
8932565 to
8950a40
Compare
|
Maintainer rewrite pushed to the existing contributor branch as The new owner regression tests reproduced seven failures before the fix and now pass with all thirteen denial/compatibility controls. The broader 533-test run, corrected final 17 session/six SDK cases, canonical local gates, normal build, and fresh independent review are complete. A real compiled Gateway against official Buzz reproduced the original failure. The after-fix live run and new-head CI are still pending, so this is a review request rather than a merge-ready claim. The PR body now describes the rewritten implementation, provenance, test evidence and remaining proof precisely. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
8950a40 to
994b065
Compare
994b065 to
4c8f1b9
Compare
Keep reset-only admission inside command authorization while preserving explicit command denials, plugin owner enforcement, internal Gateway scopes, and the published authorization object. Remove the duplicate reset policy module and redundant native branch, and prove durable session effects and acknowledgments across text, native, peer, and owner-policy cases. Restore /new and /reset for admitted senders without granting ordinary command or owner authority. Correct the slash-command policy documentation. Fixes openclaw#125540 Co-authored-by: chelsealong <[email protected]>
Route auth bootstrap and packaged plugin preparation through one local execution boundary that redacts and bounds diagnostics without retaining credential-bearing causes. Preserve command ordering and the existing single-suppression baseline. Fixes the tooling CI regression exposed after openclaw#132399 while preparing openclaw#125618. The unchanged suppression test fails before and passes after; real child-process failure and startup cleanup tests pass.
4c8f1b9 to
b0c8a4f
Compare
|
Maintainer verification for head The reset policy is now owned by the existing command-authorization decision, with a private reset-only outcome. It does not grant ordinary commands or owner status. Explicit command denials, owner-enforcing plugins, internal scope checks, and the published seven-key SDK projection remain intact. The duplicate reset-policy module and redundant native branch are removed. Contributor @chelsealong's credit is preserved. The original failure reproduced both in owner regressions and through the actual compiled Gateway against official Buzz. The unchanged live driver passes on the final head: threaded Final proof receipt SHA-256: Local validation included: node scripts/run-vitest.mjs src/auto-reply/reply/session.test.ts src/auto-reply/reply/commands-reset-hooks.test.ts src/auto-reply/command-control.test.ts src/plugin-sdk/command-auth.test.ts src/auto-reply/reply/dispatch-from-config.delivery.test.ts src/auto-reply/command-auth.owner-default.test.ts src/auto-reply/reply/session-reset-model.test.ts src/auto-reply/reply/session-reset-cleanup.test.ts src/auto-reply/reply/session-reset-prompt.test.ts
node scripts/run-vitest.mjs test/scripts/lint-suppressions.test.ts src/infra/state-migrations.media-persistence.test.ts
node scripts/run-vitest.mjs src/auto-reply/command-auth.owner-default.test.ts
pnpm build
OPENCLAW_BUILD_PRIVATE_QA=1 node --import ./scripts/tsx.mjs scripts/build-all.mts qaRuntime
node --import ./scripts/tsx.mjs scripts/write-build-info.tsThe broader integrated run passed 650 tests with one existing skip. Following the mechanical test-only integration, all 19 affected migration/tooling tests, migration lint, and ten native/owner controls passed again. Changed-file types/lint/SDK/architecture/database/authorization checks passed. Normal final build took 5m14s; private QA build took 52s. Two earlier CI failures were addressed without weakening checks: packaged-bootstrap redaction now has one canonical catch, shrinking the current-main suppression inventory; the migration-test line-limit repair is provided by already-landed #132444, so our redundant extraction was dropped. The fresh independent review's sole concern was an impossible native-access state: Exact-head CI33241566470 completed successfully. The reviewed candidate is ready for the repository-native prepare/merge flow. The remaining proof limitation is live Feishu/WhatsApp transport, not the shared policy or Buzz flow; no schema or native reaction capability is included. |
|
Merged via squash.
|
…ner-enforced channels (openclaw#125618) * fix(auto-reply): restore admitted non-owner session resets Keep reset-only admission inside command authorization while preserving explicit command denials, plugin owner enforcement, internal Gateway scopes, and the published authorization object. Remove the duplicate reset policy module and redundant native branch, and prove durable session effects and acknowledgments across text, native, peer, and owner-policy cases. Restore /new and /reset for admitted senders without granting ordinary command or owner authority. Correct the slash-command policy documentation. Fixes openclaw#125540 Co-authored-by: chelsealong <[email protected]> * refactor(qa): centralize packaged bootstrap error redaction Route auth bootstrap and packaged plugin preparation through one local execution boundary that redacts and bounds diagnostics without retaining credential-bearing causes. Preserve command ordering and the existing single-suppression baseline. Fixes the tooling CI regression exposed after openclaw#132399 while preparing openclaw#125618. The unchanged suppression test fails before and passes after; real child-process failure and startup cleanup tests pass. * test(qa): tighten packaged bootstrap suppression inventory --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: chelsealong <[email protected]>
Closes #125540
What Problem This Solves
Fixes an issue where channel-authorized users cannot run
/newor/resetafter an operator configures a separatecommands.ownerAllowFromlist, even when the channel plugin does not enforce owner-only commands. The reported Feishu/Lark per-peer session remains unchanged; the same shared-policy defect also affects Buzz.Why This Change Was Made
The command-authorization owner now makes one closed decision: denied, reset-only, or ordinary commands. Session initialization, archived-session admission, and reset handling consume that decision without reconstructing policy downstream. The separate reset-authorization module is removed, as is a redundant native-command authorization branch. Reset-only access does not grant ordinary command authority or owner status.
Explicit
commands.allowFromdenials, including an empty provider-specific list overriding a wildcard global list, remain authoritative. Plugin-enforced owner policy and internal Gateway scope requirements remain intact. Both published SDK authorization types, inferred resolver return types, and the runtime authorization object's seven own keys are unchanged; no optional policy flags are added to the public contract.This is a maintainer rewrite of the editable contributor PR, preserving @chelsealong's credit and its explicit-denial correction. A raw-admission fallback would reopen the explicit-allowlist bypass; exporting policy flags would unnecessarily expose internal decisions and leave reset policy duplicated. Keeping the decision inside its existing owner is the better fit.
Provenance: the strict reset gate was introduced by commit
5c1c9f42d665d3d04a0a8bb023084e29b93704e7in #118580 (2026-08-03), code author Pavan Kumar Gondhi, PR author and merger @pgondhi987. That change correctly protected owner-enforcing channels but also suppressed admitted non-owner resets on other plugins. This repair retains that protection rather than reverting it globally.User Impact
Admitted users on non-owner-enforcing channels can again reset the session selected by the channel's existing routing. Feishu
per-channel-peerrouting stays peer-scoped; Buzz remains room-scoped, with thread reply placement unchanged. No session-key, storage-schema, configuration, dependency, or protocol changes are introduced.The slash-command documentation now explains reset-only admission and explicit deny-all behavior. It also corrects a misleading example:
enforceOwnerForCommandsis plugin policy, not anopenclaw.jsonsetting.Release-note context: restore channel-authorized session resets without widening ordinary command or owner authority; preserve explicit command allowlists and owner-enforcing plugin policy. Thanks @chelsealong.
Evidence
The maintainer's new regression cases fail against the unfixed owner: seven failures and thirteen passing denial/compatibility controls. Applying this rewrite makes the identical twenty cases pass. The broader owner/sibling run passes all 533 tests across nine files:
Coverage observes real session initialization and SQLite lifecycle revisions, reset acknowledgments without inference, CLI-binding cleanup, transcript reset events, archived-session admission, other-peer preservation, native/text command parity, explicit deny/grant/empty policy, provider-resolution errors, owner-enforcing plugins, and internal scope/Provider-vs-Surface precedence. The SDK assertions cover both published facades.
Independent Codex review of the rewritten diff and full owner context found no actionable P0–P2 issues. The canonical changed-file check plan is complete, including core/plugin production and test types, SDK export/surface checks, lint, unused exports, import cycles, database/schema and authorization guards. Initial checks caught two test-only typing/lint mistakes; both were corrected and their affected tests and gates passed.
The first exact-head CI run failed only the production lint-suppression inventory: newly landed #132399 (code author, PR author and merger @steipete) added a second packaged-bootstrap credential-redaction catch while the allowance remained one. The two operations now share one local execution/error owner, preserving redaction-before-truncation, the bounded diagnostic, contextual messages, execution ordering and omission of raw causes. Current main subsequently raised that allowance to two in #132394; this PR shrinks it back to the one remaining intentional suppression. The original failing test passes, as do real child-process failures and startup cleanup. Type checking caught a nullable environment capture during repair; the prepared command now captures its validated environment before the callback, and final types/lint/guards pass.
The second exact-head CI run exposed a current-main core-lint failure: #132099 (code author, PR author and merger @sjf-oa) added an unsafe-timestamp migration regression that took its test module over the existing 1,000-line limit. The failure also reproduced directly on main. A fixture-only extraction was prepared and verified here, but #132444 independently landed a smaller equivalent extraction while this candidate built. The resulting merge conflict is resolved by retaining that main fix and dropping our redundant extraction. Every migration test remains, and all 15 cases plus targeted lint pass after integration. No migration/schema change, raised limit or new suppression is carried in this PR.
Final candidate
b0c8a4f95ff41d4e6d9f5cebde21f86d5c9c2e05integrates pinned main0120daca2b49c29c92037c84a1286833ef524a90. Reset policy, QA redaction and suppression-shrink patches have identical range-diffs; only the now-redundant test extraction was dropped. Before this test-only main integration, 650 tests passed across 14 files/five shards, with one existing QA skip; all 19 affected migration/tooling cases and migration lint pass again afterward. All ten native-command/owner-default cases pass again. Assertion-safety, conflict and changed-file types/lint gates passed. Final-head normal build (5m14s), private QA build (52s), canonical build stamp, and real Buzz proof below passed. Exact-head CI and the requiredopenclaw/ci-gatecompleted successfully before native landing.Review disposition: the earlier whole-candidate independent P0–P2 review was clean. The final refresh raised one native-command-access concern, rejected after inspecting the complete decision:
!requireOwnermakesisOwnerForCommandsunconditionally true, so the removed native allowance cannot add access. The existing native no-owner and explicit-owner-denial cases exercise both sides of that invariant. No policy branch is reintroduced for an unreachable state.Real Buzz before/after proof
The pre-fix compiled Gateway reproduced the failure against the official Buzz service, using signed events from a genuinely admitted non-owner and two independently authenticated bot accounts.
/resetproduced no reset acknowledgment, changed neither target nor control-room lifecycle, and invoked no model. An ordered normal-message barrier then succeeded, showing the command failure was not an offline transport. The run intentionally failed and retained its RED receipt.After-fix verification passed on final head
b0c8a4f95ff41d4e6d9f5cebde21f86d5c9c2e05, following three earlier passing candidate runs with the identical driver. Threaded/resetand top-level/neweach produced a different durable lifecycle revision, retained the stable session ID, and returned exactly one signed acknowledgment with zero additional model requests. The second account/room stayed unchanged. The compiled CLI then setcommands.allowFrom.buzz=[]; after the owned restart, both commands were denied without lifecycle mutation or a reset acknowledgment. Ordered ordinary-message barriers still succeeded, with only those barriers invoking the mock model.{ "head": "b0c8a4f95ff41d4e6d9f5cebde21f86d5c9c2e05", "liveBuzzVerdict": "PASS", "allowedResetCases": 2, "explicitDenyCases": 2, "modelRequestsForResetCommands": 0, "modelRequestsForSeedsAndLivenessBarriers": 5, "otherAccountRoomUnchanged": true, "runtimeUnchanged": true, "gatewayAndMockPortsClosed": true, "nativeClientsClosed": 3, "taskKeyCopiesRemoved": 2, "effectiveProfilesUnchanged": 4 }Official service revision:
4f554b6385065b698db819498a6f359b17a45459. Final frozen runtime SHA-256:334e04310977afb4eb3f4e022616c966b2abe912f81853741adeb6da0cc68b4d. Driver SHA-256:aa06a4f889fe2b02ca9a32f7c1cf915a72760e06c2cb16163bafe8eedd2431bd. Final receipt SHA-256:9393b44264cdfe95464d6cb358147fe454b7a0b9ee0396937b158207affd1749.The Buzz relay, authentication, signatures, compiled Gateway, CLI and SQLite lifecycle are real; model responses are mocked. This is not a live Feishu or WhatsApp transport claim. Their shared policy and original Feishu peer-routing behavior are covered by owner-boundary tests. Temporary Gateway processes, ports, native clients, key copies, effective profiles, and frozen runtime hashes are checked during cleanup.
Review and scope
Production LOC: +109/-99 (net +10), including the separate QA CI repair (+47/-45). Tests and test support: +495/-137. Docs: +11/-5. The reset owner adds eight lines to retain the shipped SDK projection while keeping reset-only state private; the old policy module and redundant native path are deleted. The QA owner adds two lines to unify two credential-bearing execution boundaries while reducing the current-main suppression allowance. No additional compatibility shim is introduced.
The latest ClawSweeper review found no introduced P0–P2 defect and requested resolution of exact-head CI. The maintainer accepts the intentional restoration of reset-only admission and the explained production delta, with explicit-denial, scope and durable-session controls covered by tests and live evidence. Final mergeability and exact-head CI will be checked before native landing.
AI-assisted: Yes.