Repository navigation
refactor(auto-reply): drop the mid-command owner re-check - #204031
Merged
Merged
Conversation
The command-owner binder re-read the channel owner policy on every call,
and captureCommandOwnerAssertion turned that into a mid-command refusal
("Your owner authority changed; send a new request."). The owner decision
is now fixed when the command is admitted; a started command finishes.
- host-context-builder: command-owner isCurrent keeps only the ingress lifetime
- delete captureCommandOwnerAssertion, CommandContext.assertOwnerCurrent and
its readers, and the config-mutation assertCurrent plumbing
- CommandAuthorization.assertOwnerCurrent stays on the published SDK type,
deprecated and never set
Co-authored-by: obviyus <[email protected]>
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Collaborator
Author
|
Landed as 5721527. A channel owner's command no longer fails with "Your owner authority changed" when their role or owner-list entry changes mid-command; the owner decision is fixed at admission and the next command is checked again. Proof on a7da903: CI green, local review clean, one-admission E2E R/S/Q pass. Left for the next part of the sweep: the channel operator |
This was referenced Nov 23, 2026
obviyus
added a commit
that referenced
this pull request
Nov 23, 2026
…efusals (#204048) ## Problem Authority is checked once, when work starts. A started run may finish; Stop cancels; data fences stay. After parts 1 and 2 (#203999, #204031), some checks in `src/agents`, `src/channels/inbound-event` and the bundled Discord and Telegram native commands still re-read permissions mid-run, or refuse a data/lifecycle condition with text that claims "authority changed / is no longer active". This is part 3 of the agents/sessions/auto-reply refusal sweep. ## Fix Test for each site: can it fire when only a permission, approval or config changes while nothing about the run or data changes? Yes → authority re-check, deleted. No → Stop, run close or data fence, kept and reworded. | Site | Kind | Action | |---|---|---| | `channels/inbound-event/host-context-builder.ts` channel operator `assertCurrent` ("Channel operator authority changed; send a new request.") | authority (called only once, inside `captureChannelOperatorRunAuthority`, right after the same `isCurrent` check) | **deleted**. The operator decision is taken once when the message is admitted (the existing `isCurrent` gate). The admitted authority's own `assertCurrent` was already Stop-only (`signal?.throwIfAborted()`), so queued channel messages do not re-read the enqueue-time operator; they start through the normal queued-start admission (#203468/#203521), unchanged | | `gateway/operator-run-authority.ts` `captureChannelOperatorRunAuthority` `assertCurrent` input | plumbing for the above (only called once, at capture) | **deleted**. Its other caller, `gateway/session-activity-summary-authority.ts`, now runs its own one-time check directly before the capture (same check, same moment) | | `auto-reply/command-owner-authority.ts` `CommandOwnerRevokedError` and the `instanceof` branch in `agents/command/delivery-authority.ts` | dead after the delete (no thrower left) | **deleted** | | `agents/harness/node-execution-authority.ts` live `permissionMode === "full"` re-read (`retainedFullPermission`, `fullPermissionAllowed`) | authority (session permission mode) | **deleted**; Full stays the attempt's admitted mode (`attempt.permissionMode`, `admittedFull`) | | same file, "admitted node execution authority is no longer current" (signal, plugin registry/lifecycle, Gateway context, plugin id, session occurrence, workspace) | Stop / run close / data fence | kept, reworded: "The run or its session ended. Start a new turn to retry." | | `agents/harness/tool-authority.runtime.ts` `operatorAuthority?.assertCurrent()` in `assertReplyActive` | authority (Stop is already covered by `assertAdmitted`, which reads the run's abort signal) | **deleted** | | same file, "embedded tool authority is no longer active" ×2 (lease closed, run instance/run id changed) | run close / occurrence | kept, reworded: "The agent run ended. Start a new turn to retry." | | same file, "reply authority is no longer active", "embedded reply authority is no longer active" (operation route/fingerprint or attachment changed) | data fence | kept, reworded (existing text): "The reply target changed. Start a new turn to retry." | | same file, "Embedded attempt authority changed during steering" | data fence | kept, reworded (existing text): "Steering target changed" | | `agents/tools/gateway-caller-context.ts` "agent tool caller authority is no longer active" (no active admitted run lease) | run close | kept, reworded: "The agent run ended. Start a new turn to retry." | | `agents/tools/presence-tool-authority.ts` `hasCurrentClientAuthority() === false` ("Gateway caller authority is no longer active.") | authority (client re-auth) | **deleted**; request Stop (`scope.signal`) kept | | `agents/tools/sessions-operator-authority.ts` `hasCurrentClientAuthority() === false` ("Session control caller authority is no longer active.") | authority (client re-auth) | **deleted** | | `agents/subagents/announce/subagent-announce.requester-settle-receipt.ts` "Requester settle authority changed during watch admission" (requester entry gone or store source changed) | data fence | kept, reworded: "Requester session ended during watch admission" | | `agents/subagents/requester-cron-authority.ts` "Requester session authority changed before yield handoff" (session id, archive, lifecycle revision) | data fence | kept, reworded: "Requester session was reset or archived; yield handoff stopped" | | same file, "Requester followup authority is no longer current", "Requester authority is no longer current" (`isCurrent`: active flag, lifecycle generation, binding, session revision; the channel-owner part is ingress lifetime only since #204031) | lifecycle / data fence | kept, reworded: "Requester followup ended", "Requester continuation ended" | | `agents/worktrees/registry-run-end.worker.ts` "Managed worktree binding authority changed.", `run-end-lifecycle.ts` "Managed worktree registry authority changed; …" (registry row revision/owner fences) | data fence | kept, reworded: "Managed worktree binding changed.", "Managed worktree registry changed; prepare the operation again" | | `extensions/discord/src/monitor/native-command-auth.ts` deprecated `CommandAuthorization.assertOwnerCurrent` read, `assertActive` ("Discord command authority changed; send a new request."), `assertOwnerCurrent` ("Discord owner authority changed; send a new request.") | authority (config/owner re-read after admission) | **deleted**. Access is read once at admission (`resolveDiscordNativeCommandAccess` returns `allowed` and `senderIsOwner`); the second `isAllowed()` after ACP binding readiness and the `assertAuthority`/`assertActive`/`assertOwnerCurrent` plumbing are gone | | `extensions/telegram/src/{ingress,bot-native-command-dispatch,bot-native-command-plugins}.ts` deprecated `assertOwnerCurrent` reads | dead (`undefined` since #204031) | **deleted** | Left unchanged: - `bash-tools.exec-host-shared.ts` matcher (R6d). - `agents/worktrees/errors.ts` "GitHub publication worktree authority changed" (a registry data fence). Cut less: its only test expectation lives in `gateway/github-publication.test.ts`, which carries a synthetic credential-URL fixture that the local review's input scanner refuses; the reword goes with the next gateway sweep. - `operatorAuthority.assertCurrent` callers in `src/auto-reply/**` (~42 files) and `src/agents/**` (~70 files). Split per the ~25-file rule: this PR is 20 production files; the callers go to part 4. - `extensions/discord/.../message-handler.draft-preview.ts` and `extensions/telegram/src/telegram-ingress-non-retryable.ts` strings (R6d area). Production: 20 files, +95/−198. The lifetime-check ratchet counts fall in every touched file; `config/session-identity-allowlist.txt` is pruned for the reworded "no longer active" strings. ## User impact - A linked channel user whose operator role or link changes after their message was admitted sees the run finish. The next message is admitted again. - A Discord native command whose sender loses command or owner access while it runs now finishes, as admission decided. - A session in Full permission mode whose mode is lowered during a run keeps node execution for that run; the next run uses the new mode. - Refusals that remain now name what ended and the next step instead of claiming an authority change. - No new refusal, prompt or wait. Stop still cancels. ## Tests Deleted (they assert a mid-run permission refusal): - `discord native-command.interaction-boundary.test.ts` `revoked-command` and `revoked-channel` rows (config/policy changed during the command). - `sessions-control-authority.test.ts` "keeps the live client check when the ambient authority is passed back as prepared" (client deauth mid-run). - `gateway.sessions-send-provenance.authority.test-support.ts` `unlink` and `reassign` phases (linked principal unlinked during final send). The `current` phase stays: a linked principal's message delivers. - `host-capability.node-authority.test.ts` and `agent-runner-node-authority.test.ts` `permission` rows (session lowered from Full to workspace during the run). - `commands-plugin.channel-native.test.ts` fixture cleanup for children that failed with the removed "Channel operator authority changed" text. Text-only updates (same condition): `tool-authority.runtime.participants`, `.admission`, `.retention` support, `sessions-send-followup-revalidation`, `worker-session-tool-executor`, `server.requester-pause-authority`, `local-request-context.session-tools`, node-authority run-end text. Capture-time input removed: `operator-run-authority.worker.test.ts` (the capture no longer runs a caller check; the caller gates before capture) and `operator-access-program.worker.test.ts`. Pre-push (local): - `ocx test` with `OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1` on 47 touched and directly related test files (the 537-file importer set is over the 150 cap; CI runs the rest). Reds: 3 text expectations and one capture-time test (updated above), 11 files invalidated by a mid-run edit (rerun: 13 files pass), and `gateway.sessions-send-provenance.e2e` cross-human phase (`collaborativeSteeringRefused`), which fails the same way on the merge base `6523d6ace21c`. - `pnpm tsgo:core`, `pnpm tsgo:test`, `pnpm tsgo:extensions`: clean. - oxfmt and oxlint on changed files: clean. - lifetime-check and session-identity ratchets: OK (allowlist pruned 6289 → 6281). - CI round 1 OURS (4 files: requester-pause text, node-authority `permission` rows + text, session-tools text) fixed and rerun locally with 15 files that match the old texts: all pass. Round 1 MAIN-ALSO, each red on merge base `6523d6ace21c` locally: `question.session-access`, `question.communication`, `question.own-run`, `question.recovery`, `member-profile-role-recovery`, `mcp-http.personal-authority`, `mcp-http.async-scope`, `github-publication-imported-actions`, `ui sidebar-complete-roster`. ## Evidence One-admission E2E (isolated Gateway, real model) on head `fbea806e12bd`, `verdict.json` pass: - R `running-turn-finishes`: pass (revoke while running → the turn finishes) - Q `queued-input-refused-visibly`: pass (revoke while queued → refused visibly) - S `stop-cancels`: pass (Stop → aborted) Local review on `fbea806e12bd`: "patch is correct", no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
This was referenced Nov 23, 2026
obviyus
added a commit
that referenced
this pull request
Nov 23, 2026
…4065) Three tooling tests pass again: the CI test-routing lists no longer name two test files that #204031 deleted. Part of #204008. ## Problem #204031 (merged 10:41 UTC) deleted `src/auto-reply/reply/commands-allowlist.owner.test.ts` and `commands-plugins.owner.test.ts`. The database-worker route list and the PR-exempt runtime inventory still named them, so three tooling tests fail on scheduled `main` (run 45165162201): - `ci-node-test-plan.test.ts` "covers every infra test exactly once across split shards" (small-16): the shards list the two missing files. - `database-worker-registry.test.ts` "routes only existing test files" (small-21). - `ci-changed-node-test-plan.source-owners.test.ts` "retains affected owner tests for src/channels/message-access/operator-authority.test-support.ts" (small-19): it expected the deleted file. ## Solution Remove the two paths from `test/vitest/vitest.database-worker-core-paths.mjs` and `scripts/lib/ci-proof-test-inventory.mts`, and from the two test expectations that pinned them. No other entry changes. ## Evidence - `main` e6b910b locally: the infra-shard coverage case fails with the same two extra files as CI. - This branch: `ci-node-test-plan.test.ts`, `ci-changed-node-test-plan.source-owners.test.ts`, `database-worker-registry.test.ts` all pass (264 + 12 tests). Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus
added a commit
that referenced
this pull request
Nov 23, 2026
… (R6c part 4a) (#204069) ## Problem Authority is checked once, when work starts. A started run may finish; Stop cancels; data fences stay. After parts 1-3 (#203999, #204031, #204048), `src/auto-reply/**` still calls `operatorAuthority.assertCurrent()` mid-run in ~37 production files. This is part 4a of the agents/sessions/auto-reply refusal sweep. ## Fix Test for each site: can it fire when only a permission, approval or config changes while nothing about the run or data changes? Yes → authority re-check, deleted. No → Stop, run close or data fence, kept and reworded. `operatorAuthority.assertCurrent()` re-reads the requester's source (request/ingress lifetime, held reference, caller check). Stop is not lost: every site below already checks the run's own abort signal next to it, and `resolveFollowupAbortSignal` already folds `operatorAuthority.signal` into the queued run's abort signal and the reply operation's upstream signal. | Site | Kind | Action | |---|---|---| | `reply-agent-turn-preparation.ts` `assertOperatorCurrent` after the claim (×4) and the preflight-failure `beforeFreshMessageCommit` check | authority (queued start already re-admits through `prepareFollowupRunOperatorAuthority`, unchanged) | **deleted**; `operation.abortSignal` and lifecycle-generation checks stay | | same file, the one check before the mailbox claim | queued start + data fence: a retired cron delivery fence (`createCronCompletionDeliveryFence`) rides on the queued source's `assertCurrent` | **kept** (cut less, CI round 1: without it a retired cron follow-up was claimed and left session-controller cleanup pending, `cron/service.restart-delivery.test.ts`) | | `agent-runner-run.ts` (start + enqueue `assertCurrent`) | authority | **deleted**; lifecycle-generation check stays | | `agent-runner-execute.ts` stalled-turn continuation | authority | **deleted**; the recorded `operatorAuthority.signal` refusal stays (now an `aborted` read, no try/catch) | | `agent-runner-memory.ts` compaction `assertActive`, memory-flush `assertMemoryFlushCurrent` | authority | **deleted**; abort signal + `authorize()` stay | | `agent-runner-session-activity.ts` activity commit | authority (only input of its `assertCurrent` param) | **deleted** with the param | | `agent-runner-steer-adoption.ts`, `agent-runner-question-input.ts` | authority | **deleted**; abort signals stay | | `followup-delivery-tts.ts` (×2), `followup-turn-execution.ts` (×3) | authority | **deleted**; `turn.operation.abortSignal` stays | | `queue/delivery-context.ts`, `queue/enqueue.ts`, `queue/lifecycle.ts` (×2) | authority | **deleted**; cancellation/abort checks stay | | `reply-input-admission.ts`, `reply-source-admission.ts` | authority | **deleted**; abort, lifecycle generation and controller-operation fences stay | | `reply-source-binding.ts` | authority | **deleted**; source signal stays | | `reply-tool-authority-inbound.ts` incoming collaborative-steering participant | authority | **deleted**; host-issuer check `assertAdmittedRunOperatorAuthority` stays | | `reply-workspace.ts` + `get-reply.ts` plumbing | authority | **deleted** `operatorAuthority` param; preprocessing abort stays | | `get-reply.ts` (×2: after agent scope, before reset hooks) | authority | **deleted**; preprocessing abort stays | | `goal-continuation.ts` (×2), `goal-continuation-return.ts` (×2) | authority | **deleted**; eligibility, rearm-generation and session fences stay | Left unchanged: - `agents/worktrees/errors.ts` "GitHub publication worktree authority changed" (a registry data fence; reword planned: "GitHub publication worktree changed"). Cut less: its only expectation is in `gateway/github-publication.test.ts`, and the local review input scanner scans the whole touched file, including the base blob whose redaction fixture has a `user:password@` URL (trufflehog URI finding at line 403). Replacing the fixture still puts the old line in the reviewed input, so any PR that touches the file is refused until the scanner approves that synthetic value. - Split per the ~25-file rule (this PR touches 20 production files, +11/−59): `operatorAuthority.assertCurrent` callers in `channel-run-admission`, `commands-compact`, `conversation-label-generator`, `dispatch-from-config.{gather,lifecycle,prepare-context,prepare-delivery,prepare-operation}`, `get-reply-inline-actions`, `get-reply-run-admission`, `get-reply-run-context`, `get-reply.types`, `model-selection`, `request-native-subagent`, `session-event-{context,handoff,target}` (17 files) go to part 4a-2; the `src/agents/**` callers are part 4b. ## User impact - A requester whose access changes while their reply runs (preparation, compaction, memory flush, steering, TTS, goal continuation) sees the turn finish. The next request is admitted again. - Queued input still re-admits at its start (`prepareFollowupRunOperatorAuthority`), so revoke-while-queued stays a visible refusal. - Stop still cancels. - No new refusal, prompt or wait. ## Tests Deleted (they assert a mid-run permission refusal through `assertCurrent`): - `agent-runner-memory.test.ts` `operator` invalidation row; `agent-runner-memory.accounting.test.ts` "rechecks live authority after delayed … accounting". - `agent-runner.stalled-turn.test.ts` "unrecorded refusal" row (the recorded-revocation row stays). - `agent-runner-direct-runtime-config.test.ts` "refused during preflight" and "revoked while resolving input" rows. - `get-reply.workspace-failure.test.ts` operator-revocation half (the abort half stays). - `agent-runner-steer-adoption.worker.test.ts` "keeps refused pre-handoff steering …" (used `assertCurrent` as the fault trigger). - `goal-continuation.test.ts` `revoked` row; `queue/enqueue.steering.test.ts` "rechecks channel execution authority after waiting …" and "queues an unaccepted steer after an unrecorded authority refusal". - `agent-runner-fallback-steering.test.ts` `backend-ready` + `caller revoked` row (the fingerprint rows still pass through agents-side readers, part 4b). - `reply-agent-turn-preparation.test.ts` `revoked=true` row (operator signal abort during a mocked admission; real admissions follow it through the upstream signal) and the `assertCurrent` call-count expectation. Pre-push (local): - CI round 1 (`3c3c172b476d`): OURS `cron/service.restart-delivery.test.ts` teardown (fixed above by cutting less) and `server.chat-goal.test.ts` "lets an admitted owner Goal successor's tool effect finish" (69/69 pass locally on the fix head). Rerun of both plus `reply-agent-turn-preparation.test.ts`: 125/125 pass. - `ocx test` with `OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1` on 33 related test files (every direct importer test that builds an operator authority, plus the touched tests; the 382-file direct importer set is over the 150 cap, so CI runs the rest). 16 reds, all mid-run refusals through `assertCurrent`; deleted as listed above. Rerun of all 10 touched test files: 282/282 pass. - `pnpm tsgo:core`, `pnpm tsgo:test`: clean. oxfmt and oxlint on changed files: clean. - lifetime-check ratchet: OK (0 in changed files). session-identity ratchet: OK. ## Evidence One-admission E2E (isolated Gateway, real model) on head `3094468004d1` (and before on `3c3c172b476d`), `verdict.json` `pass: true` both times: - R `running-turn-finishes`: pass (revoke while running → the turn finishes; 3 tool ends after revoke) - Q `queued-input-refused-visibly`: pass (revoke while queued → refused visibly in the transcript) - S `stop-cancels`: pass (Stop → aborted) Local review: "patch is correct", no findings, on `3c3c172b476d` and on `3094468004d1`. Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus
added a commit
that referenced
this pull request
Nov 23, 2026
…dbox and command (#204093) ## Problem Authority is checked once, when work starts. A started run may finish; Stop cancels; data fences stay. After parts 1–3 (#203999, #204031, #204048), code in `src/agents/**` still calls `operatorAuthority.assertCurrent()` (the admitted run operator authority) mid-run. That call re-runs the source's check and the authority's revocation signal, so a run that admission already allowed can fail partway through. This is part 4b of the agents/sessions/auto-reply refusal sweep: the `src/agents/{tools,sandbox,command}` callers. Part 4a (auto-reply callers) is a separate PR. ## Fix Test for each site: can it fire when only a permission, approval or config changes, and nothing about the run or its data changes? Yes → mid-run authority re-check, deleted. Every site below passed that test. Each path keeps its own Stop signal and data fences; the table says which ones. | Site | Kind | Action | |---|---|---| | `tools/gateway.ts` `readGatewayToolOperatorScopes` | authority (presentation hint; RPC admission decides) | deleted | | `tools/sessions-operator-authority.ts` `captureSessionControlAuthority` per-source `source.assertCurrent` | authority | deleted. The host-issued check and the same-source check do not change, so they now run once at capture. Invocation Stop and its check stay | | `tools/sessions-operator-authority.ts` `prepareSandboxSessionTools` | authority | deleted (host-issued check stays) | | `tools/presence-tool-authority.ts` | authority | deleted. The tool request keeps its `signal` (Stop) | | `tools/agent-step.ts` returned peer result `operatorSource.assertCurrent` | authority | deleted. `operatorSource.signal` (Stop) and the prepared session source stay | | `tools/image-tool.ts`, `tools/pdf-tool.ts` (×3) | authority | deleted. The execution signal (tool signal + operator signal), the invocation check and the runtime claim stay | | `tools/gateway-caller-context.ts` operator selection and `withGatewayToolOperatorContinuation` | authority | deleted. `GatewayToolOperatorSelection.assertCurrent` is now only the selected participant's check, so it is optional | | `sandbox/docker.ts`, `sandbox/docker-backend.ts` | authority | deleted. The runtime/caller checks and the container lifecycle lease stay | | `sandbox/context.ts` (×2), `sandbox/stream-context.ts` | authority | deleted. The workspace signal (abort + operator signal), the state owner and the host guard stay | | `command/prepare.ts`, `maintenance.ts`, `session-preparation.ts`, `post-run.ts` (×3), `cli-compaction.ts` | authority | deleted. The abort signal, the source assertion and the lifecycle generation stay | | `command/model-selection.ts` (×3, including two `assertCommitAllowed` session writes) | authority | deleted. The host-issued check and the model-policy checks from admission stay | None of these sites throws its own refusal string, so the lifetime-check ratchet counts do not change. No text was reworded. Left for part 4c (the next split, 14 production files): `admitted-run-context.ts` (5 internal reads), `bash-tools.exec-runtime.ts`, `model-fallback-runner.ts`, `model-fallback-image.ts`, `operator-run-recovery-source.ts`, `plugin-tool-execution.ts`, `plugin-native-subagent.ts`, `harness/host-source-authority.ts`, `harness/selection.ts`, `cli-runner/tool-authority.ts`, `embedded-agent-runner/compact.queued.ts`, `subagents/spawn/subagent-spawn{,-collector}.ts`, `sessions/session-controller.tool-authority.ts`. ## User impact - When an operator's role, grant or device changes during a run, a started agent turn no longer fails in the middle of session prep, model selection, post-run delivery, CLI compaction, sandbox setup, or the image, PDF, presence, session-control or agent-step tools. The next request is admitted again. - Stop still cancels: each path keeps its abort signal. - No new refusal, prompt or wait. ## Tests Deleted (they assert a mid-run permission refusal): - `agents/tools/gateway.operator-scopes.test.ts` (whole file: revoked source throws while scopes are read). - `agents/tools/sessions-control-authority.test.ts`: source-revocation assertions in 4 cases. The checks on unissued copies, forged sources, insufficient scopes, reassignment and profile facts stay. - `agents/tools/sessions-create-tool.test.ts`: the revocation step of the catalog projection case. - `agents/sandbox/docker.access-lifetime.test.ts`: "does not let a revoked queued caller discard another grant's private custody". An admitted caller's grant is revoked while it waits on the container lifecycle lock. - `agents/tools/sessions-tool.self-archive.test.ts`: the `revoked` row (source revoked during the detached archive) and the `retired-assign` step (a later tool call in the same run after revocation). Found in CI round 1. ## Evidence - One-admission E2E on `846944a58649` (production is unchanged after it): R `running-turn-finishes`, Q `queued-input-refused-visibly`, S `stop-cancels` all pass. Details: #204093 (comment) - Local review: clean on each head. - `tsgo:core`, `tsgo:test`, oxfmt/oxlint on changed files: clean. `check:changed`: all ratchets and guards pass. - `server-methods/users-personal-file.test.ts` "live" rows fail on main too (merge base `6c8c6dd946b7`, locally; ci-triage MAIN-ALSO). Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus
added a commit
that referenced
this pull request
Nov 23, 2026
… session events (R6c part 4a-2) (#204105) ## Problem Authority is checked once, when work starts. A started run may finish, Stop cancels it, and data fences stay. After parts 1-3 and 4a (#203999, #204031, #204048, #204069), 17 files in `src/auto-reply/**` still call `operatorAuthority.assertCurrent()` while a run is in progress. This is part 4a-2 of the refusal sweep for agents, sessions and auto-reply. Part 4b (`src/agents/**`) runs separately. ## Fix The test for each site: can it fire when only a permission, approval or config changes, while nothing about the run or its data changes? If yes, it is an authority re-check, and this PR deletes it. If no, it is Stop, run close or a data fence, and this PR keeps it. `operatorAuthority.assertCurrent()` reads the requester's source again (request or ingress lifetime, held reference, caller check). Stop still works: every site below keeps its own abort-signal, lifecycle-generation, session-data or occurrence check. Where a reply has one, the reply's upstream signal already includes `operatorAuthority.signal`. | Site | Kind | Action | |---|---|---| | `dispatch-from-config.gather.ts`: `assertRequestCurrent` (session lookups ×3, progress check), check after runtime/TTS preparation | authority | **deleted**; abort signal, dispatch signal and lifecycle generation stay | | `dispatch-from-config.lifecycle.ts` / `.prepare-operation.ts` `assertRequestCurrent`: the `replyOptions.operatorAuthority` branch | authority | **deleted**; the reserved input's own source (`sourceAdapter.authority`) is kept as the queued-start check before the claim, the same as in 4a. `internalEventExecution`, channel authority, retirement and abort checks stay | | `dispatch-from-config.prepare-context.ts`, `.prepare-delivery.ts` | authority | **deleted**; pre-dispatch abort stays | | `get-reply-inline-actions.ts` (before an inline tool, before commands) | authority | **deleted**; abort stays | | `get-reply-run-admission.ts` preparation assertion | authority | **deleted** from the composition; internal-event and scheduled-automation sources (cron fence) stay | | `get-reply-run-context.ts` scheduled path | authority | **deleted**; `scheduledAutomation.assertCurrent()` (cron run fence) and abort signals stay | | `get-reply.types.ts` `prepareInternalGetReplyOptions` | authority | **deleted**; the host-issuer check `assertAdmittedRunOperatorAuthority` stays | | `model-selection.ts` (entry, reset `commitGuard`, `assertSelectionCurrent`) | authority | **deleted**; host-issuer check, model-policy checks and the session-entry/selection data fence stay | | `request-native-subagent.ts` (invocation `assertCurrent`, accepted-child `assertSourceCurrent`) | authority | **deleted**; guard, abort, state and `owner.assertOwnerCurrent` stay | | `session-event-context.ts` (event preparation, owner successor `isCurrent`) | authority | **deleted**; the occurrence assertion and `operatorAuthority.signal` (Stop) stay | | `session-event-handoff.ts` (`assertOwnerCurrent`, `captureSources`) | authority | **deleted**; settlement, acceptance, target, scheduled-automation, generation-lease, controller-operation and config-policy fences stay | | `session-event-target.ts` (capture entry, `assertCaptureCurrent`) | authority | **deleted**; host-issuer check, capture/producer assertions and caller-occurrence checks stay | | `commands-compact.ts` (entry, before acceptance) | authority | **deleted**; `rejectUnauthorizedCommand` at start, owner and current-read fences stay | | `conversation-label-generator.ts` | authority | **deleted**; caller assertion, abort and model-policy check stay | | `channel-run-admission.ts` `assertSourceCurrent` before admission | authority | **deleted**; caller's `assertSourceCurrent` and closed checks stay | Left unchanged: - `reply-agent-turn-preparation.ts` pre-claim check: the 4a cut-less site (cron delivery fence). - `agents/worktrees/errors.ts`: parked (see #204069). - No production authority-refusal strings remain in `src/auto-reply/**` or `src/sessions/**`. The lifetime-check ratchet reports 0 in changed files. ## User impact - A requester whose access changes while a reply is being prepared (dispatch, model selection, inline actions, `/compact`, native subagents, session events, label generation) sees the turn finish. The next request goes through admission again. - Queued input still goes through admission again when it starts, so a revoke while queued is still refused visibly. - Stop still cancels. - No new refusal, prompt or wait. ## Tests Deleted (they assert a mid-run permission refusal through `assertCurrent`): - `model-selection.test.ts` `authority` row of "rejects a changed … after awaiting missing-pin provider facts" (the pin/source/provider/session data rows stay). - `commands-compact.lifecycle.test.ts` `adoption`/`operator` row of "rechecks … authority for … before effects" (CI round 1; the caller, plugin-owner, writer, invocation and session rows stay). - `session-event-config-readmission.test.ts` "finalizes a failed-before-reply event …": only the assertion that the operator source is re-read after its policy scope closes; the failed-outcome assertions stay. Pre-push (local): - `ocx test` with `OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1` on 61 related test files: every importer test of a changed file that builds an operator authority or tests revocation, plus the direct tests of the changed modules. The full set of 180 importers is over the 150 cap, so CI runs the rest. Reds: the two rows above (fixed; rerun 47/47 pass), and `gateway/server-methods/system-event-routing.test.ts` (3 tests). Those 3 are stale on main: they mock `captureTarget` and expect "Gateway requester authority changed" from the system-event and set-heartbeats handlers, which no longer throw it. They do not import any changed code path. - `pnpm tsgo:core`, `pnpm tsgo:test`: clean. oxfmt and oxlint on changed files: clean. - `pnpm check:changed`: all lanes green except the dead-export scan (`scripts/lib/docker-e2e-watchdog.mjs: parseTimeoutMs`, inherited from main; this PR does not touch it). - Lifetime-check ratchet: OK (0 in changed files). Session-identity ratchet: OK. ## Evidence One-admission E2E (isolated Gateway, real model) on head `ddbcdf98f7b6`, `verdict.json` `pass: true`: - R `running-turn-finishes`: pass (revoke while running → the turn finishes) - Q `queued-input-refused-visibly`: pass (revoke while queued → refused visibly in the transcript; 0 provider requests with the queued marker) - S `stop-cancels`: pass (Stop → `aborted`) Local review on `ddbcdf98f7b6`: "patch is correct", no findings. CI round 1 (`ddbcdf98f7b6`): `commands-compact.lifecycle.test.ts` (OURS: a mid-run operator refusal row, deleted above) and `server.chat-goal.test.ts` "lets an admitted owner Goal successor's tool effect finish after ownership is revoked". That test asserts the behavior this PR keeps, and it passes locally on the head (69/69, the same as in #204069 round 1). The round-2 push (`e01a0ebc21bb`) changes one test only, so the E2E above still applies: production code is the same. Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 24, 2026
…04031) ## Problem Authority is checked once, when a command or run starts. The command-owner check still re-read the sender's owner role in the middle of a command: - `src/channels/inbound-event/host-context-builder.ts` bound a command-owner `isCurrent` that re-read the channel owner policy (`authority.isCurrent(config)`) on every call. - `captureCommandOwnerAssertion` turned that live check into a throw ("Channel operator authority changed"), and about 30 command handlers called it through `command.assertOwnerCurrent` after awaited work. So an owner who was demoted, unlinked or removed from `commands.ownerAllowFrom` while their command was running saw it fail with "Your owner authority changed; send a new request." (or "your owner authority changed; send /approve again"), although admission had already accepted the command. This is part 2 of the agents/sessions/auto-reply refusal sweep (part 1: openclaw#203999). Part 1 left this check because removing it needs the binder in `host-context-builder.ts`. ## Fix | Site | Kind | Action | |---|---|---| | `channels/inbound-event/host-context-builder.ts` command-owner `isCurrent` (re-read `authority.isCurrent(config)`) | **authority** | role read removed: the owner decision is taken once, at ingress (the existing early return); `isCurrent` keeps only the ingress lifetime (`owner.isLive()` and same Gateway context) | | `auto-reply/command-owner-authority.ts` `captureCommandOwnerAssertion` ("Channel operator authority changed; send a new request.") and the `sourceAssertion` field it alone read | **authority** | **deleted** | | `auto-reply/command-auth.ts` `assertOwnerCurrent` on the command authorization | **authority** | no longer set. The field stays on the published `CommandAuthorization` type as `@deprecated`, because the plugin SDK publishes that type (`plugin-sdk/command-auth-native`) and bundled plugins read it; a reader now gets `undefined` | | `auto-reply/reply/commands-types.ts` `CommandContext.assertOwnerCurrent` and its readers: `command-gates.ts` ("Your owner authority changed; send a new request."), `commands-approve.ts` ("your owner authority changed; send /approve again"), `commands-acp/{bindings,diagnostics,lifecycle,runtime-options}.ts`, `commands-allowlist.ts`, `commands-compact.ts`, `commands-config.ts`, `commands-context.ts`, `commands-fork.ts`, `commands-learn.ts`, `commands-mcp.ts`, `commands-plugins.ts`, `commands-session.ts`, `commands-subagents/action-agents.ts`, `get-reply-inline-actions.ts`, `get-reply.ts`, `system-agent/rescue-message.ts` | **authority** | **deleted** | | `auto-reply/reply/config-mutations.ts` `assertCurrent` parameters of `mutateConfigPath`, `setPluginEnabledFromCommand`, `applyAllowlistConfigMutation` | plumbing for the above (only caller passed the owner check) | **deleted** | | `auto-reply/reply/agent-runner-admission.ts`, `reply-source-admission.ts` owner assertion in the run source | **authority** (queued starts re-admit the owner once in `prepareReplyCommandOwnerAuthority`, unchanged) | **deleted** | | `auto-reply/reply/session-event-context.ts` `sourceAssertion` on bound owners | dead after the delete | removed | Kept, unchanged: Stop (`commandInvocationSignal`, `opts.abortSignal`), run close, writer and generation fences, the plugin command's own "invocation closed" check, and the queued-start owner re-admission (`prepareReplyCommandOwnerAuthority`). Out of scope, unchanged (left for the next PR in this sweep): - `host-context-builder.ts` channel **operator** `assertCurrent` ("Channel operator authority changed"). It is the `AdmittedRunOperatorAuthority.assertCurrent` for channel runs; queued channel items still read it at drain, so it goes with the `assertCurrent` readers (R6z / part 3). - The harness/subagents/tools/worktrees refusal strings (12 strings, 10 files) and the `operatorAuthority.assertCurrent` readers in the three directories (61 files). Split per the ~25-file rule. - `bash-tools.exec-host-shared.ts` matcher (message comes from gateway code, R6d). - Bundled plugins (`extensions/discord`, `extensions/telegram`) still read `CommandAuthorization.assertOwnerCurrent`; it is now `undefined`, so their calls are no-ops. Their production code is not touched here. Production: 27 files, +12/−138. ## User impact - A channel owner whose role or owner-list entry changes while their command runs now sees the command finish, as admission decided. The next command is checked again. - No new refusal, prompt or wait. Stop still cancels. ## Tests Deleted (they assert a mid-command permission refusal): - `commands-allowlist.owner.test.ts`, `commands-plugins.owner.test.ts` (whole files: owner demoted/unlinked during the command) - `commands-gating.test.ts` "blocks a stale owner snapshot"; `commands-session-restart.test.ts` revoked-owner cases; `commands-approve.test.ts` "owner revoked before decision"; `commands-compact.lifecycle.test.ts` "channel owner" row; `commands-plugin.owner.test.ts` demote/reassign and mid-command access-change rows; `commands-plugin.native-subagents.test.ts` owner rows (registry rows kept); `discord-native-owner.test.ts` "/think ACP revocation during …" rows and the re-read of an old command's authorization; `get-reply-inline-actions.tool-dispatch.test.ts` "authority revoked" rows; `rescue-message.test.ts` "rechecks rescue authority"; `gateway-caller-context.test.ts` "carries prepared command authority … without losing revocation" - Assertions that `assertOwnerCurrent` throws after a demotion (`discord-native-owner`, discord/imessage/telegram extension tests) Changed to the new contract (a started command finishes after an owner change): - `telegram-native-owner.test.ts`: native plugin command and configured ACP preparation finish after the owner is demoted. - `commands-config.owner.test.ts`: `/config`, `/mcp`, `/allowlist` persist after a mid-command role/link/grant change. - `commands-acp.owner.test.ts`: ACP option changes apply after a mid-command role/link change; a non-owner is still refused at start. - `queue.media-carrier`, `reply-agent-turn-preparation`, `delivery.restart-final.integration`, `session-delivery-generation.native`: read the owner decision through `getCommandOwnerAuthority(...).isCurrent()` / the generation source instead of the deleted capture; stale writer, generation and recovery conditions are unchanged. Pre-push (local, before the first push): - `ocx test` with `OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1` on the 66 touched and directly-named test files (the 226-file importer set is over the 150 cap; CI runs the rest); 16 failures, all mid-command owner refusals, updated as above; then the 5 affected files again: 74/74 pass. - `pnpm tsgo:core`, `pnpm tsgo:test`, `pnpm tsgo:extensions`: clean. - oxfmt and oxlint on changed files: clean. - lifetime-check and session-identity ratchets: OK. ## Evidence One-admission E2E (isolated Gateway, real model) on head `a7da903728e3`, `verdict.json`: - R `running-turn-finishes`: pass (revoke while running → the turn finishes) - Q `queued-input-refused-visibly`: pass (revoke while queued → refused visibly) - S `stop-cancels`: pass (Stop → aborted) Local review on `a7da903728e3`: "patch is correct", no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 24, 2026
…efusals (openclaw#204048) ## Problem Authority is checked once, when work starts. A started run may finish; Stop cancels; data fences stay. After parts 1 and 2 (openclaw#203999, openclaw#204031), some checks in `src/agents`, `src/channels/inbound-event` and the bundled Discord and Telegram native commands still re-read permissions mid-run, or refuse a data/lifecycle condition with text that claims "authority changed / is no longer active". This is part 3 of the agents/sessions/auto-reply refusal sweep. ## Fix Test for each site: can it fire when only a permission, approval or config changes while nothing about the run or data changes? Yes → authority re-check, deleted. No → Stop, run close or data fence, kept and reworded. | Site | Kind | Action | |---|---|---| | `channels/inbound-event/host-context-builder.ts` channel operator `assertCurrent` ("Channel operator authority changed; send a new request.") | authority (called only once, inside `captureChannelOperatorRunAuthority`, right after the same `isCurrent` check) | **deleted**. The operator decision is taken once when the message is admitted (the existing `isCurrent` gate). The admitted authority's own `assertCurrent` was already Stop-only (`signal?.throwIfAborted()`), so queued channel messages do not re-read the enqueue-time operator; they start through the normal queued-start admission (openclaw#203468/openclaw#203521), unchanged | | `gateway/operator-run-authority.ts` `captureChannelOperatorRunAuthority` `assertCurrent` input | plumbing for the above (only called once, at capture) | **deleted**. Its other caller, `gateway/session-activity-summary-authority.ts`, now runs its own one-time check directly before the capture (same check, same moment) | | `auto-reply/command-owner-authority.ts` `CommandOwnerRevokedError` and the `instanceof` branch in `agents/command/delivery-authority.ts` | dead after the delete (no thrower left) | **deleted** | | `agents/harness/node-execution-authority.ts` live `permissionMode === "full"` re-read (`retainedFullPermission`, `fullPermissionAllowed`) | authority (session permission mode) | **deleted**; Full stays the attempt's admitted mode (`attempt.permissionMode`, `admittedFull`) | | same file, "admitted node execution authority is no longer current" (signal, plugin registry/lifecycle, Gateway context, plugin id, session occurrence, workspace) | Stop / run close / data fence | kept, reworded: "The run or its session ended. Start a new turn to retry." | | `agents/harness/tool-authority.runtime.ts` `operatorAuthority?.assertCurrent()` in `assertReplyActive` | authority (Stop is already covered by `assertAdmitted`, which reads the run's abort signal) | **deleted** | | same file, "embedded tool authority is no longer active" ×2 (lease closed, run instance/run id changed) | run close / occurrence | kept, reworded: "The agent run ended. Start a new turn to retry." | | same file, "reply authority is no longer active", "embedded reply authority is no longer active" (operation route/fingerprint or attachment changed) | data fence | kept, reworded (existing text): "The reply target changed. Start a new turn to retry." | | same file, "Embedded attempt authority changed during steering" | data fence | kept, reworded (existing text): "Steering target changed" | | `agents/tools/gateway-caller-context.ts` "agent tool caller authority is no longer active" (no active admitted run lease) | run close | kept, reworded: "The agent run ended. Start a new turn to retry." | | `agents/tools/presence-tool-authority.ts` `hasCurrentClientAuthority() === false` ("Gateway caller authority is no longer active.") | authority (client re-auth) | **deleted**; request Stop (`scope.signal`) kept | | `agents/tools/sessions-operator-authority.ts` `hasCurrentClientAuthority() === false` ("Session control caller authority is no longer active.") | authority (client re-auth) | **deleted** | | `agents/subagents/announce/subagent-announce.requester-settle-receipt.ts` "Requester settle authority changed during watch admission" (requester entry gone or store source changed) | data fence | kept, reworded: "Requester session ended during watch admission" | | `agents/subagents/requester-cron-authority.ts` "Requester session authority changed before yield handoff" (session id, archive, lifecycle revision) | data fence | kept, reworded: "Requester session was reset or archived; yield handoff stopped" | | same file, "Requester followup authority is no longer current", "Requester authority is no longer current" (`isCurrent`: active flag, lifecycle generation, binding, session revision; the channel-owner part is ingress lifetime only since openclaw#204031) | lifecycle / data fence | kept, reworded: "Requester followup ended", "Requester continuation ended" | | `agents/worktrees/registry-run-end.worker.ts` "Managed worktree binding authority changed.", `run-end-lifecycle.ts` "Managed worktree registry authority changed; …" (registry row revision/owner fences) | data fence | kept, reworded: "Managed worktree binding changed.", "Managed worktree registry changed; prepare the operation again" | | `extensions/discord/src/monitor/native-command-auth.ts` deprecated `CommandAuthorization.assertOwnerCurrent` read, `assertActive` ("Discord command authority changed; send a new request."), `assertOwnerCurrent` ("Discord owner authority changed; send a new request.") | authority (config/owner re-read after admission) | **deleted**. Access is read once at admission (`resolveDiscordNativeCommandAccess` returns `allowed` and `senderIsOwner`); the second `isAllowed()` after ACP binding readiness and the `assertAuthority`/`assertActive`/`assertOwnerCurrent` plumbing are gone | | `extensions/telegram/src/{ingress,bot-native-command-dispatch,bot-native-command-plugins}.ts` deprecated `assertOwnerCurrent` reads | dead (`undefined` since openclaw#204031) | **deleted** | Left unchanged: - `bash-tools.exec-host-shared.ts` matcher (R6d). - `agents/worktrees/errors.ts` "GitHub publication worktree authority changed" (a registry data fence). Cut less: its only test expectation lives in `gateway/github-publication.test.ts`, which carries a synthetic credential-URL fixture that the local review's input scanner refuses; the reword goes with the next gateway sweep. - `operatorAuthority.assertCurrent` callers in `src/auto-reply/**` (~42 files) and `src/agents/**` (~70 files). Split per the ~25-file rule: this PR is 20 production files; the callers go to part 4. - `extensions/discord/.../message-handler.draft-preview.ts` and `extensions/telegram/src/telegram-ingress-non-retryable.ts` strings (R6d area). Production: 20 files, +95/−198. The lifetime-check ratchet counts fall in every touched file; `config/session-identity-allowlist.txt` is pruned for the reworded "no longer active" strings. ## User impact - A linked channel user whose operator role or link changes after their message was admitted sees the run finish. The next message is admitted again. - A Discord native command whose sender loses command or owner access while it runs now finishes, as admission decided. - A session in Full permission mode whose mode is lowered during a run keeps node execution for that run; the next run uses the new mode. - Refusals that remain now name what ended and the next step instead of claiming an authority change. - No new refusal, prompt or wait. Stop still cancels. ## Tests Deleted (they assert a mid-run permission refusal): - `discord native-command.interaction-boundary.test.ts` `revoked-command` and `revoked-channel` rows (config/policy changed during the command). - `sessions-control-authority.test.ts` "keeps the live client check when the ambient authority is passed back as prepared" (client deauth mid-run). - `gateway.sessions-send-provenance.authority.test-support.ts` `unlink` and `reassign` phases (linked principal unlinked during final send). The `current` phase stays: a linked principal's message delivers. - `host-capability.node-authority.test.ts` and `agent-runner-node-authority.test.ts` `permission` rows (session lowered from Full to workspace during the run). - `commands-plugin.channel-native.test.ts` fixture cleanup for children that failed with the removed "Channel operator authority changed" text. Text-only updates (same condition): `tool-authority.runtime.participants`, `.admission`, `.retention` support, `sessions-send-followup-revalidation`, `worker-session-tool-executor`, `server.requester-pause-authority`, `local-request-context.session-tools`, node-authority run-end text. Capture-time input removed: `operator-run-authority.worker.test.ts` (the capture no longer runs a caller check; the caller gates before capture) and `operator-access-program.worker.test.ts`. Pre-push (local): - `ocx test` with `OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1` on 47 touched and directly related test files (the 537-file importer set is over the 150 cap; CI runs the rest). Reds: 3 text expectations and one capture-time test (updated above), 11 files invalidated by a mid-run edit (rerun: 13 files pass), and `gateway.sessions-send-provenance.e2e` cross-human phase (`collaborativeSteeringRefused`), which fails the same way on the merge base `8a52d1d0de83`. - `pnpm tsgo:core`, `pnpm tsgo:test`, `pnpm tsgo:extensions`: clean. - oxfmt and oxlint on changed files: clean. - lifetime-check and session-identity ratchets: OK (allowlist pruned 6289 → 6281). - CI round 1 OURS (4 files: requester-pause text, node-authority `permission` rows + text, session-tools text) fixed and rerun locally with 15 files that match the old texts: all pass. Round 1 MAIN-ALSO, each red on merge base `8a52d1d0de83` locally: `question.session-access`, `question.communication`, `question.own-run`, `question.recovery`, `member-profile-role-recovery`, `mcp-http.personal-authority`, `mcp-http.async-scope`, `github-publication-imported-actions`, `ui sidebar-complete-roster`. ## Evidence One-admission E2E (isolated Gateway, real model) on head `fbea806e12bd`, `verdict.json` pass: - R `running-turn-finishes`: pass (revoke while running → the turn finishes) - Q `queued-input-refused-visibly`: pass (revoke while queued → refused visibly) - S `stop-cancels`: pass (Stop → aborted) Local review on `fbea806e12bd`: "patch is correct", no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 24, 2026
…sts (openclaw#204065) Three tooling tests pass again: the CI test-routing lists no longer name two test files that openclaw#204031 deleted. Part of openclaw#204008. ## Problem openclaw#204031 (merged 10:41 UTC) deleted `src/auto-reply/reply/commands-allowlist.owner.test.ts` and `commands-plugins.owner.test.ts`. The database-worker route list and the PR-exempt runtime inventory still named them, so three tooling tests fail on scheduled `main` (run 45165162201): - `ci-node-test-plan.test.ts` "covers every infra test exactly once across split shards" (small-16): the shards list the two missing files. - `database-worker-registry.test.ts` "routes only existing test files" (small-21). - `ci-changed-node-test-plan.source-owners.test.ts` "retains affected owner tests for src/channels/message-access/operator-authority.test-support.ts" (small-19): it expected the deleted file. ## Solution Remove the two paths from `test/vitest/vitest.database-worker-core-paths.mjs` and `scripts/lib/ci-proof-test-inventory.mts`, and from the two test expectations that pinned them. No other entry changes. ## Evidence - `main` e9a29ff locally: the infra-shard coverage case fails with the same two extra files as CI. - This branch: `ci-node-test-plan.test.ts`, `ci-changed-node-test-plan.source-owners.test.ts`, `database-worker-registry.test.ts` all pass (264 + 12 tests). Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 24, 2026
… (R6c part 4a) (openclaw#204069) ## Problem Authority is checked once, when work starts. A started run may finish; Stop cancels; data fences stay. After parts 1-3 (openclaw#203999, openclaw#204031, openclaw#204048), `src/auto-reply/**` still calls `operatorAuthority.assertCurrent()` mid-run in ~37 production files. This is part 4a of the agents/sessions/auto-reply refusal sweep. ## Fix Test for each site: can it fire when only a permission, approval or config changes while nothing about the run or data changes? Yes → authority re-check, deleted. No → Stop, run close or data fence, kept and reworded. `operatorAuthority.assertCurrent()` re-reads the requester's source (request/ingress lifetime, held reference, caller check). Stop is not lost: every site below already checks the run's own abort signal next to it, and `resolveFollowupAbortSignal` already folds `operatorAuthority.signal` into the queued run's abort signal and the reply operation's upstream signal. | Site | Kind | Action | |---|---|---| | `reply-agent-turn-preparation.ts` `assertOperatorCurrent` after the claim (×4) and the preflight-failure `beforeFreshMessageCommit` check | authority (queued start already re-admits through `prepareFollowupRunOperatorAuthority`, unchanged) | **deleted**; `operation.abortSignal` and lifecycle-generation checks stay | | same file, the one check before the mailbox claim | queued start + data fence: a retired cron delivery fence (`createCronCompletionDeliveryFence`) rides on the queued source's `assertCurrent` | **kept** (cut less, CI round 1: without it a retired cron follow-up was claimed and left session-controller cleanup pending, `cron/service.restart-delivery.test.ts`) | | `agent-runner-run.ts` (start + enqueue `assertCurrent`) | authority | **deleted**; lifecycle-generation check stays | | `agent-runner-execute.ts` stalled-turn continuation | authority | **deleted**; the recorded `operatorAuthority.signal` refusal stays (now an `aborted` read, no try/catch) | | `agent-runner-memory.ts` compaction `assertActive`, memory-flush `assertMemoryFlushCurrent` | authority | **deleted**; abort signal + `authorize()` stay | | `agent-runner-session-activity.ts` activity commit | authority (only input of its `assertCurrent` param) | **deleted** with the param | | `agent-runner-steer-adoption.ts`, `agent-runner-question-input.ts` | authority | **deleted**; abort signals stay | | `followup-delivery-tts.ts` (×2), `followup-turn-execution.ts` (×3) | authority | **deleted**; `turn.operation.abortSignal` stays | | `queue/delivery-context.ts`, `queue/enqueue.ts`, `queue/lifecycle.ts` (×2) | authority | **deleted**; cancellation/abort checks stay | | `reply-input-admission.ts`, `reply-source-admission.ts` | authority | **deleted**; abort, lifecycle generation and controller-operation fences stay | | `reply-source-binding.ts` | authority | **deleted**; source signal stays | | `reply-tool-authority-inbound.ts` incoming collaborative-steering participant | authority | **deleted**; host-issuer check `assertAdmittedRunOperatorAuthority` stays | | `reply-workspace.ts` + `get-reply.ts` plumbing | authority | **deleted** `operatorAuthority` param; preprocessing abort stays | | `get-reply.ts` (×2: after agent scope, before reset hooks) | authority | **deleted**; preprocessing abort stays | | `goal-continuation.ts` (×2), `goal-continuation-return.ts` (×2) | authority | **deleted**; eligibility, rearm-generation and session fences stay | Left unchanged: - `agents/worktrees/errors.ts` "GitHub publication worktree authority changed" (a registry data fence; reword planned: "GitHub publication worktree changed"). Cut less: its only expectation is in `gateway/github-publication.test.ts`, and the local review input scanner scans the whole touched file, including the base blob whose redaction fixture has a `user:password@` URL (trufflehog URI finding at line 403). Replacing the fixture still puts the old line in the reviewed input, so any PR that touches the file is refused until the scanner approves that synthetic value. - Split per the ~25-file rule (this PR touches 20 production files, +11/−59): `operatorAuthority.assertCurrent` callers in `channel-run-admission`, `commands-compact`, `conversation-label-generator`, `dispatch-from-config.{gather,lifecycle,prepare-context,prepare-delivery,prepare-operation}`, `get-reply-inline-actions`, `get-reply-run-admission`, `get-reply-run-context`, `get-reply.types`, `model-selection`, `request-native-subagent`, `session-event-{context,handoff,target}` (17 files) go to part 4a-2; the `src/agents/**` callers are part 4b. ## User impact - A requester whose access changes while their reply runs (preparation, compaction, memory flush, steering, TTS, goal continuation) sees the turn finish. The next request is admitted again. - Queued input still re-admits at its start (`prepareFollowupRunOperatorAuthority`), so revoke-while-queued stays a visible refusal. - Stop still cancels. - No new refusal, prompt or wait. ## Tests Deleted (they assert a mid-run permission refusal through `assertCurrent`): - `agent-runner-memory.test.ts` `operator` invalidation row; `agent-runner-memory.accounting.test.ts` "rechecks live authority after delayed … accounting". - `agent-runner.stalled-turn.test.ts` "unrecorded refusal" row (the recorded-revocation row stays). - `agent-runner-direct-runtime-config.test.ts` "refused during preflight" and "revoked while resolving input" rows. - `get-reply.workspace-failure.test.ts` operator-revocation half (the abort half stays). - `agent-runner-steer-adoption.worker.test.ts` "keeps refused pre-handoff steering …" (used `assertCurrent` as the fault trigger). - `goal-continuation.test.ts` `revoked` row; `queue/enqueue.steering.test.ts` "rechecks channel execution authority after waiting …" and "queues an unaccepted steer after an unrecorded authority refusal". - `agent-runner-fallback-steering.test.ts` `backend-ready` + `caller revoked` row (the fingerprint rows still pass through agents-side readers, part 4b). - `reply-agent-turn-preparation.test.ts` `revoked=true` row (operator signal abort during a mocked admission; real admissions follow it through the upstream signal) and the `assertCurrent` call-count expectation. Pre-push (local): - CI round 1 (`3c3c172b476d`): OURS `cron/service.restart-delivery.test.ts` teardown (fixed above by cutting less) and `server.chat-goal.test.ts` "lets an admitted owner Goal successor's tool effect finish" (69/69 pass locally on the fix head). Rerun of both plus `reply-agent-turn-preparation.test.ts`: 125/125 pass. - `ocx test` with `OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1` on 33 related test files (every direct importer test that builds an operator authority, plus the touched tests; the 382-file direct importer set is over the 150 cap, so CI runs the rest). 16 reds, all mid-run refusals through `assertCurrent`; deleted as listed above. Rerun of all 10 touched test files: 282/282 pass. - `pnpm tsgo:core`, `pnpm tsgo:test`: clean. oxfmt and oxlint on changed files: clean. - lifetime-check ratchet: OK (0 in changed files). session-identity ratchet: OK. ## Evidence One-admission E2E (isolated Gateway, real model) on head `3094468004d1` (and before on `3c3c172b476d`), `verdict.json` `pass: true` both times: - R `running-turn-finishes`: pass (revoke while running → the turn finishes; 3 tool ends after revoke) - Q `queued-input-refused-visibly`: pass (revoke while queued → refused visibly in the transcript) - S `stop-cancels`: pass (Stop → aborted) Local review: "patch is correct", no findings, on `3c3c172b476d` and on `3094468004d1`. Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 24, 2026
…dbox and command (openclaw#204093) ## Problem Authority is checked once, when work starts. A started run may finish; Stop cancels; data fences stay. After parts 1–3 (openclaw#203999, openclaw#204031, openclaw#204048), code in `src/agents/**` still calls `operatorAuthority.assertCurrent()` (the admitted run operator authority) mid-run. That call re-runs the source's check and the authority's revocation signal, so a run that admission already allowed can fail partway through. This is part 4b of the agents/sessions/auto-reply refusal sweep: the `src/agents/{tools,sandbox,command}` callers. Part 4a (auto-reply callers) is a separate PR. ## Fix Test for each site: can it fire when only a permission, approval or config changes, and nothing about the run or its data changes? Yes → mid-run authority re-check, deleted. Every site below passed that test. Each path keeps its own Stop signal and data fences; the table says which ones. | Site | Kind | Action | |---|---|---| | `tools/gateway.ts` `readGatewayToolOperatorScopes` | authority (presentation hint; RPC admission decides) | deleted | | `tools/sessions-operator-authority.ts` `captureSessionControlAuthority` per-source `source.assertCurrent` | authority | deleted. The host-issued check and the same-source check do not change, so they now run once at capture. Invocation Stop and its check stay | | `tools/sessions-operator-authority.ts` `prepareSandboxSessionTools` | authority | deleted (host-issued check stays) | | `tools/presence-tool-authority.ts` | authority | deleted. The tool request keeps its `signal` (Stop) | | `tools/agent-step.ts` returned peer result `operatorSource.assertCurrent` | authority | deleted. `operatorSource.signal` (Stop) and the prepared session source stay | | `tools/image-tool.ts`, `tools/pdf-tool.ts` (×3) | authority | deleted. The execution signal (tool signal + operator signal), the invocation check and the runtime claim stay | | `tools/gateway-caller-context.ts` operator selection and `withGatewayToolOperatorContinuation` | authority | deleted. `GatewayToolOperatorSelection.assertCurrent` is now only the selected participant's check, so it is optional | | `sandbox/docker.ts`, `sandbox/docker-backend.ts` | authority | deleted. The runtime/caller checks and the container lifecycle lease stay | | `sandbox/context.ts` (×2), `sandbox/stream-context.ts` | authority | deleted. The workspace signal (abort + operator signal), the state owner and the host guard stay | | `command/prepare.ts`, `maintenance.ts`, `session-preparation.ts`, `post-run.ts` (×3), `cli-compaction.ts` | authority | deleted. The abort signal, the source assertion and the lifecycle generation stay | | `command/model-selection.ts` (×3, including two `assertCommitAllowed` session writes) | authority | deleted. The host-issued check and the model-policy checks from admission stay | None of these sites throws its own refusal string, so the lifetime-check ratchet counts do not change. No text was reworded. Left for part 4c (the next split, 14 production files): `admitted-run-context.ts` (5 internal reads), `bash-tools.exec-runtime.ts`, `model-fallback-runner.ts`, `model-fallback-image.ts`, `operator-run-recovery-source.ts`, `plugin-tool-execution.ts`, `plugin-native-subagent.ts`, `harness/host-source-authority.ts`, `harness/selection.ts`, `cli-runner/tool-authority.ts`, `embedded-agent-runner/compact.queued.ts`, `subagents/spawn/subagent-spawn{,-collector}.ts`, `sessions/session-controller.tool-authority.ts`. ## User impact - When an operator's role, grant or device changes during a run, a started agent turn no longer fails in the middle of session prep, model selection, post-run delivery, CLI compaction, sandbox setup, or the image, PDF, presence, session-control or agent-step tools. The next request is admitted again. - Stop still cancels: each path keeps its abort signal. - No new refusal, prompt or wait. ## Tests Deleted (they assert a mid-run permission refusal): - `agents/tools/gateway.operator-scopes.test.ts` (whole file: revoked source throws while scopes are read). - `agents/tools/sessions-control-authority.test.ts`: source-revocation assertions in 4 cases. The checks on unissued copies, forged sources, insufficient scopes, reassignment and profile facts stay. - `agents/tools/sessions-create-tool.test.ts`: the revocation step of the catalog projection case. - `agents/sandbox/docker.access-lifetime.test.ts`: "does not let a revoked queued caller discard another grant's private custody". An admitted caller's grant is revoked while it waits on the container lifecycle lock. - `agents/tools/sessions-tool.self-archive.test.ts`: the `revoked` row (source revoked during the detached archive) and the `retired-assign` step (a later tool call in the same run after revocation). Found in CI round 1. ## Evidence - One-admission E2E on `846944a58649` (production is unchanged after it): R `running-turn-finishes`, Q `queued-input-refused-visibly`, S `stop-cancels` all pass. Details: openclaw#204093 (comment) - Local review: clean on each head. - `tsgo:core`, `tsgo:test`, oxfmt/oxlint on changed files: clean. `check:changed`: all ratchets and guards pass. - `server-methods/users-personal-file.test.ts` "live" rows fail on main too (merge base `a02826832065`, locally; ci-triage MAIN-ALSO). Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 24, 2026
… session events (R6c part 4a-2) (openclaw#204105) ## Problem Authority is checked once, when work starts. A started run may finish, Stop cancels it, and data fences stay. After parts 1-3 and 4a (openclaw#203999, openclaw#204031, openclaw#204048, openclaw#204069), 17 files in `src/auto-reply/**` still call `operatorAuthority.assertCurrent()` while a run is in progress. This is part 4a-2 of the refusal sweep for agents, sessions and auto-reply. Part 4b (`src/agents/**`) runs separately. ## Fix The test for each site: can it fire when only a permission, approval or config changes, while nothing about the run or its data changes? If yes, it is an authority re-check, and this PR deletes it. If no, it is Stop, run close or a data fence, and this PR keeps it. `operatorAuthority.assertCurrent()` reads the requester's source again (request or ingress lifetime, held reference, caller check). Stop still works: every site below keeps its own abort-signal, lifecycle-generation, session-data or occurrence check. Where a reply has one, the reply's upstream signal already includes `operatorAuthority.signal`. | Site | Kind | Action | |---|---|---| | `dispatch-from-config.gather.ts`: `assertRequestCurrent` (session lookups ×3, progress check), check after runtime/TTS preparation | authority | **deleted**; abort signal, dispatch signal and lifecycle generation stay | | `dispatch-from-config.lifecycle.ts` / `.prepare-operation.ts` `assertRequestCurrent`: the `replyOptions.operatorAuthority` branch | authority | **deleted**; the reserved input's own source (`sourceAdapter.authority`) is kept as the queued-start check before the claim, the same as in 4a. `internalEventExecution`, channel authority, retirement and abort checks stay | | `dispatch-from-config.prepare-context.ts`, `.prepare-delivery.ts` | authority | **deleted**; pre-dispatch abort stays | | `get-reply-inline-actions.ts` (before an inline tool, before commands) | authority | **deleted**; abort stays | | `get-reply-run-admission.ts` preparation assertion | authority | **deleted** from the composition; internal-event and scheduled-automation sources (cron fence) stay | | `get-reply-run-context.ts` scheduled path | authority | **deleted**; `scheduledAutomation.assertCurrent()` (cron run fence) and abort signals stay | | `get-reply.types.ts` `prepareInternalGetReplyOptions` | authority | **deleted**; the host-issuer check `assertAdmittedRunOperatorAuthority` stays | | `model-selection.ts` (entry, reset `commitGuard`, `assertSelectionCurrent`) | authority | **deleted**; host-issuer check, model-policy checks and the session-entry/selection data fence stay | | `request-native-subagent.ts` (invocation `assertCurrent`, accepted-child `assertSourceCurrent`) | authority | **deleted**; guard, abort, state and `owner.assertOwnerCurrent` stay | | `session-event-context.ts` (event preparation, owner successor `isCurrent`) | authority | **deleted**; the occurrence assertion and `operatorAuthority.signal` (Stop) stay | | `session-event-handoff.ts` (`assertOwnerCurrent`, `captureSources`) | authority | **deleted**; settlement, acceptance, target, scheduled-automation, generation-lease, controller-operation and config-policy fences stay | | `session-event-target.ts` (capture entry, `assertCaptureCurrent`) | authority | **deleted**; host-issuer check, capture/producer assertions and caller-occurrence checks stay | | `commands-compact.ts` (entry, before acceptance) | authority | **deleted**; `rejectUnauthorizedCommand` at start, owner and current-read fences stay | | `conversation-label-generator.ts` | authority | **deleted**; caller assertion, abort and model-policy check stay | | `channel-run-admission.ts` `assertSourceCurrent` before admission | authority | **deleted**; caller's `assertSourceCurrent` and closed checks stay | Left unchanged: - `reply-agent-turn-preparation.ts` pre-claim check: the 4a cut-less site (cron delivery fence). - `agents/worktrees/errors.ts`: parked (see openclaw#204069). - No production authority-refusal strings remain in `src/auto-reply/**` or `src/sessions/**`. The lifetime-check ratchet reports 0 in changed files. ## User impact - A requester whose access changes while a reply is being prepared (dispatch, model selection, inline actions, `/compact`, native subagents, session events, label generation) sees the turn finish. The next request goes through admission again. - Queued input still goes through admission again when it starts, so a revoke while queued is still refused visibly. - Stop still cancels. - No new refusal, prompt or wait. ## Tests Deleted (they assert a mid-run permission refusal through `assertCurrent`): - `model-selection.test.ts` `authority` row of "rejects a changed … after awaiting missing-pin provider facts" (the pin/source/provider/session data rows stay). - `commands-compact.lifecycle.test.ts` `adoption`/`operator` row of "rechecks … authority for … before effects" (CI round 1; the caller, plugin-owner, writer, invocation and session rows stay). - `session-event-config-readmission.test.ts` "finalizes a failed-before-reply event …": only the assertion that the operator source is re-read after its policy scope closes; the failed-outcome assertions stay. Pre-push (local): - `ocx test` with `OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1` on 61 related test files: every importer test of a changed file that builds an operator authority or tests revocation, plus the direct tests of the changed modules. The full set of 180 importers is over the 150 cap, so CI runs the rest. Reds: the two rows above (fixed; rerun 47/47 pass), and `gateway/server-methods/system-event-routing.test.ts` (3 tests). Those 3 are stale on main: they mock `captureTarget` and expect "Gateway requester authority changed" from the system-event and set-heartbeats handlers, which no longer throw it. They do not import any changed code path. - `pnpm tsgo:core`, `pnpm tsgo:test`: clean. oxfmt and oxlint on changed files: clean. - `pnpm check:changed`: all lanes green except the dead-export scan (`scripts/lib/docker-e2e-watchdog.mjs: parseTimeoutMs`, inherited from main; this PR does not touch it). - Lifetime-check ratchet: OK (0 in changed files). Session-identity ratchet: OK. ## Evidence One-admission E2E (isolated Gateway, real model) on head `ddbcdf98f7b6`, `verdict.json` `pass: true`: - R `running-turn-finishes`: pass (revoke while running → the turn finishes) - Q `queued-input-refused-visibly`: pass (revoke while queued → refused visibly in the transcript; 0 provider requests with the queued marker) - S `stop-cancels`: pass (Stop → `aborted`) Local review on `ddbcdf98f7b6`: "patch is correct", no findings. CI round 1 (`ddbcdf98f7b6`): `commands-compact.lifecycle.test.ts` (OURS: a mid-run operator refusal row, deleted above) and `server.chat-goal.test.ts` "lets an admitted owner Goal successor's tool effect finish after ownership is revoked". That test asserts the behavior this PR keeps, and it passes locally on the head (69/69, the same as in openclaw#204069 round 1). The round-2 push (`e01a0ebc21bb`) changes one test only, so the E2E above still applies: production code is the same. Co-authored-by: Ayaan Zaidi <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Authority is checked once, when a command or run starts. The command-owner check still re-read the sender's owner role in the middle of a command:
src/channels/inbound-event/host-context-builder.tsbound a command-ownerisCurrentthat re-read the channel owner policy (authority.isCurrent(config)) on every call.captureCommandOwnerAssertionturned that live check into a throw ("Channel operator authority changed"), and about 30 command handlers called it throughcommand.assertOwnerCurrentafter awaited work.So an owner who was demoted, unlinked or removed from
commands.ownerAllowFromwhile their command was running saw it fail with "Your owner authority changed; send a new request." (or "your owner authority changed; send /approve again"), although admission had already accepted the command.This is part 2 of the agents/sessions/auto-reply refusal sweep (part 1: #203999). Part 1 left this check because removing it needs the binder in
host-context-builder.ts.Fix
channels/inbound-event/host-context-builder.tscommand-ownerisCurrent(re-readauthority.isCurrent(config))isCurrentkeeps only the ingress lifetime (owner.isLive()and same Gateway context)auto-reply/command-owner-authority.tscaptureCommandOwnerAssertion("Channel operator authority changed; send a new request.") and thesourceAssertionfield it alone readauto-reply/command-auth.tsassertOwnerCurrenton the command authorizationCommandAuthorizationtype as@deprecated, because the plugin SDK publishes that type (plugin-sdk/command-auth-native) and bundled plugins read it; a reader now getsundefinedauto-reply/reply/commands-types.tsCommandContext.assertOwnerCurrentand its readers:command-gates.ts("Your owner authority changed; send a new request."),commands-approve.ts("your owner authority changed; send /approve again"),commands-acp/{bindings,diagnostics,lifecycle,runtime-options}.ts,commands-allowlist.ts,commands-compact.ts,commands-config.ts,commands-context.ts,commands-fork.ts,commands-learn.ts,commands-mcp.ts,commands-plugins.ts,commands-session.ts,commands-subagents/action-agents.ts,get-reply-inline-actions.ts,get-reply.ts,system-agent/rescue-message.tsauto-reply/reply/config-mutations.tsassertCurrentparameters ofmutateConfigPath,setPluginEnabledFromCommand,applyAllowlistConfigMutationauto-reply/reply/agent-runner-admission.ts,reply-source-admission.tsowner assertion in the run sourceprepareReplyCommandOwnerAuthority, unchanged)auto-reply/reply/session-event-context.tssourceAssertionon bound ownersKept, unchanged: Stop (
commandInvocationSignal,opts.abortSignal), run close, writer and generation fences, the plugin command's own "invocation closed" check, and the queued-start owner re-admission (prepareReplyCommandOwnerAuthority).Out of scope, unchanged (left for the next PR in this sweep):
host-context-builder.tschannel operatorassertCurrent("Channel operator authority changed"). It is theAdmittedRunOperatorAuthority.assertCurrentfor channel runs; queued channel items still read it at drain, so it goes with theassertCurrentreaders (R6z / part 3).operatorAuthority.assertCurrentreaders in the three directories (61 files). Split per the ~25-file rule.bash-tools.exec-host-shared.tsmatcher (message comes from gateway code, R6d).extensions/discord,extensions/telegram) still readCommandAuthorization.assertOwnerCurrent; it is nowundefined, so their calls are no-ops. Their production code is not touched here.Production: 27 files, +12/−138.
User impact
Tests
Deleted (they assert a mid-command permission refusal):
commands-allowlist.owner.test.ts,commands-plugins.owner.test.ts(whole files: owner demoted/unlinked during the command)commands-gating.test.ts"blocks a stale owner snapshot";commands-session-restart.test.tsrevoked-owner cases;commands-approve.test.ts"owner revoked before decision";commands-compact.lifecycle.test.ts"channel owner" row;commands-plugin.owner.test.tsdemote/reassign and mid-command access-change rows;commands-plugin.native-subagents.test.tsowner rows (registry rows kept);discord-native-owner.test.ts"/think ACP revocation during …" rows and the re-read of an old command's authorization;get-reply-inline-actions.tool-dispatch.test.ts"authority revoked" rows;rescue-message.test.ts"rechecks rescue authority";gateway-caller-context.test.ts"carries prepared command authority … without losing revocation"assertOwnerCurrentthrows after a demotion (discord-native-owner, discord/imessage/telegram extension tests)Changed to the new contract (a started command finishes after an owner change):
telegram-native-owner.test.ts: native plugin command and configured ACP preparation finish after the owner is demoted.commands-config.owner.test.ts:/config,/mcp,/allowlistpersist after a mid-command role/link/grant change.commands-acp.owner.test.ts: ACP option changes apply after a mid-command role/link change; a non-owner is still refused at start.queue.media-carrier,reply-agent-turn-preparation,delivery.restart-final.integration,session-delivery-generation.native: read the owner decision throughgetCommandOwnerAuthority(...).isCurrent()/ the generation source instead of the deleted capture; stale writer, generation and recovery conditions are unchanged.Pre-push (local, before the first push):
ocx testwithOPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1on the 66 touched and directly-named test files (the 226-file importer set is over the 150 cap; CI runs the rest); 16 failures, all mid-command owner refusals, updated as above; then the 5 affected files again: 74/74 pass.pnpm tsgo:core,pnpm tsgo:test,pnpm tsgo:extensions: clean.Evidence
One-admission E2E (isolated Gateway, real model) on head
a7da903728e3,verdict.json:running-turn-finishes: pass (revoke while running → the turn finishes)queued-input-refused-visibly: pass (revoke while queued → refused visibly)stop-cancels: pass (Stop → aborted)Local review on
a7da903728e3: "patch is correct", no findings.