Repository navigation
Commit 24972aa
fix(console): a screen run finished from Flow Runs no longer reads as paused (#34085)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9FFs7vCo5s4ZwH6FsmHDE8q)_
Fixes #33856
Clause-②: no
Metadata-protocol: none
Claim by `domain:ui#2` (comment 6898241442), card-thread session
`session_01ADHkmSmRojhM8vYjHkVSeg`.
## 维护者速读
- 改了什么:开发者 Flow Runs 页的测试面板里,屏幕流程被 FlowRunner
跑完后,面板重读这条运行记录(`automation.getRun`),把它当作结果显示(绿色「Result」、最终状态与耗时),不再显示「Waiting
for input」和「Continue run」。
- 为什么改:原来完成回调只关掉对话框,面板仍保留触发时的暂停应答;「Continue run」又出现,点开是旧屏幕,提交得到 404
`RUN_NOT_FOUND`。
- 风险与回滚:只改 `FlowRunsPage.tsx`
的完成回调(加一次运行读取和一个代次守卫,防止旧读取覆盖新一次运行);用户手动关掉对话框、运行仍暂停时的「Continue run」不变。回滚即
revert。
-
先看:`ui/apps/console/src/pages/developer/FlowRunsPage.tsx`(`handleComplete`),`FlowRunsPage.test.tsx`
末尾新增的 describe。
- 两分钟验证:`pnpm --dir ui exec vitest run
apps/console/src/pages/developer/FlowRunsPage.test.tsx`,预期 4 passed;把
`onComplete={handleComplete}` 换回旧的内联回调,新用例转红。
- 需要你做的:无,席位落地。
## What changes
- **`ui/apps/console/src/pages/developer/FlowRunsPage.tsx`**
(`FlowTestRunner`): `FlowRunner`'s `onComplete` now runs
`handleComplete`. It closes the runner, clears the trigger answer held
in `result` (the paused envelope, whose screen the server no longer
holds), refreshes the run list as before, then reads the run back with
`client.automation.getRun(flow.name, runId)` and shows the stored run as
the result. The panel header then takes its status branch from the run
row (`completed` reads green "Result"), and the "Continue run"
affordance, which needs `status === 'paused'` plus a `screen`, is gone.
- `FlowRunner`'s `onComplete` takes no arguments, so the resume answer
the runner received is not reachable from this file; reading the run
back is the in-surface route (card reading kept on the card,
6895948571).
- A client without `automation.getRun` gets the page's existing "… is
not available on this client" panel error; a failed read shows its
message. A ref counter, bumped by every new run and by a flow switch,
drops a read that lands after the tester has moved on.
- Unchanged: the runner dismissed while the run is still paused
(`onClose`) keeps the paused answer and its "Continue run".
## Tests
- **`ui/apps/console/src/pages/developer/FlowRunsPage.test.tsx`**, new
top-level describe in the existing harness: run the screen flow, submit
the screen, then assert `getRun('reassign_wizard', 'run_1')` was called,
the header reads "Result", the shown run says `"status": "completed"`,
and neither "Waiting for input", "This run is paused at screen", nor a
"Continue run" button remain.
- Harness change (not a forced edit of any existing assertion): the
stubbed client gains a hoisted `getRun` that answers a completed run
row, cleared in `beforeEach`.
- CONTROL, already in the file and still green: "offers a \"Continue
run\" affordance after the runner is dismissed" (a still-paused run
keeps Continue).
<details><summary>Readings (head 6c401b3)</summary>
- `pnpm --dir ui exec vitest run
apps/console/src/pages/developer/FlowRunsPage.test.tsx` under the verify
lock: Test Files 1 passed, Tests 4 passed, VERDICT command-exit 0 (after
`pnpm --filter '@object-ui/console^...' build`, also exit 0).
- Ablation through `scripts/ablation-replace.mjs` (fix committed first):
anchor `onComplete={handleComplete}` replaced by the old inline
`onComplete` (anchor 1 to 0, blob 8c147b8 to 19a1de0d). The new test
went red ("expected vi.fn() to be called with arguments: [
'reassign_wizard', 'run_1' ]"), 1 failed and 3 passed; restored, blob
equals HEAD, `git diff HEAD` empty. The page source is imported from
`src` by the test, so no rebuild leg applies.
- `pnpm --filter @object-ui/console run type-check`: exit 0. The console
tsc program does not list `FlowRunsPage.test.tsx` (`--listFiles` count
0), so this covers the page, not the test.
- `node scripts/pm/dispatch-gates.mjs --commands`: 36 commands, each
run, each exit 0; `--ran` reconciliation: 36 derived, 36 run, 0
NOT-MEASURED. Also `pnpm check:changeset-fixed` (its roster is under
`.changeset`): exit 0.
</details>
## Acceptance notes
- Read-only inference, not measured, outside this file surface: the same
stale-`result` shape can follow `onClose` in two cases. (1) A run that
ends `refused` shows the refusal in the runner, which never calls
`onComplete`; closing it leaves the paused answer, so "Continue run"
would return for a terminal run. (2) A multi-step wizard dismissed at
step 2 keeps step 1's screen in `result`, so "Continue run" would reopen
step 1. Both need `FlowRunner` to tell its host where the run ended (a
run row has no `screen` to re-read), which is `@object-ui/app-shell`,
not this page. Carrier: the seat.
## Verification
Changeset: `.changeset/33856-flow-runs-completed-run.md`,
`@object-ui/console` patch.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmSmRojhM8vYjHkVSeg)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 393a576 commit 24972aa
3 files changed
Lines changed: 81 additions & 5 deletions
File tree
- .changeset
- ui/apps/console/src/pages/developer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
41 | 52 | | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
45 | | - | |
| 56 | + | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
| |||
51 | 62 | | |
52 | 63 | | |
53 | 64 | | |
54 | | - | |
| 65 | + | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
| |||
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
| 90 | + | |
79 | 91 | | |
80 | 92 | | |
81 | 93 | | |
| |||
146 | 158 | | |
147 | 159 | | |
148 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
370 | 373 | | |
371 | 374 | | |
| 375 | + | |
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
| |||
382 | 386 | | |
383 | 387 | | |
384 | 388 | | |
| 389 | + | |
385 | 390 | | |
386 | 391 | | |
387 | 392 | | |
| |||
410 | 415 | | |
411 | 416 | | |
412 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
413 | 441 | | |
414 | 442 | | |
415 | 443 | | |
| |||
527 | 555 | | |
528 | 556 | | |
529 | 557 | | |
530 | | - | |
| 558 | + | |
531 | 559 | | |
532 | 560 | | |
533 | 561 | | |
| |||
0 commit comments