Skip to content

fix(channels): claim ask_user replies before turn admission - #146847

Open
ericcaiwx-star wants to merge 5 commits into
openclaw:mainfrom
ericcaiwx-star:codex/fix-plugin-ask-user-inbound
Open

ericcaiwx-star wants to merge 5 commits into
openclaw:mainfrom
ericcaiwx-star:codex/fix-plugin-ask-user-inbound

Conversation

@ericcaiwx-star

@ericcaiwx-star ericcaiwx-star commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Related: WecomTeam/wecom-openclaw-plugin#187

What Problem This Solves

Fixes plain-text answers becoming a new agent turn when an external channel uses the public inbound dispatcher while an ask_user question is pending.

User Impact

An eligible human reply resolves the original pending question before a successor turn is admitted. Control and registered plugin commands keep priority; media, non-human events, and messages with no pending question keep their existing paths.

The optional, bounded sourceBindingRoutes field belongs only to the existing question.resolve request (answer and cancel forms). Stored question/session formats and responses are unchanged, so this needs no data migration or operator action.

Why This Change Was Made

The inbound admission path now asks the existing runtime question owner to claim the answer, retaining the current execution owner's profile admission and frozen tool authority. It carries the prepared conversation route through queued handoff and checks current source/creator authority after awaited preparation and at the Gateway commit boundary. The durable binding check uses the existing ordered SQLite worker owner.

Pending fallback answers retain the existing route-only authority proof through the actual host claim and record the same prepared participant identity admitted by the current profile owner. An invalid multi-question answer keeps the question open and emits the existing suppression-safe retry notice through both early and later dispatch.

Confirmed, refused, and indeterminate answers retain their recorded custody and cannot be replayed as a new user turn. An explicitly unsupported legacy dispatcher before I/O reasserts current source/binding authority and continues ordinary dispatch. A source-bound V1 execution backend remains unsupported under the existing owner contract; it gains no host-claim bypass. Question-only runtimes with no execution target remain covered.

Evidence

Candidate head: fd9cd3f94d14b703315d4a635d96026779430237
Tree: a10e67a6911cc75d96e50c17a46e4ee69724d94f
Base: bb5656bf89e230bb3d6c9040b1e9b86df0306439

The refresh resolves the new conflict with current main's physical-source preparation callback. Both ordered and unordered readers retain prepareSource before reading and the existing asynchronous beforeConsume preparation before synchronous consumption; currentness is reasserted after the awaited preparation. The current-main line-cap growth ratchet also required moving the existing read-scope capture/native-selection pair into one sibling owner with direct internal imports. Both function bodies are unchanged; their consuming-frame authority checks stay in place. No additional schema, configuration, stored format, public SDK API, or changelog change was introduced by this refresh.

  • Focused runtime before the unchanged-helper relocation: 14 files, 246 tests passed across seven canonical Vitest shards (219.27 seconds). Neighboring current-main source/operator-authority boundaries: three files, 56 tests passed (52.26 seconds). After relocation, five real SQLite source/logical/read-only/status/combined-store suites passed 74 tests (98.98 seconds), including registry/file/caller replacement, alias changes, cleanup revocation and incognito owners. The latter run used the identical final candidate tree; source diff identity stayed unchanged through commit, and lock SHA/mtime/ctime stayed unchanged across the runs. These suites overlap and their counts are not summed.
  • The extended existing SQLite authority-lifetime test checks source capture → asynchronous preparation → synchronous consume for both ordered/unordered branches, retaining escaped-authority closure assertions. The exact pinned-main owner control fails both ordering assertions because it has source capture without the PR preparation hook; the composed candidate passes. This discriminates the conflict integration and is not claimed as a new main defect.
  • Fresh whole-candidate repository AutoReview against the stated base completed scoped-clean at P0-P2, followed by a fresh scoped P0-P2 review of the four-file ownership relocation. Both final source verifications passed. These reviews found no actionable defect in their selected Git diffs and supplied canonical dependency evidence; they do not claim an unrestricted whole-repository review.
  • The complete fresh 40-path canonical check:changed run passed on this exact head (1672.23 seconds): all 42 selected stages, including current line/max-line/SAFETY/SQLite/mock/timeout ratchets, format and docs, plugin boundaries, core/extension production and test types, all 27 core test graphs and four root test graphs, three dead-export scans (zero entries), whole core/extension/script/root lint, native schema and database/media/sidecar/cycle/auth guards. Runtime import cycles are zero. Ten untouched-main max-line warnings and the existing temp-creation cleanup warning are nonfatal. The initial draft failed the new line-cap growth gate; the coherent helper relocation resolved it and this complete final run passed. Head, source diff identity and lock SHA/mtime/ctime remained unchanged.
  • Fresh exact-head custody/claim/fallback runtime proof passed four files and 47 tests (50.19 seconds), including the actual full-context early-dispatch positive/negative cases, invalid-answer custody and production-host fingerprint/profile admission. These tests overlap the broader suite and are not added to its count.
  • Protocol registry/generation, Swift/Kotlin contract and determinism, and protocol-since checks passed on this exact head (2.17 seconds), using supported PROTOCOL_SINCE_BASE_SHA pinned to the stated base. Tracked source and lock identity remained unchanged; the current-main deletion of the old tracked Swift generated file is preserved.
  • Actual public-plugin acceptance passed on this exact head: one test in 22.096 seconds (888.33 seconds overall, including the complete cold prerequisite build). The production Gateway and an external plugin using api.runtime.channel.inbound.dispatch adopted the plain-text answer into the original pending ask_user turn, produced its originating final reply, and created zero successor agent turns. /stop stayed on core dispatch and delivered the abort reply without becoming a question answer. The fixture used isolated mock provider/state, not a real external tenant. Both fresh canonical build/runtime stamps identify this head with clean inputs; completed compiler-generation verification, tracked source and lock SHA/mtime/ctime checks passed without a freshness override.

Candidate-specific CI and review handoff

The refreshed head fd9cd3f94d14b703315d4a635d96026779430237 completed CI run 37214288661 with 92 successful jobs, 15 skipped jobs and three failed jobs. The actual tested merge was f4182df89ad4f252c01e6416f296228c07c7d060 (tree 0f131e30d0f267206492342349dfedf4b89a7d3e), with parents main 704a21dd91ef8f645bfea0fd24ec4652515b45b9 and this candidate. All platform tails completed; the aggregate CI gate mirrors the two actual failed jobs.

UI E2E shard 1/4 failed the two 1280px/390px model-picker cases at chat-composer-catalog.e2e.test.ts:153: aria-busy was false instead of true while a mock Gateway chat.send response was deferred. The failing test, suite, mock Gateway/controls, picker and cleanup blobs match the actual main parent and are outside this PR. A separate PR's CI on the same main parent shows the same assertion. The runtime cause is unconfirmed; this source comparison does not waive red CI.

The changed Node aggregate failed only Gateway SIGKILL/restart recovery, waiting 120 seconds at gateway-kill-restart-send.e2e.test.ts:123 for a restart dispatch marker and transcript advance. The final bus contained only the initial inbound message; cold route refusal was followed by background database recovery, without the expected restart dispatch marker. Fourteen selected unowned test/recovery/startup/turn/mock-input owners match current main and the retained historical Linux control/candidate pair. The owned mock assistant tool-result adapter matches its historical candidate blob. The earlier Linux pair supplies a similar failure signature, but current main 704a21dd... was not replayed, and no single cause or baseline waiver is claimed. No unrelated recovery code was changed.

The same actual CI aggregate passed public-plugin ask_user acceptance in 13.218 seconds: the answer was adopted before resolution, resumed the originating run, produced its final reply and created zero successor turns; /stop remained on core dispatch and delivered its abort reply. This is fresh evidence for the tested merge above.

ClawSweeper revision 33 reviewed the exact refreshed head: no introduced actionable code/security findings and sufficient terminal production-path proof (5/6). It verified the current-main prepareSource plus PR beforeConsume composition. Its automatic before-merge migration checkbox remains despite the same report explicitly resolving that warning and confirming no stored-data contract change. This contradiction and the red CI landing decision remain for maintainers; no bot-managed labels or migration behavior were altered.

Regression and compatibility details

The real queued source regression failed before repair when the prepared route was dropped and when a reassigned binding still reached question resolution. Current tests prove matching routes survive handoff; local reassignment and final Gateway QUESTION_SOURCE_BINDING_CHANGED refuse without replay, successor admission, or follow-up queue entries. The paired early-dispatch regression uses an actual legacy function dispatcher that reports Unsupported before registration/I/O: ordinary dispatch was blocked before repair and now proceeds without consuming the pending question; an actual refusal still stops admission.

Gateway proof also covers an ignored cron binding, a separate SQLite writer deleting an active binding, refusal leaving the question pending, and an authorized replacement retry resolving that question. The external-plugin fixture continues to use api.runtime.channel.inbound.buildContext(...) and dispatch(...); it adds no second public question API.

The previous published head 94997b9540d7dfe0a3e0956e603e4b5b7744f51b had full CI run 37202689210, which completed with 91 successful jobs, 15 skipped jobs and two failed jobs. It tested merge 5d3a6e61825c425f993581db500b83578c7e7853 (tree 3dfddc6bb8ebd7512a954fd4a8d1b9aa6c54652f), combining that previous head with main 85124fe108f74a7cfc52d4c5a0cf5fc589583fd6. The earlier fallback integration failure is repaired and its compact shards passed. The same CI aggregate also passed public-plugin ask_user acceptance in 13.472 seconds. The only actual test failure is Gateway SIGKILL/restart recovery, waiting 120 seconds at gateway-kill-restart-send.e2e.test.ts:123; the other failed job is its CI-gate mirror.

A bounded, executed Linux comparison built fresh qaRuntime separately for that actual main parent and tested merge, using frozen dependencies, Node 24.19.0, pnpm 12.5.1 and the canonical singleton shard runner with two-CPU process affinity. Both failed at the same unchanged 120-second assertion (main: 264.54 seconds overall; merge: 270.93 seconds). Both retained only an inbound bus message and showed cold database refusal, later background admission recovery, no startup-orphan/recovery dispatch marker and skipped:duplicate. Source and lock bytes/mtime/ctime stayed unchanged, both canonical build stamps passed, and owned child processes were joined. This supports a shared baseline failure for this test, rather than a PR-only failure; it does not establish a single root cause or waive red CI. The host had approximately 24 GiB RAM versus CI's 8 GiB; these two singleton runs used fresh compiled generations instead of CI's persistent caches and did not replay the predecessor. Only the merge additionally logged a late heartbeat recovery-claim change; that variation is retained.

ClawSweeper revision 32 reviewed candidate 94997b9540d7dfe0a3e0956e603e4b5b7744f51b: no introduced actionable code or security findings, previous invalid-answer finding resolved, and terminal proof sufficient. Its remaining before-merge compatibility heuristic requires human confirmation; the same report recognizes no stored-format change. That previous head remained red pending recovery triage or a maintainer decision. Fresh CI and ClawSweeper must be matched to the refreshed candidate SHA above; these historical results are not transferred to it. No bot-managed labels were changed.

Per-file test cost

Measured unchanged head fd9cd3f94d14b703315d4a635d96026779430237 (tree a10e67a6911cc75d96e50c17a46e4ee69724d94f, base bb5656bf89e230bb3d6c9040b1e9b86df0306439), using native pnpm 12.5.1 and Node 26.7.0 on macOS. Each executable test file below was run separately, sequentially, once with pnpm test <file> --maxWorkers=1. All 12 commands passed. The diff contains 13 test/support modules, but src/agents/harness/gateway-question.test-support.ts is support-only and has no standalone test invocation.

Command wall is measured from process launch through canonical runner/worker completion, including setup, imports, cache validation and cleanup. Vitest duration is the separately reported invocation duration. CI times come from existing run 37214288661, whose actual tested merge is f4182df89ad4f252c01e6416f296228c07c7d060 with main parent 704a21dd91ef8f645bfea0fd24ec4652515b45b9; they are not local-command timings. The CI column sums emitted, rounded case timings, not whole-file, shard or command wall: it omits hooks/import/setup and any unreported time. Every displayed case count matches the corresponding local passed count; identical parameterized labels remain separate occurrences. If a reporter omits fast-case timings, such sums are incomplete observations. Compact shards do not separately emit standalone per-file CI command wall, so that value is unavailable rather than inferred.

Test file (pnpm test <file> --maxWorkers=1) Passed Local command wall (s) Vitest duration (s) CI emitted case timing sum (s; cases) CI job
packages/gateway-protocol/src/questions-validators.test.ts 8 2.959 1.52 0.032; 8 checks-node-changed-compact-large-22
src/agents/embedded-agent-runner/run/attempt-stream-prepare.question-authority.test.ts 23 33.935 23.41 7.661; 23 checks-node-changed-compact-large-8
src/agents/embedded-agent-runner/run/attempt-stream-prepare.test.ts 42 25.445 14.16 2.807; 42 checks-node-changed-compact-large-21
src/agents/embedded-agent-runner/run/attempt.queue-message.test.ts 17 15.191 11.54 0.147; 17 checks-node-changed-compact-large-8
src/agents/harness/gateway-question.test.ts 34 33.756 29.76 7.142; 34 checks-node-changed-compact-large-36
src/auto-reply/reply/agent-runner-steer-adoption.question-source.test.ts 3 20.422 15.32 0.011; 3 checks-node-changed-compact-large-18
src/auto-reply/reply/dispatch-from-config.question-custody.test.ts 16 22.997 12.92 2.151; 16 checks-node-changed-compact-small-9
src/auto-reply/reply/dispatch-from-config.question-fallback.test.ts 3 15.776 12.30 0.407; 3 checks-node-changed-compact-small-11-2
src/auto-reply/reply/reply-run-registry.question-claim.test.ts 16 15.174 11.92 0.747; 16 checks-node-changed-compact-small-10
src/config/sessions/session-entry-read.worker.test.ts 20 16.945 13.68 3.203; 20 checks-node-changed-compact-large-18
src/gateway/server-methods/question.source-binding.test.ts 2 15.087 11.74 2.846; 2 checks-node-changed-compact-large-6
test/e2e/qa-lab/runtime/ask-user-channel-adoption.e2e.test.ts 1 46.306 28.68 13.214; 1 checks-node-changed

The CI public-plugin QA additionally reports 13.218 seconds for the file, 13.214 seconds for its case, and 22.33 seconds for its singleton canonical shard. These scopes differ and are not summed.

These are measurements with existing compiler outputs and runtime assets retained, not cold-cache benchmarks. Canonical worker checks observed local cache hits and verified completed generations before returning. Each command still pays its own cache/current-input verification and project startup. The public E2E entrypoint additionally ran its required tsdown.ai.config.ts package preparation once (9.6 seconds); that overhead is included in its measured command wall. No cache was cleared, no freshness override was supplied, and no complete runtime build or full gate was repeated. The existing exact-head cold-build public-plugin proof remains separate evidence.

The seconds-long owner tests protect distinct contracts: the attempt/question suites combine real run/source authority, worker-backed pending-input/transcript settlement and V2 Gateway-client transport refusal across awaited preparation; a stubbed resolver cannot establish that custody commits only after source persistence or that the transport emits zero final frames after revocation. The session-reader suite uses native SQLite readers/writers, aliases, incognito state and cleanup to prove currentness closes at the consumer boundary, including ordered and unordered callback composition. The source-binding suite exercises the real question server method and a separate SQLite writer to prove final commitment refuses foreign deletion while the question stays pending; this is already narrower than a full Gateway boot. Cheaper dispatch/registry tests cover branching, unsupported fallthrough, profile admission and parked-queue non-replay. The public-plugin E2E composition proves the production Gateway plus public inbound SDK adopts the answer before admitting a successor and preserves /stop; helper-only tests cannot show the originating final reply and zero successor turns. No real external tenant delivery is claimed.

Across all commands, HEAD, tree, tracked source bytes and timestamps, and lock bytes/mtime/ctime remained unchanged. Canonical workers returned through their owned completion/verification path; the final process inventory found no remaining Node/pnpm/OpenClaw process whose arguments reference this task clone. The canonical build/runtime stamp fields still match the prior exact-head proof. This cost supplement does not change the recorded red CI or ClawSweeper revision 33 disposition.

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M labels Sep 13, 2026
@ericcaiwx-star
ericcaiwx-star marked this pull request as ready for review September 13, 2026 07:25
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR lets eligible channel replies settle pending agent questions before admitting another turn while preserving command priority and answer custody.

Example: An external channel dispatches “没事” while its agent is waiting on ask_user.

  • Before: The reply can enter ordinary turn admission instead of resolving the waiting question.
  • After: The original task receives the answer and finishes without a successor agent turn.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful behavior with production-entry evidence and no identified introduced defect; conflicts and unresolved checks remain landing blockers.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Published exact-head production-Gateway evidence exercises the public plugin dispatcher, successful answer adoption, originating final delivery, zero successor turns, and preserved /stop routing; blocked artifact-host access does not invalidate that recorded proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A plain-text answer submitted through a channel's public dispatcher can fail to resume the task waiting for that answer.
Reason: Restoring the documented channel-answer behavior has clear value and retains the existing public inbound API.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this PR contains meaningful, proven channel-answer handling that has not been established as superseded. No introduced actionable defect was found, but confirmed conflicts and unresolved CI attribution prevent landing.

Priority: P1
Reviewed head: fd9cd3f94d14b703315d4a635d96026779430237

Before merge

  • Complete next step - Contributor: resolve the confirmed conflicts against main’s session-controller and question-authority owners, preserving their current contracts, then validate the affected integrated paths.

Findings

None.

Agent review details

How this fits together

Channel plugins submit inbound messages to core dispatch, which selects commands, pending-question answers, or ordinary turns; the question owner validates authority and commits resolution through the Gateway.

flowchart TD
A[Channel plugin] --> B[Core inbound dispatch]
B --> C[Control commands]
B --> D[Active execution owner]
D --> E[Pending question owner]
E --> F[Gateway authorization and resolution]
B --> G[Ordinary turn admission]
Loading

Technical review

Best possible solution:

Integrate the still-needed early-answer behavior with main’s session controller and asynchronous authority readers under one input-custody owner.

Do we have a high-confidence way to reproduce the issue?

The pinned base places reply-operation admission before question handling, and the published candidate run exercises the repaired public dispatcher; no fresh reproduction against main’s later controller architecture was executed.

Is this the best way to solve the issue?

The pinned implementation preserves existing execution, question, and binding owners, but integration must retain main’s newer controller custody and asynchronous policy preparation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d1cdb8b69707.

Provenance checked

  • Question creator authority and answer custody keeps the original intent (e3ce08c: Talk and cross-runtime question handling bind plain-text claims to the question creator's policy and preserve uncertain-answer custody.)
  • Question-response ordering keeps the original intent (87f0a0a: Allow processed question responses to settle while the asking turn remains open, while ordinary replies retain ordering.)
  • Incomplete-answer correction keeps the original intent (0bb2b6d: Keep incomplete multi-question answers pending and deliver a visible correction through the reply boundary.)
  • Worker-reader preparation keeps the original intent (00daeeb: Prepare physical-source facts asynchronously and validate current authority when consuming worker results.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e3ce08c adds src/agents/harness/gateway-question.ts:241 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e3ce08cd5ec1; files: src/agents/harness/gateway-question.ts)
  • Ayaan Zaidi: Raw commit 87f0a0a adds src/agents/harness/gateway-question.ts:232 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 87f0a0ae984b; files: src/agents/harness/gateway-question.ts)

PR surface

Source +692, Tests +3021, Docs +91. Total +3804 across 40 files. Added test files: 6.

View PR surface stats
Area Files Added Removed Net
Source 24 818 126 +692
Tests 14 3174 153 +3021
Docs 2 92 1 +91
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 40 4084 280 +3804

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Protocol request addition 1 optional field; 1–8 routes sourceBindingRoutes extends existing question.resolve answer and cancellation requests without adding configuration or persisted fields.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The affected channel workflow can leave a waiting agent task unresolved when an eligible human answer enters ordinary admission.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (35 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-26T09:01:14.879Z sha f84fd6cd72cde64c5e369400535728e653603bc8 :: blocked before merge. :: none
  • reviewed 2026-09-26T09:55:45.422Z sha 9e3c18ac86a9b44ad1b0584ac293b51b560d3300 :: blocked before merge. :: none
  • reviewed 2026-10-04T11:38:33.212Z sha 955d771526d25c971a9ee18eb325c29dad96f8ae :: blocked before merge. :: [P2] [P2] Preserve the invalid-answer notice in early question claims
  • reviewed 2026-10-04T12:42:36.366Z sha 94997b9540d7dfe0a3e0956e603e4b5b7744f51b :: blocked before merge. :: none
  • reviewed 2026-10-04T13:26:11.920Z sha 94997b9540d7dfe0a3e0956e603e4b5b7744f51b :: blocked before merge. :: none
  • reviewed 2026-10-04T15:53:06.636Z sha fd9cd3f :: blocked before merge. :: none
  • reviewed 2026-10-04T16:13:44.936Z sha fd9cd3f :: blocked before merge. :: none
  • reviewed 2026-10-04T16:50:37.500Z sha fd9cd3f :: blocked before merge. :: none

Reviewed November 15, 2026, 2:05 AM ET / 07:05 UTC (Revision 36).

@ericcaiwx-star
ericcaiwx-star force-pushed the codex/fix-plugin-ask-user-inbound branch 2 times, most recently from b820a50 to eb92c3e Compare September 13, 2026 08:29
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed agents Agent runtime and tooling size: M labels Sep 13, 2026
@ericcaiwx-star ericcaiwx-star changed the title fix(plugin-sdk): let channel replies answer blocked ask_user prompts docs(plugin-sdk): prevent ask_user reply starvation in channel queues Sep 13, 2026
@ericcaiwx-star
ericcaiwx-star force-pushed the codex/fix-plugin-ask-user-inbound branch from eb92c3e to eb20c20 Compare September 13, 2026 08:30
@ericcaiwx-star

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rewritten at eb20c20fcec4d42c0bba4e86388e44507eac7f5e to address both P1 findings: the parallel pre-queue claim API is removed, the docs now use the shipped turnAdoptionLifecycle, and all input stays on normal core dispatch so control commands retain their routing. The new dispatch-boundary regression uses the real local WebSocket question Gateway/QuestionManager; the waiting question becomes answered and the agent-turn count remains one. Exact-head check-changed and 62 focused tests pass; details are in the updated PR body.

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Sep 13, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: L and removed size: S labels Sep 13, 2026
@ericcaiwx-star ericcaiwx-star changed the title docs(plugin-sdk): prevent ask_user reply starvation in channel queues fix(channels): claim ask_user replies before turn admission Sep 13, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@ericcaiwx-star

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact head: b558651a45576b08e33eaa7a41d0dbee45a8ce6a.

This revision removes the process-local 1,024-entry binding publication/LRU and moves the final source-binding check to the Gateway question.resolve commit owner. The Gateway retains the prepared question-session authorization read, reads the shared adapter/durable SQLite binding, and enters the synchronous manager commit without another await.

Separate-writer proof: a second node:sqlite connection deletes the durable binding while a real session-scoped question is pending. The Gateway returns FORBIDDEN / QUESTION_SOURCE_BINDING_CHANGED, the question stays pending, and one retry after restoring the authorized binding moves it to answered. Red-before-fix on this exact patch (temporarily removing only the Gateway guard) incorrectly returned ok=true and status=answered; restoring the guard made the same test pass.

Exact-head validation: 78 focused tests passed; tsgo:core, package tests, and source tests passed; the changed-file gate against the previously reviewed head a370b44a335 exited 0. The PR body now contains the full final-effect trace and updated production V2 matrix.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@ericcaiwx-star

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact head: 4d89b9c17d0c7630b717452a7174563ed344ac88.

The prior review found no actionable or security findings and marked proof sufficient. This follow-up is CI-only: refresh the generated Swift model for the optional question.resolve field, remove the test-only production export, make the test Gateway call the production source-binding guard, and resolve the branch-owned lint findings without changing question-resolution behavior.

Final-head evidence: 86/86 focused regressions passed; the minimized guard/transport subset passed 24/24; pnpm deadcode:full passed with zero production unused exports; the full protocol check passed against upstream base ead3b2ee776c, including Swift/Kotlin generation and protocol-since; targeted lint passed on every touched source/test file. The PR body also documents that this is an optional wire-request field, not a persisted data-model or migration change.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@ericcaiwx-star

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased exact head: f6c54f83ba402441c2493096808237d76c547ce3 on upstream ace659ebb95033a170e1603f32baf20654366165.

The rebase had one conflict in the CI-only follow-up because current main now exports the same run-projection merge helper; the upstream implementation was kept. Rebased-head validation passed: 88/88 focused regressions, full protocol check against the exact upstream base, pnpm deadcode:full, and targeted lint on every touched CI-repair file. The PR body contains the updated exact-head evidence and wire-compatibility note.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@ericcaiwx-star

Copy link
Copy Markdown
Contributor Author

Maintainer handoff for exact head 1d3500f0b541e03af345be9b8a20b2e56c75c81e.

ClawSweeper reports no actionable or security findings, proof is sufficient, and the PR is labeled status: 👀 ready for maintainer look. The final source-binding regressions passed in the existing successful Gateway shard checks-node-changed-compact-large-39: ignored-cron acceptance in 2.507s and separate-writer revocation in 2.030s.

The aggregate CI run is red for two non-Gateway rows:

  • checks-node-changed-compact-large-34 failed in untouched media tests with broad raster/fixture result contamination.
  • checks-node-changed-2 reached the 60-minute job limit while the QA E2E was still performing repeated tsdown-build invocations (9/11 completed); it produced no ask_user assertion failure before cancellation.

The author account cannot rerun upstream Actions jobs (Must have admin rights to Repository). A maintainer rerun of those failed/cancelled jobs is needed to clear the aggregate CI gate. The PR body contains the exact-head compatibility proof, local wall times, and CI test timings.

@ericcaiwx-star

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Refreshed exact head fd9cd3f94d14b703315d4a635d96026779430237; current-main conflict repaired with owner boundaries preserved. The PR body records fresh canonical gates, runtime proof, measured costs, and remaining human decisions. Previous CI/review results are historical.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

This branch has not been deployed

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

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation extensions: qa-lab gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant