Repository navigation
fix: accept follow-up chat messages after the previous run finishes - #201790
Conversation
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 2a0a4600-3087-4a33-9a0f-aca8e454446c
|
🦞👀 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. |
…sks (#201695) ## What Problem This Solves A plugin that adds a composer feature (rewrite, translate, shorten, fill a template) could only add a full-width text button above the composer and write over the user's draft with `setDraft`. To show progress or offer a result, each plugin would have to draw its own card, copy the host's card styles, track its running state, and handle Cancel, chat switches, undo and screen readers itself. ## User Impact Composer features from plugins can look and behave like the composer's own controls: - **Compact actions:** a composer action with a host `icon` renders as a toolbar button after the attachment menu, with its label as tooltip and accessible name. Without an icon, or beside a replacement composer, it keeps the text button above the composer. - **Composer tasks:** `composer.startTask({ title })` shows one card above the input that changes in place, so the composer never moves: - **Working:** title, elapsed clock, **Cancel**, and the steps the plugin reports with `task.update({ steps, summary })`. The invoking action shows pressed; clicking it again cancels. Cancel, a chat switch, or the action retiring aborts `task.signal`. - **Proposal:** `task.propose(text, { title })` offers the text with **Use** (Tab) and **Dismiss** (Escape), like composer predictions. Nothing changes and nothing is sent until the user accepts. Use replaces the draft as one editor history step; ⌘Z or the receipt's **Undo** restores the previous draft, mentions included. - **Failure:** `task.fail(message)` shows the message with **Dismiss** and **Try again** (runs the action again). - `composer.propose(text, { title })` offers a draft without a working phase. `setDraft`, composer actions without an icon, and `session-header` accessories are unchanged. ## Why This Change Was Made Working backwards from the final UI of a real plugin (`@obviyus/better-prompt`, not bundled) showed that lower-level seams (a composer accessory slot plus a separate proposal) push every plugin into duplicating the same card, layout coordination and lifecycle. The host now owns that once: - **One owner per pane:** `createComposerTasks` (`ui/src/lib/chat/composer-tasks.runtime.ts`) owns the task card, its outcome, the accept/undo receipt, and whether the pane can show tasks (a mounted card; a replacement composer has none, so `startTask` throws and `propose` rejects there). It loads with the first plugin composer action, so idle chats never fetch it; a failed fetch retries on the next action, and concurrent first loads share one owner. - **Edge cases the owner settles:** a newer task aborts the previous one at once; an action that rejects fails its own latest task, and a rejection after the task settled reaches the inline alert (an Undo receipt stays); a failure never takes over another action's card; Use and Undo wait while dictation or a pending goal locks the editor; the receipt retires when its editor unmounts. - **Host patterns and tokens:** the toolbar button uses `agent-chat__input-btn`; the card uses the attached-card tokens of the task-progress card; proposals follow the prediction's Tab/Escape keys and live region; motion uses host tokens and stops under reduced motion. - **Undo through the editor:** the editor bridge gains `replaceAll` (one isolated history step) and `undo`, so Undo restores mention identities; any later draft change retires the receipt, so Undo never steps over newer text. - **Contributions renderer:** composer actions run through one shared path for text and icon buttons; pressed state comes from the pane's running task. Long proposal titles truncate so Use, Dismiss and Undo stay inside the card on mobile. - **Budget:** chat boot JS grows +849 B gzip (the toolbar runner, keys and wiring; the card and owner load lazily). The limit records that measurement plus 64 B, approved by Ayaan. Total CSS grows +56 B, within the allowed build variance. ## Evidence - **New e2e** `ui/src/e2e/native-plugin-composer.e2e.test.ts` (9, inline fixture plugin): working card in `agent-chat__composer-float` with steps, pressed icon cancels and aborts the task signal; failure shows in place and Try again reruns the action; a failed toolbar action reports without resizing the composer; a replaced task aborts at once and the latest one fails on rejection; a rejection after settling reports without dropping the Undo receipt; a late failure leaves another action's task alone; Tab accepts as one edit and Undo restores the draft, with zero `chat.send`; the receipt retires after an external `setDraft` and stays retired; Escape and a chat switch dismiss. - **Existing e2e** `native-plugin-ui.e2e.test.ts` (6) green. - **Unit:** `composer-tasks.runtime` (proposal and Undo wait while the editor is locked), `control-ui-contributions` (13, including icon actions above a replacement composer), `chat-pane-lifecycle`. - **A real plugin on this API**, against mocked Gateway traffic and the real built bundle: zero `chat.send`, text typed during the run kept, Cancel restores idle, layout shift 0 with no composer resize from click to proposal; light, dark, reduced-motion and mobile frames. Plus a real run with a real model on a source Gateway from this branch (screenshots in the PR comments). - `tsgo:core`, `tsgo:ui`, `tsgo:core:test`, oxlint, `check:control-ui-controllers`, `ui:i18n:verify`. New strings are English; the locale refresh workflow translates after merge. **SDK impact.** Additive: optional `icon` on `ControlUiAction`; `startTask` and `propose` on the composer handle, with `ControlUiComposerTask`, `ControlUiComposerTaskStep`, `ControlUiDraftProposal`, `ControlUiDraftProposalOutcome` types. Static usage (ClawHub 2,675 plugins, bundled 187): `ControlUiAction` 0 consumers; `ControlUiAccessory` 1 (Workboard, `session-header`, unchanged). Coverage gaps: ClawHub 423 partial, bundled 11 partial and 6 failed. Co-authored-by: Ayaan Zaidi <[email protected]>
#201697) Problem: an agent run's Gateway requests re-checked the run's authority many times while one request ran: before the queue, at handler start, inside cron, secrets, sessions.create, message, themes, ui.command and MCP event handlers, and on every response. When the run's authority closed partway through, a started request was refused with "agent runtime authority is no longer active". On WebSocket the client connection was also closed (4001), and a committed effect could be reported as a failure. Fix: run authority is checked once, in the shared pre-dispatch owner `authorizeGatewayRequestPreDispatch`, which WebSocket and in-process requests both pass through. A request from a run that already ended is refused with a message that names the next step. Session authorization inside an already admitted request (`withSessionTurnAuthority`) skips that check. The run guard helpers, the dispatch and response-time re-checks, and the 4001 close are deleted. The message-action turn-capability check and the caller-only message-action fences stay as on base, without the run check; they are separate check-once chains. Gateway computer cleanup after a run ends now has one owner: the Gateway retires the run's desktop execution on run closure, and the tool no longer sends a second close with the ended run's identity. Caller, participant, session-mutation and client-authority assertions are unchanged. User impact: a Gateway request that an agent run has started finishes and returns its real result even if the run's authority closes meanwhile. A new request from a closed run is refused at start. Proof: focused tests for every touched handler and consumer, including the channel read-authority suites; new regressions (a started request keeps its response; an ended run is refused at start but not inside an admitted request); tsgo and test types; the lifetime-check, line-cap, session-identity and mock-export ratchets; a local Gateway run where a subagent's Code Mode crash is followed by a successful Gateway-backed tool call; ocx build --dts plus a packed install smoke on the merged head. Co-authored-by: Ayaan Zaidi <[email protected]>
|
Codex review: needs maintainer review before merge. What this changesThis PR selects implicit input lifecycle expectations inside the shared session actor transaction for durable and memory sessions. Example: Send “Follow up after the completed reply.” to agent:main:first-turn-binding while the preceding run finishes during input preparation.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a current session-admission race, and the focused shared-owner review found no actionable code defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherChat recorders prepare transcript input and submit it to the session actor, whose durable or memory backend serializes admission, persistence, and receipt publication. flowchart TD
A[Chat input] --> B[Transcript recorder]
B --> C[Input preparation]
C --> D[Shared actor phase]
D --> E[Durable worker]
D --> F[Memory owner]
E --> G[Committed receipt]
F --> G
Technical reviewBest possible solution: Keep implicit lifecycle selection in the existing shared actor transaction while preserving explicit recovery guards and terminal custody refusals. Do we have a high-confidence way to reproduce the issue? Current-main source captures implicit lifecycle before admission, allowing preceding completion to invalidate it; the added durable and memory cases force that ordering, but no tests were executed during this read-only review. Is this the best way to solve the issue? The shared phase is the appropriate owner: it fixes both backends, removes three preparation-time copies, and retains identity, source, explicit lifecycle, and custody checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7d6f2b92906d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. Preflight sourceSource 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
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 19, 2026, 1:42 PM ET / 18:42 UTC (Revision 3). |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: preserve the workspace in Talk approval tests Keep synthetic workspace content independent of the effect marker and fail fast when a direct consult settles before model start. Co-authored-by: RomneyDa <[email protected]> * fix: preserve the workspace in Talk approval tests OpenClaw-Publication: 2302aa5e-6197-429a-8b48-133acdbca953 --------- Co-authored-by: RomneyDa <[email protected]>
* fix: keep plugin details responsive while inventory loads Co-authored-by: RomneyDa <[email protected]> * fix: keep plugin details responsive while inventory loads OpenClaw-Publication: 8a35f8df-a36c-418f-850e-4dcdce53e159 --------- Co-authored-by: RomneyDa <[email protected]>
* fix(release): bound desktop APT timeout waiver to receipt Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> * fix(release): declare desktop receipt reader hook Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> * fix(release): simplify candidate shard waivers Replace desktop receipt infrastructure with three candidate-scoped whole-shard waivers using the existing policy owner. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]> --------- Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Accept nonpassing qualification only for the explicitly authorized beta version and frozen candidate. Preserve prepared artifact integrity and publication authority. Co-authored-by: RomneyDa <[email protected]>
…npm install (#201735) * fix(update): keep the pnpm launcher and Gateway working across a pnpm package update * fix(update): quote repaired pnpm launchers safely and report repairs Doctor cannot make * fix(update): rewrite pnpm launcher words by value so every shell quoting form relocates * fix(update): verify pnpm launchers in one pass and skip non-regular PATH entries - Resolve pnpm shims from the physical bin directory whenever the shim defines basedir_abs, including the braced form the rewriter emits. - Keep the forward-slash pass for absolute paths in extensionless shims on Windows. - verifyRuntimeLauncher reports an unknown format from its single inspection; the swap turns it into a warning and fails a missing target. - The launcher repair scan skips FIFOs and other special files instead of blocking Doctor or Gateway startup on them. - Docs: automatic launcher repair is macOS and Linux only. * fix(update): touch only this installation's pnpm launchers and prove ownership on the bytes repaired - The pre-stop guard refuses only launchers the swap publishes; another global package's shim in the staged bin directory no longer fails the OpenClaw update. - A shim resolves physically only when it assigns basedir_abs; a path that merely contains the name no longer switches an older lexical shim to the physical bin directory. - Launcher repair checks cmd-shim-target ownership on the same read it relocates, and leaves the launcher alone if it changed before the rename. - Doctor, Gateway and docs recovery commands use `pnpm add -g --allow-build=openclaw`. * fix(update): repair a home-level pnpm launcher in place and consolidate launcher tests - A launcher rewritten in place (Doctor and Gateway repair) does not move with its directory, so the stage relocation now applies when the stage sits inside that directory, as with pnpm's home-level shim. The updater relocates between different directories and is unchanged. - Fold the apostrophe-in-stage finalize case into the quoted pnpm 12 layout, the FIFO case into the rewrite cases, the verification cases into one table and the service revalidation cases into one table. Drop the "recorded target missing" refusal: the ownership check now covers it the same way as "another installation". - Record the remaining 21 regression-test lines over the allowance. * fix(update): break the launcher-names import cycle and name the recovery route on refusal - Move resolvePackageUpdateLauncherNames into the leaf module package-update-launcher-names.ts so the native stage no longer imports package-update-filesystem (madge cycle through the swap contract), and list it in the update-restart swap fixture and PR wrapper inventory. - Relocate absolute paths with a replacement callback, so `$'` and similar in a live path stay literal. - The pre-stop refusal names the direct pnpm reinstall, the Gateway reinstall and restart, and openclaw triage.
…01791) * fix: isolate PR provisioning startup state Bind startup diagnostics to repository-owned state and keep private test ancestors secure under group-writable umasks. Co-authored-by: RomneyDa <[email protected]> * fix: keep PR provisioning startup logs out of operator home state OpenClaw-Publication: ad46ae42-0342-4156-9997-6bb100fca796 --------- Co-authored-by: RomneyDa <[email protected]>
* fix: keep empty chats free of message-loading placeholders Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: b4bdcb2a-54d1-4b38-935a-008bd0848940 * Publish openclaw/kind-langoustine-3 Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 02c4a33d-a944-438a-801f-796e7f93da9c * Publish openclaw/kind-langoustine-3 Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 279e5bca-e2a3-4791-b3f4-66df012053c2 * Publish openclaw/kind-langoustine-3 Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 391adf29-289d-4d96-b87a-dd9f552e1997 * Publish openclaw/kind-langoustine-3 Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: cc1bc785-00a4-49fa-98d7-b0ec77584f32 * Publish openclaw/kind-langoustine-3 Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 7f342502-44c9-4384-b03a-fed447cbe042 * Publish openclaw/kind-langoustine-3 Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 485de1cd-61b6-40a8-81d5-1225898152b2 * Publish openclaw/kind-langoustine-3 Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 5571a277-b4b5-480a-b58e-f9075beba162 --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: daniel-lxs <[email protected]>
* fix(release): acquire canonical beta publication evidence Co-authored-by: RomneyDa <[email protected]> * fix(release): acquire canonical beta publication evidence OpenClaw-Publication: f2369371-1978-495b-b415-4c6366e62c94 --------- Co-authored-by: RomneyDa <[email protected]>
* fix(pr): stop spilling captured review evidence to disk * test(pr): reuse the validator fixture for no-spill regression
|
|
@clawsweeper re-review Please review head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review The previous generation was superseded by my proof-section update. The description is now frozen for head |
|
🦞👀 Re-review progress:
|
|
Maintainer proof disposition for |
|
Merged via squash.
|
…penclaw#201790) Resolve ordinary follow-up input lifecycle state inside the shared session actor owner, after queued preparation, while preserving explicit lifecycle guards and pending-input custody. Remove stale preparation snapshots and duplicate admission wrappers. Cover memory and durable actor paths, queued custody loss, and real Gateway stop/resume plus follow-up after normal completion. Exact-head CI passed, including 51 focused tests. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
…201790) Resolve ordinary follow-up input lifecycle state inside the shared session actor owner, after queued preparation, while preserving explicit lifecycle guards and pending-input custody. Remove stale preparation snapshots and duplicate admission wrappers. Cover memory and durable actor paths, queued custody loss, and real Gateway stop/resume plus follow-up after normal completion. Exact-head CI passed, including 51 focused tests. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Vincent Koc <[email protected]> (cherry picked from commit f7235a8) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit fe02b24a6b500febb9071863fadfa5ee7ea650d6) (cherry picked from commit db8cb4c5cce6e37d41f48421610527a6936c2e82)
…201790) Baseline adaptation: select implicit lifecycle in the serialized owner phase for memory and durable input, preserving explicit guards and source and pending-input custody. (cherry picked from commit f7235a8) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit b129b008036a49615e025a05741ccf72aed3360a)
What Problem This Solves
A follow-up message can be rejected when the previous run finishes between input preparation and admission. Preparation retained the old lifecycle, and the first repair refreshed it only on the durable backend; in-memory sessions still had the same race.
User Impact
Follow-ups use the current session lifecycle on both durable and in-memory sessions. Explicit caller guards, restart recovery, queued-input ownership, and released-actor refusals remain strict. No configuration, schema, permission, or migration change is required.
Why This Change Was Made
Select implicit lifecycle state inside the shared actor transaction, where both backends own ordering. Remove the three preparation-time lifecycle copies and the redundant input snapshot wrapper. A direct admission check preserves the existing typed custody refusal if the actor closes during preparation, so the failure cannot release accepted input to another fallback.
This extends RomneyDa's original fix and regression in this PR, preserving the contributor commits and credit. The final change removes 27 production lines; tests are counted separately. The Gateway regression now covers stop, resume, then a follow-up after normal completion through a real Gateway and agent with a local HTTP provider.
Evidence
b63d1954ef06a192672a905687d0ac564c59d7d3; frozen integration base:cd2ae19272a3ee7be456385fa7efc56d6e2109a6.git diff --checkpassed on the changed files.d87755b1e5399dbad2654fc4f4186facffbc4e5a, P0–P3, with no actionable findings. The subsequent two-test fixture narrowing has its own independent source review; production is unchanged. The reviewer checked full shared-phase and backend context, including explicit guards, empty completion, custody classification, and receipts. Runtime proof is separate.b63d1954ef06a192672a905687d0ac564c59d7d3: memory (9 tests), input concurrency (12), source custody (19), and resident sessions (10) passed. See memory, concurrency, and custody/resident. All production and test typecheck jobs also passed, including the previously failing shard.{"verdict": "pass", "head": "b63d1954ef06a192672a905687d0ac564c59d7d3", "test": "src/gateway/server.chat-first-turn-binding.test.ts", "runtime": "Bun", "gateway": "real", "agent": "real", "provider": "local HTTP fixture", "scenarios": ["stop", "resume", "completed-turn follow-up"], "runId": 44584535707, "jobId": 135775322986}expectDefinedhelper and pass the same initial entry to the recorder and explicit lifecycle guard.The previous local autoreview's concern about empty memory completion was checked against the full phase owner: empty completion explicitly applies its terminal patch before installing state. The final review includes that source and has no findings.