Skip to content

feat(ui): show optional-answer delivery and retry state - #154486

Merged
steipete merged 12 commits into
mainfrom
feat/question-delivery-state-20260921
Sep 21, 2026
Merged

steipete merged 12 commits into
mainfrom
feat/question-delivery-state-20260921

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Related: #154395

Continues Vincent (@vincentkoc)'s delivery-state implementation and preserves its commit ancestry. Saved-answer recovery from #154312, contributed by @jb510, is already on main.

What Problem This Solves

Fixes optional questions appearing answered after delivery fails, reopening a second Submit form after reconnect, or losing their answer after recovery when free text resembles another question's heading.

User Impact

Questions show queued, sending, failed, uncertain, and confirmed delivery, with accessible status announcements. Retry uses the existing outbox answer; successful explicit Discard restores its draft in subscribed panes. Ambiguous free text remains visible in queued and saved summaries and survives reload/Discard. Draft persistence, dismissal, Undo, and authentication-scope retirement remain intact.

Browser-storage failure still falls back to volatile state that is not reload-durable. Two unexplained browser timeouts remain recorded below; neither is claimed fixed.

Why This Change Was Made

The existing outbox owns delivery and retry. A question retains its association with that row across reconnect, preventing a second admission. Uncertain retry preserves the original transport identity; definite rejection uses the existing queue retry policy. Only canonical saved history confirms Answer sent—an acknowledgement retiring the outbox row is insufficient.

Successful explicit Discard records the existing completion/reopen boundary before notifying subscribed panes, so the restored answer does not immediately age out. Failed removal and automatic retirement do not reopen the form. When conservative parsing cannot separate an answer containing another question's heading, the draft owner preserves known answers and hydrates stored drafts without replacing newer edits or current admission. Summaries show the actual queued or saved text. A matching canonical replyToId confirms a saved answer independently of parsing; unlinked ambiguous text remains unresolved.

The final scope is 32 files against main ff26aaefcd6780f5d2781539d7b2888bff2ef608: question delivery/recovery and documentation, focused tests, distinct rail test coverage, three CLI fixture repairs, and two approval clock test files. There is no new sender, queue, storage owner, schema, or Gateway protocol. Legacy rows without a question association retain existing retry behavior. Main's split presentation/draft owners remain in place.

Main owns the overlapping production repairs: synchronous rail resize observation (41cd52e170f) and equal-clock permission projection (78a45d69). The alternate rail implementation and mock-clock workaround are retired. Main's shared approval publication/SQLite fixture repair (dbb402500e42) is adopted byte-for-byte; the final head has no net changes to that approval fixture. The separate clock-test repair below preserves both transaction-time and public-worker coverage without production changes.

Evidence

Current head: e9c8dedc393cea35ccbaece12b5f59877e65cc5e, committed and pushed with the merged #155111 owner repair. Local proof and required selected checks pass. Full review v8 plus a fresh clean review of the final public-clock regression resolve the only accepted P2; no actionable findings remain. Ready for PR preparation; new exact-head hosted CI is pending, not claimed green. The prior efa7f8b633bb head passed all local checks in 1,337.384s and had a clean ClawSweeper review, but its hosted CI failed seven approval tests while all 13 UI browser shards passed. The repair and original-order proof are recorded below.

The registered reconnect flow reproduced duplicate admission on main: the original unconfirmed row remained while a second Submit created another queue/send identity. This proves duplicate admission, not duplicate server delivery. The integrated flow retains one row and no second form; uncertain Retry preserves the original queue ID, payload, and idempotency key. Initial focused proof passed 226 tests across 11 files, including all 19 maintained mock-Gateway browser scenarios.

Later review-driven regressions establish the final recovery behavior:

  • Explicit Discard: the existing browser case fails before the boundary repair and passes afterward, including reload with the original selection (19.007s RED / 14.246s GREEN). All 19 browser siblings passed in 45.625s.
  • Ambiguous draft/queued summary: mounted and reloaded owner regressions fail before repair. Registered browser diagnostics preserve both answers through reload/Discard without another send (draft: 22.329s RED / 14.399s GREEN; summary: 17.906s / 14.953s). Owner cases also cover subsequently edited queued text.
  • Canonical confirmation after successful delivery: the registered flow rejects the first send, reloads, retries through normal mock persistence, and reloads again (27.985s RED / 16.250s GREEN). It verifies one saved user message with exact text and reply identity, an empty outbox, Answer sent, and no reopened form or extra send. No saved answer was manually injected. All 82 related owner tests pass in 5.742s.

Temporary browser diagnostics were removed after proof. The existing IndexedDB assertion moved to a sibling support module without another test file or browser startup; its storage/reconnect scenario passed in 13.565s.

Live QA below used the efa7f8b633bb build serving the task Gateway, with the browser build identity and all eight entry assets verified. Real native optional-question QA passed: two optional questions remained after the model ended its turn; a multiline answer containing a quoted heading and Unicode, plus the Detailed choice, survived reload. Submit created one user answer, displayed Answer sent, and the real model echoed the exact payload. A final reload preserved the read-only sent summary with no answer form. The rollout confirms one native question call and one user answer. Earlier tested model sessions lacked that native tool in their pinned model catalog; an already supported model completed this proof without configuration or runtime changes.

Additional shared-browser live QA passed file Save, stale-content conflict rejection and Reload, terminal execution with exit 0, reply context, session/file creation, and fork transcript inheritance with child-only output absent from the parent. These published-head observations supersede the earlier older-Gateway limitation; they remain proof for the unchanged UI paths, not a claim that the newly published head has been activated live. The automated browser regressions above remain maintained mock-Gateway evidence. Live follow-ups also passed optional-answer delivery while busy, controlled offline Submit/reload with exactly one full-text answer, and Dismiss/Undo/reload with the selection retained and zero sends. Attachment upload could not be exercised: the browser tool refused both artifact and workspace paths. That is a tool limitation, not an established product failure.

Visual proof

All captures are inspected synthetic fixtures, delivered in the originating chat and verified rendered on GitHub. The linked comments retain the additional before/after pairs:

Before reconnect: the original unconfirmed answer coexists with an enabled Submit form. After: the question reports unconfirmed delivery and offers Retry without admitting another answer.

Before reconnect reopens Submit beside the unconfirmed original answer

After reconnect retains the original answer and offers Retry without a second form

Measured costs, retained CI repairs, and integration proof

Changed-file measurements use pnpm test <file> --maxWorkers=1 whole-command wall time. Earlier integration measurements ran on a loaded host; values below do not imply a speedup or final-head CI completion.

Changed test file Command wall Measurement scope
chat-async-questions.e2e.test.ts 51.598s Earlier frozen integration, 19 cases
chat-question-actions.test.ts 7.094s Earlier delivery integration
chat-async-question.test.ts 4.819s Final canonical repair, 47 cases
chat-async-question-draft.test.ts 5.054s Retained draft repair, 28 cases
chat-view.async-questions.test.ts 3.499s Retained Discard repair, 7 cases
chat-view.plugin-questions.test.ts 6.929s Earlier delivery integration
chat-composer.test.ts 7.178s Earlier delivery integration
native-hook-relay-cli.test.ts 20.981s Retained repair, 27 cases; repaired case 6ms
preaction-agent-owner.test.ts 12.460s Retained parser isolation repair
preaction-output-mode.test.ts 11.460s Retained parser isolation repair
operator-approval-store.test.ts 26.275s Clock-test repair before mechanical lint correction
operator-approval-store.worker.test.ts 18.862s Final public-clock regression, 4 cases; new case 442ms

The 23 integrated rail unit cases took 8.882s command wall. The 31 delivery/rail/progress browser cases passed in 138.410s; all 19 selected checks for the distinct rail test coverage passed in 231.671s. The original equal-clock permission fixture passes 33 units in 3.172s and both browser cases in 13.947s. A controlled metadata-before-ACK/failed-refresh flow passes in 12.692s. Removing only the retired clock workaround changes the unchanged archive/color cases from RED (42.142s) to GREEN (12.439s), without changing scripted timestamps, assertions, deadlines, or retries. Prior workaround passes are not proof of the final projection repair.

The retained relay fixture now waits for actual Gateway entry before advancing fake time across the unchanged 25ms deadline, checking abort and output while surfacing early termination. Two preaction parser suites gain the same installed-Gateway guard mock as their main sibling; production guard refusal and inspection/state-path behavior remain covered. The original nine isolation failures reproduced with normal host routing; 97 affected and guard-sibling cases then passed. The combined original 386-file/eight-worker CLI group passed 8,835 tests with 91 existing skips in 506.003s, and all 21 combined selected checks passed in 176.277s. No retries or enlarged timeouts were added.

Historical hosted costs: CI 35623533860 passed all 13 UI browser shards; the async-question file took 67.417s, including 3.184s for reconnect. At head 1b2145e7830dfadd2a45dd1842d90981545fbf44, the original 53-file/236-test browser shard passed, with the eight rail cases taking 80.357s file time and the repaired 80-message case 25.360s. Hosted head 99b82ae6 passed the retained relay and two preaction files with summed case times, not file wall times, of 0.285s, 0.177s, and 0.092s. That head's aggregate CI failed archive/color. The subsequent efa7f8b633bb run passed all UI shards but failed approval cases. Final-head replacement CI is pending.

Main also supplies the directive-delivery assertion repair 087ccde18c30, which preserves exact rendered code after balanced-fence delivery replaced raw indentation. Its exact 78-case failing file passed on CI-pinned Bun in 23.936s. The earlier main-owned approval fixture passed all five then-existing cases in 24.235s command wall, with 1.476s summed case time and both real SQLite contracts intact. The current six-case fixture measurement appears below; superseded PR-only proof is retained as history.

Approval CI repair

The failed baseline replay used the original 147-path order and a source tree equivalent to the hosted merge: 447.485s, with two approval-publication readiness failures, a separate SQLite clock assertion, and two observer-close unhandled errors. It corroborated the race without reproducing every hosted failure.

The integrated #155111 owner repair plus clock-test patch passes all 3,352 tests with one existing skip across those same 147 files in 387.430s, with no unhandled errors. All seven hosted failure cases and the local failures pass. The owner's new six-case fixture suite also passes in 26.680s (24.38s Vitest). These are local v8 integration measurements, not hosted final-candidate costs or a speedup claim. No retries were used.

Review v8 found that the clock-test rewrite lost coverage through the public default-clock path. A 14-line worker-sibling regression restores it: the early-clock negative control fails in 16.916s, while all four worker cases pass in 18.862s, including 442ms for the new case. The other 31 bound files remain unchanged. All 21 selected gates pass across the initial and corrective runs (246.823s total, including a formatting correction); this is a composite result, not one uninterrupted aggregate pass. Fresh scoped review found no actionable P0–P2 findings and resolves v8's only accepted finding. All owned processes joined. The final source binding covers the committed 32-file head; replacement hosted CI remains pending.

Remaining browser investigation gaps

A final hydration-file run passed 18/19 cases but stalled in the existing 430px light viewport case after Collapse: 167.913s command wall, 120.523s affected case. The first Playwright toBeInViewport evaluation awaited its IntersectionObserver until the outer 120s test timeout closed the page before capture. Inspection of Playwright 1.63's uncancelled progress path explains why the matcher deadline did not stop that evaluation, but not why the observer failed to settle. One original-order observational replay passed all 19 in 51.477s; the case took 1.121s and its collapsed-panel assertion 11ms. This is non-reproduction, not a fix. Diagnostic edits were removed; no timeout, retry, assertion, or dependency change was made. A safe product/fixture root cause remains unestablished.

Separately, historical CI 35585195106 timed out after 120.006s in the dark mobile-gutter notice case at 390/430px; 202/203 shard tests passed and the light counterpart passed. The log does not identify the stalled operation. Main's later matrix reduction in #154463 preserved 112 cells while reducing browser contexts from 56 to 28; it is lifecycle cleanup, not proof of this timeout's cause. Neither a later pass nor the replacement CI is claimed to explain that historical failure.

These unexplained browser failures remain disclosed under the repository's best-effort investigation policy; they do not create an additional landing gate.

Final hosted validation: CI 35650691661 passed on the landed head, followed by successful security review. The repaired approval clock case took 0.819s in CI, and the new public-worker default-clock regression took 0.960s. The owning Gateway-server group passed 3,359 cases plus one existing skip in 433.58s wrapper wall across 148 files; the larger 17m42s job contains 11 sequential groups, so that job wall is not the cost of the clock regression.

@clawsweeper

clawsweeper Bot commented Sep 21, 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 app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 21, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 21, 2026 06:02
@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. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 21, 2026, 4:13 PM ET / 20:13 UTC (Revision 7).

ClawSweeper review

What this changes

The Control UI shows optional-answer delivery status, retries the existing queued answer, and preserves answer recovery through reconnect, Discard, and reload, with documentation and supporting test repairs.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR remains useful: current main lacks its question-to-outbox delivery association, and the merged recovery work does not supersede it. No actionable introduced correctness or security defect was found.

Priority: P2
Reviewed head: efa7f8b633bbb4e8f40e59af9391018bc6aa3111

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A sound owner-preserving implementation with strong scoped behavior evidence and no actionable introduced findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured body records exact-candidate native question submission and reload confirmation; registered browser traces exercise rejection, reconnect, same-row retry, and Discard through the production UI owners. Inspected before/after Discard screenshots directly support visible recovery, with legacy-row coverage supplied separately.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records exact-candidate native question submission and reload confirmation; registered browser traces exercise rejection, reconnect, same-row retry, and Discard through the production UI owners. Inspected before/after Discard screenshots directly support visible recovery, with legacy-row coverage supplied separately.
Evidence reviewed 8 items Pinned introduction and review scope: Read the introduced b485dd0..efa7f8b changes across production, tests, and docs. The original head has the two recorded parents supplied by the host; the stale test merge was not used to infer removal of current-main behavior. The introduced diff has no Gateway approval-file changes, and git diff --check passed.
Still necessary on main and absent from the release action path: Fetched main still submits optional answers without a question association and with replyTargetOverride set to null. Searching main found none of the new association or delivery-label identifiers. The v2026.9.5 tree records the same pre-change question-action blob d31deba756826f618b7f92f55420206137f1967b; no released fixing implementation was established.
Delivery and recovery retain their existing owners: Question presentation projects the existing queue, remembers admission across row retirement, and confirms delivery only from canonical saved history. Explicit Discard checks the admitted queue identity and restores the draft at the current completion boundary. The outbox notifies subscribed panes only after successful explicit removal.
Findings None None.
Security None None.

How this fits together

Optional questions appear in the chat composer, and submitted answers enter the existing message outbox. Question summaries now follow that outbox’s delivery state and use saved conversation history to confirm successful delivery.

flowchart TD
  A[Optional question] --> B[Answer draft]
  B --> C[Existing message outbox]
  C --> D[Gateway delivery]
  C --> E[Delivery status and Retry]
  C --> F[Explicit Discard]
  F --> B
  D --> G[Saved conversation history]
  G --> H[Confirmed answer summary]
Loading

Before merge

  • Complete next step (P2) - Integrate main’s merged approval-readiness repair ff26aae, update the pending-repair statement in the PR body, and validate the integrated head while preserving the reviewed delivery and recovery behavior.
Agent review details

Security

None.

PR surface

Source +195, Tests +679, Docs +11. Total +885 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 16 259 64 +195
Tests 12 792 113 +679
Docs 2 11 0 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 30 1062 177 +885

Review metrics

Metric Value Why it matters
Production versus test growth Production +259/-64; tests and test support +792/-113 Production growth implements delivery projection and recovery through existing owners; regression coverage accounts for most of the added code.
Persisted contract 1 optional outbox field; 0 new Gateway protocol fields The added question association has explicit legacy-row retry coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #154395
Summary: This PR implements the delivery-state portion of the coordinated optional-question improvement; merged siblings cover distinct recovery behaviors.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep delivery and retry outbox-owned, draft recovery presentation-owned, and successful-answer confirmation derived from canonical conversation history.

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

Yes, source and recorded browser evidence establish the reconnect path: an admitted answer loses its question association on main and can expose another Submit form. This read-only review did not execute the application.

Is this the best way to solve the issue?

Yes. Extending the existing outbox projection avoids a competing sender, while canonical reply identity handles ambiguous saved text and legacy rows retain their existing retry path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is live_output.

Label justifications:

  • P2: This improves optional-question delivery feedback and recovery within the Control UI without evidence of an urgent broad outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records exact-candidate native question submission and reload confirmation; registered browser traces exercise rejection, reconnect, same-row retry, and Discard through the production UI owners. Inspected before/after Discard screenshots directly support visible recovery, with legacy-row coverage supplied separately.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records exact-candidate native question submission and reload confirmation; registered browser traces exercise rejection, reconnect, same-row retry, and Discard through the production UI owners. Inspected before/after Discard screenshots directly support visible recovery, with legacy-row coverage supplied separately.

Evidence

What I checked:

  • Pinned introduction and review scope: Read the introduced b485dd0..efa7f8b changes across production, tests, and docs. The original head has the two recorded parents supplied by the host; the stale test merge was not used to infer removal of current-main behavior. The introduced diff has no Gateway approval-file changes, and git diff --check passed. (efa7f8b633bb)
  • Still necessary on main and absent from the release action path: Fetched main still submits optional answers without a question association and with replyTargetOverride set to null. Searching main found none of the new association or delivery-label identifiers. The v2026.9.5 tree records the same pre-change question-action blob d31deba756826f618b7f92f55420206137f1967b; no released fixing implementation was established. (ui/src/pages/chat/chat-question-actions.ts:33, 3d4033fbe0ac)
  • Delivery and recovery retain their existing owners: Question presentation projects the existing queue, remembers admission across row retirement, and confirms delivery only from canonical saved history. Explicit Discard checks the admitted queue identity and restores the draft at the current completion boundary. The outbox notifies subscribed panes only after successful explicit removal. (ui/src/pages/chat/components/chat-async-question.ts:298, efa7f8b633bb)
  • Persisted association and upgrade coverage: The optional asyncQuestionItemId field is bounded during decoding and participates in delivery-version comparison. The browser regression retains a legacy row without this field and exercises its existing Retry behavior; fresh rows are exercised through rejection, reload, Retry, confirmation, and Discard. This supplies compatibility evidence for the additive stored field without a new storage owner or protocol. (ui/src/lib/chat/outbox-store-codec.ts:120, efa7f8b633bb)
  • Complete captured proof body and inspected media: The full REST body was read and its SHA-256 matched the captured source identity 61e0438f059fc0cb21df2993952c8e1a89702817a03a04aa9a6b411b82109669, resolving the omitted-body gap. It records candidate-specific native question submission, exact payload echo, and reload confirmation, plus registered browser rejection/retry traces preserving queue and idempotency identity. All four prepared images were inspected: two show Discard restoring the answer form, and two document the main-owned rail repair. The browser captures are synthetic; they are not described as live-provider screenshots. (efa7f8b633bb)
  • Previous review and current integration follow-up: The prior Discard defect is covered by successful-removal, failed-removal, acknowledgement, consumed-receipt, and cross-pane cases. The previous approval-fixture overlap is absent from the introduced diff, and GitHub currently reports the PR mergeable. The separately owned approval-readiness repair at fix(test): await approval readiness and request cleanup #155111 is now merged as ff26aae; the PR body’s statement that it is pending is outdated. The supplied exact-head CI remains failed, so no green integrated-head result is claimed. (ui/src/pages/chat/chat-view.async-questions.test.ts:175, ff26aaefcd67)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • jb510: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

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

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

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

History

Review history (6 earlier review cycles)
  • reviewed 2026-09-21T06:09:30.370Z sha 4f2039b :: blocked before merge. :: [P2] Clear recovered submission state when its answer is discarded
  • reviewed 2026-09-21T09:59:49.262Z sha d5cff7e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T16:47:40.018Z sha ed20fc6 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T17:18:42.328Z sha 1b2145e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T18:10:56.658Z sha 99b82ae :: needs changes before merge. :: none
  • reviewed 2026-09-21T19:07:24.441Z sha 585286f :: needs changes before merge. :: none

@vincentkoc
vincentkoc changed the base branch from stack/async-question-saved-base-20260921 to main September 21, 2026 09:46
@vincentkoc
vincentkoc force-pushed the feat/question-delivery-state-20260921 branch from 4f2039b to d5cff7e Compare September 21, 2026 09:46
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 21, 2026
@VACInc

VACInc commented Sep 21, 2026

Copy link
Copy Markdown
Member

Coordination note: #154312 (saved-answer reconstruction), #154473 (unfinished optional-question draft recovery), and #154692 (reversible persistent dismissal) are now merged. This PR remains necessary and open: it uniquely projects the existing outbox row as optional-answer delivery state, retries that same row without duplicating an answer, and handles successful explicit Discard recovery across panes.

Integrate current main while preserving the original delivery-state implementation, durable drafts, dismissal, Undo, and scoped presentation owners. Prove reconnect retains one admitted outbox row and explicit retry preserves its idempotency identity.

Co-authored-by: Vincent Koc <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 21, 2026
Replace arbitrary polling deadlines with the real two-phase response and retain requested-broadcast and persisted-identity assertions. Drain fixture requests and worker-backed SQLite before deleting their state.
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Sep 21, 2026
@steipete

steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Additional integration proof: explicit Discard after later work completes.

The existing browser scenario submits the untouched default answer, receives a definite delivery rejection, reloads, observes a later successful completion, and clicks Discard. Before the repair, the question immediately becomes “No longer pending” instead of reopening. The candidate records the current completion boundary using the existing presentation state, restoring the default answer without disabling later reminder aging. The same scenario passes after repair, including another reload; all 19 optional-answer browser scenarios pass (45.625s command wall).

These inspected captures contain only synthetic mock-Gateway data. The integration candidate is under final review before publication; this is browser boundary proof, not live-provider proof.

Before: Discard incorrectly leaves the question archived

After: Discard reopens the preserved default answer

@steipete

steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Additional draft-recovery regression found during final review: a valid free-text answer can contain the exact quoted heading of the following question. The parser intentionally rejects that ambiguous boundary. The queued projection used to replace the preserved draft with an empty map, and submitted status blocked hydration after reload.

The same maintained mock-Gateway browser flow submits both answers, rejects delivery, reloads, clicks the actual Discard button, and advances to the second question. Before the fix, the first input is empty even though the outbox retains both complete answers. After the fix, both inputs survive and no new send is admitted. The projection now retains known answers when parsing fails; hydration restores stored answers while preserving live outbox admission and newer user intent.

Identical diagnostic: failing command 22.329s; passing command 14.399s (2.980s case). The temporary diagnostic was removed after proof, preserving existing browser coverage; two cheap owner regressions cover mounted and reloaded drafts. All 79 presentation/draft cases pass. These are synthetic browser boundary captures, not real-provider evidence. Both full captures were inspected and delivered in chat.

Before: Discard loses the original free-text answer

After: Discard restores the complete free-text answer

The related blank-summary defect is also repaired: ambiguous queued answers display the actual queued message verbatim with existing wrapping styles. This avoids substituting a preserved draft that may differ from text edited in the outbox. The same owner regressions cover both original and edited queued payloads. Identical browser summary diagnostic: RED 17.906s, GREEN 14.953s (3.101s case), followed by successful reload and Discard recovery. The additional inspected synthetic captures below show the blank summary before and the complete queued payload afterward.

Before: Ambiguous queued answers have an empty summary

After: The summary shows the actual queued payload

The successful-delivery path had a separate confirmation defect: the same conservative parser also rejected the saved answer after Retry succeeded. Reload therefore reopened the question despite one canonical saved user message and an empty outbox. The fix uses the existing canonical reply ID to identify the question and displays the exact saved text when splitting it would be ambiguous. Unlinked ambiguous replies remain unresolved; there is no new durable field or write owner.

The unchanged registered browser diagnostic submits both answers, rejects the first send, clicks Retry, lets the maintained mock perform its normal canonical commit, verifies the original text and reply ID, and reloads. Before: the form reopens. After: the form stays closed, the exact answer is marked sent, the outbox stays empty, and no additional message is sent. RED 27.985s command wall; GREEN 16.250s (3.633s case). All 82 related owner/rendered cases pass. The synthetic before/after captures below were inspected in full and delivered in chat.

Before: A saved ambiguous answer reopens the form after reload

After: The canonical reply remains confirmed after reload

steipete and others added 2 commits September 21, 2026 11:58
Keep main's rail resize and permission projection owners, retiring the mock
clock workaround that broke archive attribution and appearance refreshes.
Preserve optional-answer drafts through explicit discard after later work
completes and through ambiguous quoted text across reload. Show the actual
queued payload when answer boundaries cannot be parsed safely.

Retain the reviewed relay and approval fixture repairs, contributor ancestry,
and focused browser and draft regression coverage.

Co-authored-by: Vincent Koc <[email protected]>
Use the existing saved reply association when quoted headings or outbox
edits prevent splitting an answer. Render the actual saved text and retain
strict matching for unlinked legacy replies. Preserve reload and discard
recovery, and adopt main’s shared approval fixture without a duplicate owner.

Co-authored-by: Vincent Koc <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Sep 21, 2026
@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 21, 2026
@steipete
steipete enabled auto-merge (squash) September 21, 2026 20:25
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 21, 2026
@steipete
steipete merged commit f8da957 into main Sep 21, 2026
173 checks passed
@steipete
steipete deleted the feat/question-delivery-state-20260921 branch September 21, 2026 20:50
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
)

* feat(ui): show optional-answer delivery and retry state

* fix(ui): retain intermediate composer resize for the rail

Record committed textarea viewport changes through the existing transcript observation channel before Goal chrome can reverse them. Preserve the reader rail position while leaving focus/navigation and progress disclosure ownership intact.

* test(gateway): await approval acknowledgement and worker cleanup

Replace arbitrary polling deadlines with the real two-phase response and retain requested-broadcast and persisted-identity assertions. Drain fixture requests and worker-backed SQLite before deleting their state.

* test(gateway): retain approval fixture initialization errors

* test(ui): advance mock session clocks after patches

* test(cli): control gateway relay deadline progression

* test(cli): isolate preaction fixtures from installed gateways

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Pick-cat added a commit to Pick-cat/openclaw that referenced this pull request Oct 27, 2026
The original live-region split moved the question/answer text into a text-only
region but left deliveryLabel and sendError outside it, so a queued answer that
changed from sending to failed no longer announced "Answer not sent" or its
error - a regression against the delivery feedback PR openclaw#154486 explicitly
preserved. The plain wrapper also collapsed every question into a single grid
item, dropping the row gap between multiple questions.

Move delivery text (label + error) into a nested live region while leaving the
Retry button outside it, and give the announcement wrapper the grid
participation the questions had so the row gap is preserved.

Red on the previous head (2 failed):
  expected 'Everyone' to contain 'Answer not sent'   <- delivery outside region
  expected undefined to be truthy

Green on this head (2 passed): the delivery status and error are announced and
Retry stays out of the region.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants