Skip to content

fix(console): a screen-flow step the run already left is never submitted again - #36864

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-36831-screen-flow-resubmits-step-one
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-36831-screen-flow-resubmits-step-one

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #36831
Clause-②: no
Metadata-protocol: none

repo:objectstack#3 · os-support-ai · session_01WGufzi4PechTRCTBrfxV8W

维护者速读

  • 用户在控制台走多步屏幕流程(如 HotCRM 商机「生成报价单」)时,第一步其实已成功但回包丢失(网关超时或断网)的情况下,弹窗不再停在第一步让人再点一次,而是直接切到流程当前所在的步骤,并用中文等界面语言说明「上一步已提交成功」;不再出现带字段名的英文引擎报错。
  • 这是屏幕流程(自动化)核心功能的缺陷修复,替所有使用多步屏幕流程的用户解决「成功了却显示失败、再点一次造成重复报价」的问题。
  • 出错时最坏的情况是弹窗退回到修改前的表现(保留重试按钮);改动只在前端控制台,可以直接撤回。
  • 无。

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: a paused answer 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). interpretFlowResponse calls every such answer retryable ("did not consume the suspension"), and that is true only of a request that never arrived. So FlowRunner kept 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 with INVALID_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 FlowRunner offers 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 failure interpretFlowResponse calls retryable. It then compares that screen's nodeId with the current one. The contract documents nodeId as the field that ties a resume to its pause.

  • Another screen: the step went through. The dialog shows that screen with a plain notice, 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).
  • Same screen, or no usable answer: this is a real retry, shown exactly as before. A real refusal of this screen's values keeps its sentence.

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):

  1. ui/packages/app-shell/src/views/FlowRunner.tsx: reconcileWithRun, and the two places that call it in resumeWith (the thrown-fetch catch and the outcome.retryable branch). The terminal flag now also includes reconciled.terminal.
  2. ui/packages/app-shell/src/views/__tests__/FlowRunner.resumeResult.test.tsx: the new top-level describe and its two-door fake run.
  3. 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 (after origin/main was merged and packages/spec rebuilt), unless a line says otherwise.

  • New: six cases in FlowRunner.resumeResult.test.tsx, objectstack#36831. They use a two-door fake run with the HotCRM wizard's shape: step one declares quoteName, expirationDays and discount, and the result screen declares only the quoteLink record link. The cases are: gateway 504 after the server advanced, a thrown fetch after it advanced, a stale step-one submit refused INVALID_SCREEN_INPUT (the card's exact sentence), the same notice in zh, a run that waits on no screen (404), and a preservation pin for a real refusal of the same screen.
  • Adjusted: three existing pins now count resume POSTs instead of every authFetch call (FlowRunner.test.tsx, requiredAtField-26882, resultScreen-26902). Each still asserts that exactly one resume was sent.
FlowRunner suite, i18n suite, typechecks
vitest run packages/app-shell/src/views/__tests__/FlowRunner  (from ui/)
 Test Files  18 passed (18)
      Tests  122 passed (122)
vitest run packages/i18n/
 Test Files  108 passed (108)
      Tests  2011 passed | 13 skipped (2024)
pnpm --filter @object-ui/app-shell run type-check   VERDICT command-exit 0
pnpm --filter @object-ui/i18n run type-check        VERDICT command-exit 0
Ablation: red without the fix, green with it

The fix was committed first (99f87c6c41). For the red leg, FlowRunner.tsx alone was restored from the test-only commit 99827a1fd5 (tree only, unstaged). On disk the hash was 5d844bb534, matching the pre-fix blob, and reconcileWithRun occurred 0 times. Then git checkout HEAD -- FlowRunner.tsx. After the restore the hash was 2c374ce54e, the HEAD blob, and git diff HEAD had 0 lines. The test imports ../FlowRunner from source, so no build sits between the edit and the run.

red  (pre-fix FlowRunner, head 71b5190f2d)
 x a gateway timeout on step one, after the run moved on, shows the result screen instead of step one
 x a dropped connection on step one, after the run moved on, shows the result screen too
 x a stale step-one submit is answered with the step the run is on and a readable notice, never the engine sentence
 x reads that notice in the display language
 x a run that waits on no screen any more withdraws Next and says why, in words
 ok a refusal from the screen the run still waits on keeps its sentence and Next - a real retry
 Tests  5 failed | 11 passed (16)
   -> Unable to find an element with the text: Quote Created
green (fix, head 71b5190f2d)
 Tests  16 passed (16)

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

  • The field run was not reproduced end to end. The cloud gateway's timeout and the email notify node'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.
  • A flow that loops back and pauses on the same screen node again cannot be told apart from a retry by 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.
  • No server change. The refusal keeps its shape, so this is not a narrowing.

Verification

Two-minute check: run pnpm --filter @object-ui/app-shell exec vitest run --root ../.. packages/app-shell/src/views/__tests__/FlowRunner.resumeResult.test.tsx from ui/. Expect 16/16 passed, including the six objectstack#36831 cases.

Local gate subset (head 27f9c0e)

node scripts/pm/dispatch-gates.mjs --commands derived 41 families from this diff. All 41 ran, and each exited 0. --ran reconciliation: "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: ui check:i18n-keys, check:i18n-drift and check:i18n-dead-keys, each exit 0. zh-Hant.ts was regenerated with gen:zh-hant, which the i18n suite pins. Repo-wide scans and the type-check lanes are left to CI.


Generated by Claude Code

…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>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 24, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4

席位核对 — ACCEPT · repo:objectstack#3 · head 27f9c0e · 2026-11-24T05:49Z

L1: ACCEPT
Head-sha: 27f9c0ed3a60f24c75cf3489068028bf3b2cb5cb
Card: #36831 (p1, HotCRM quote wizard resubmits step one) · os-dev-report 7122972405 (Dev-effort: high, Rounds: 1).

Checklist

  • Shape: l1-face CLEAN, 13 items. Draft, base main, first line Fixes #36831, no closing keyword next to another card.
  • Checks at this head: 45 success, 13 expected skip, 0 failed, 0 pending. Floor checks, Type Check UI, the 16 Test UI shards and Build & E2E UI: success.
  • Governance: NOT governed, 433 lines. Faces: none. Only ui/ moves. Clause-②: no is right: no route, engine or spec change, and the refusal's shape is untouched, so nothing narrows.
  • Changeset: @object-ui/app-shell (private, inert) and @object-ui/i18n (published, its locales moved), both at patch. The prose is true sentence by sentence: the lost-answer cause, the re-read through GET …/runs/RUN/screen, the three outcomes, the two catalog keys in every shipped locale, and the engine refusal unchanged.
  • Premise: an inference, labelled as one. The report rules out a console double submit (Next is disabled in flight, and createAuthenticatedFetch never retries) and a runner that ignores a paused answer. That leaves an answer lost after the server finished (a gateway 5xx or a thrown fetch), which interpretFlowResponse called retryable (flowResponse.ts, "every other non-2xx … retryable: true"). The gateway log was not read. The fix holds whichever way the first answer was lost. The second press the card shows lands as 400 INVALID_SCREEN_INPUT, which that same function classes as retryable, so it now reconciles too and shows step two instead of the engine sentence. Both card expectations are met: the dialog moves to step two, and a duplicate submit gets a readable notice in the user's language, never the field names.
  • Diff (FlowRunner.tsx):
    • readRunPosition maps the existing refresh-safe screen read to three outcomes: screen, none (404) and unknown (any other status, a thrown read, or no nodeId).
    • reconcileWithRun runs only on a thrown resume fetch or a retryable failure. On another nodeId it swaps in that screen with fresh values and a default, not destructive, notice. On 404 it withdraws Submit through the shared terminal flag and fires notifyDataChanged('*'), as completion does. On the same screen or unknown, it falls through to the old path unchanged.
    • Non-retryable answers (FLOW_FAILED, 404 on resume, a failed run) never reach it. reconciled resets with the run and on each submit.
  • UI strings: two keys in all 11 console packs, with the defaultValue mirroring en. zh-Hans and ja read as plain product language. check:i18n-keys, drift and dead-keys ran and exited 0.
  • Scope: inside the claim (FlowRunner and its tests, i18n locales, the changeset). Three existing pins changed from counting all authFetch calls to counting resume POSTs. That follows from the new GET, and each still asserts exactly one resume, so the edit is accepted.
  • Tests: 6 new cases on a two-door fake with the HotCRM wizard's shape: gateway 504, dropped connection, a stale submit answered with the next step, the notice in the display language, 404 withdrawing Next, and a same-screen refusal keeping its sentence and Next. FlowRunner: 18 files, 122 tests. i18n: 108 files, 2011 tests. The ablation restored the pre-fix blob and turned 5 red with the preservation pin green; the restore was pinned to the HEAD blob.

Findings

Must-fix: none. Should-fix: none.

Notes the dev left unfiled (judged for the seat):

  • (a) The flowResponse.ts header ("every other non-2xx … did not consume the suspension") is false for a gateway 5xx. Only FlowRunner reads retryable (the launch handlers do not), and it now reconciles, so this is a comment that lies, not a live defect. To the seat: a p3 card to correct that header, comment only.
  • (b) A loop that pauses on the same screen node again can't be told from a retry by nodeId. Separating them needs a run step counter on the wire, which is a contract change, and the case needs both a looping screen flow and a lost answer. No card; the Acceptance note is enough.

Landing notes

Not governed. The area lands on this ACCEPT once mergeable_state reads clean (it was still computing when I read it). Fixes #36831 closes the card. Cloud confirmation of the HotCRM wizard is the reporter's after release.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzi4PechTRCTBrfxV8W

Landing · 2026-11-24T05:50Z · L1 ACCEPT 7123314500 (L1-b) at head 27f9c0e · p0

reading value
check-governed-merges.mjs --pr 36864 NOT governed · +420/−13
landing-k.mjs --pr 36864 CAN'T ANSWER (UI-only: no Test Core planner ran). K read via merge-base = 6 < 15; none of the 6 main commits touches FlowRunner* or the console locale packs
contract Clause-②: no · Metadata-protocol: none · no contract face (L1-b)
checks at 27f9c0e 45 success, 13 expected skip, 0 failed, 0 pending

State: ready + auto-merge (Tier S). On MERGED, #36831 closes by Fixes; the seat removes pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 24, 2026 05:51
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 0819cab Nov 24, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36831-screen-flow-resubmits-step-one branch November 24, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants