Repository navigation
fix(console): a screen-flow step the run already left is never submitted again - #36864
objectstack-fleet[bot] merged 5 commits into
Conversation
…mitted again Reproduces the two-step quote wizard: a resume whose answer is lost (a gateway timeout or a dropped connection) after the server advanced keeps step one with Next live, and the next press resends step one to the result screen, where the engine refuses it with its raw sentence. Claude-Session: https://claude.ai/code/session_01WGufzi4PechTRCTBrfxV8W Co-authored-by: Claude <noreply@anthropic.com>
A resume whose outcome the runner cannot know (no answer, a gateway's answer, or a refusal the engine calls retryable) now re-reads the run's paused screen through the route's refresh-safe screen read. Another screen: the dialog shows it with a plain catalog notice. No screen: Submit is withdrawn with a plain notice. The same screen: the retry stays as before. Claude-Session: https://claude.ai/code/session_01WGufzi4PechTRCTBrfxV8W Co-authored-by: Claude <noreply@anthropic.com>
…retry re-reads the run Adds the changeset. Claude-Session: https://claude.ai/code/session_01WGufzi4PechTRCTBrfxV8W Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzi4PechTRCTBrfxV8W Co-authored-by: Claude <noreply@anthropic.com>
…reen-flow-resubmits-step-one
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 席位核对 — ACCEPT · repo:objectstack#3 · head 27f9c0e · 2026-11-24T05:49ZL1: ACCEPT Checklist
FindingsMust-fix: none. Should-fix: none. Notes the dev left unfiled (judged for the seat):
Landing notesNot governed. The area lands on this ACCEPT once |
|
repo:objectstack#3 · os-support-ai · session_01WGufzi4PechTRCTBrfxV8W Landing · 2026-11-24T05:50Z · L1 ACCEPT 7123314500 (L1-b) at head 27f9c0e · p0
State: ready + auto-merge (Tier S). On MERGED, #36831 closes by |
Fixes #36831
Clause-②: no
Metadata-protocol: none
repo:objectstack#3 · os-support-ai · session_01WGufzi4PechTRCTBrfxV8W
维护者速读
What changes
Cause, reproduced. Not a console double submit: Next is disabled while a resume is in flight, and the shared authenticated fetch (
createAuthenticatedFetch) has no retry. And not a runner that ignores the new screen: apausedanswer does move the dialog to the next screen (FlowRunner.test.tsx, "renders the next screen on a multi-step pause"). The hole is a resume that finishes on the server while its answer never reaches the dialog intact, such as a gateway timeout (504) or a dropped connection (a thrown fetch).interpretFlowResponsecalls every such answer retryable ("did not consume the suspension"), and that is true only of a request that never arrived. SoFlowRunnerkept step one with Next still active, and the next press sent step one's three values to the result screen the run had moved on to. The engine then refused them withINVALID_SCREEN_INPUT, whose sentence names the fields. On the card, the quote was created about 30 seconds before the refusal, which fits a gateway timeout followed by a second press. The cloud gateway's own log was not read; see Acceptance notes.Fix, in the runner only. Before
FlowRunneroffers a retry, it reads the run's paused screen again through the route's existing refresh-safe read,GET /api/v1/automation/FLOW/runs/RUN/screen. It does this when no answer arrives, and on every failureinterpretFlowResponsecalls retryable. It then compares that screen'snodeIdwith the current one. The contract documentsnodeIdas the field that ties a resume to its pause.flowRunner.alreadySubmitted, and no error toast or banner.404, no screen: the run waits on no screen any more (it ended, failed, or a resume holds it). Submit is withdrawn with a plain notice,flowRunner.noLongerWaiting, and mounted readers refetch ('*', as on completion).Both notices are new keys in all 11 console locale packs. The engine's refusal, the routes and the spec are unchanged. A stale submit never shows the engine sentence, because the dialog moves to the run's real step and shows the notice in its place.
Files read first (by risk):
ui/packages/app-shell/src/views/FlowRunner.tsx:reconcileWithRun, and the two places that call it inresumeWith(the thrown-fetchcatchand theoutcome.retryablebranch). Theterminalflag now also includesreconciled.terminal.ui/packages/app-shell/src/views/__tests__/FlowRunner.resumeResult.test.tsx: the new top-leveldescribeand its two-door fake run.ui/packages/app-shell/src/views/__tests__/FlowRunner.test.tsx,FlowRunner.requiredAtField-26882.test.tsx,FlowRunner.resultScreen-26902.test.tsx: these now count resume POSTs instead of every fetch, because a retryable failure now also makes one GET.Tests
Readings below come from head
27f9c0ed3a(afterorigin/mainwas merged andpackages/specrebuilt), unless a line says otherwise.FlowRunner.resumeResult.test.tsx,objectstack#36831. They use a two-door fake run with the HotCRM wizard's shape: step one declaresquoteName,expirationDaysanddiscount, and the result screen declares only thequoteLinkrecord link. The cases are: gateway504after the server advanced, a thrown fetch after it advanced, a stale step-one submit refusedINVALID_SCREEN_INPUT(the card's exact sentence), the same notice inzh, a run that waits on no screen (404), and a preservation pin for a real refusal of the same screen.authFetchcall (FlowRunner.test.tsx,requiredAtField-26882,resultScreen-26902). Each still asserts that exactly one resume was sent.FlowRunner suite, i18n suite, typechecks
Ablation: red without the fix, green with it
The fix was committed first (
99f87c6c41). For the red leg,FlowRunner.tsxalone was restored from the test-only commit99827a1fd5(tree only, unstaged). On disk the hash was5d844bb534, matching the pre-fix blob, andreconcileWithRunoccurred 0 times. Thengit checkout HEAD -- FlowRunner.tsx. After the restore the hash was2c374ce54e, the HEAD blob, andgit diff HEADhad 0 lines. The test imports../FlowRunnerfrom source, so no build sits between the edit and the run.The predicted direction was red on the five cases that move or withdraw, and green on the preservation pin. That is what was observed. In the red leg the stale-submit DOM dump shows the engine sentence in the dialog, as on the card.
Acceptance notes
notifynode's latency on 18.6.0 were not measured, so "gateway timeout or dropped connection" is the mechanism the code admits and the card's timing fits, not a captured trace. The fix covers every way a resume answer can be lost: a 502/503/504, a thrown fetch, or a retryable envelope.nodeId, so it keeps today's answer. Separating them needs a run step counter on the wire, which is a contract question and not part of this PR.interpretFlowResponse's header sentence "every other non-2xx … did not consume the suspension" is still inaccurate for gateway answers. The runner no longer acts on it, and the module is outside this claim's surface. It is noted here rather than edited.Verification
Two-minute check: run
pnpm --filter @object-ui/app-shell exec vitest run --root ../.. packages/app-shell/src/views/__tests__/FlowRunner.resumeResult.test.tsxfromui/. Expect 16/16 passed, including the sixobjectstack#36831cases.Local gate subset (head 27f9c0e)
node scripts/pm/dispatch-gates.mjs --commandsderived 41 families from this diff. All 41 ran, and each exited 0.--ranreconciliation: "41 derived famil(ies) accounted for — 41 run, 0 NOT-MEASURED (a DERIVED zero — all 41 recorded an exit code and none of them is 3)". Also run:uicheck:i18n-keys,check:i18n-driftandcheck:i18n-dead-keys, each exit 0.zh-Hant.tswas regenerated withgen:zh-hant, which the i18n suite pins. Repo-wide scans and the type-check lanes are left to CI.Generated by Claude Code