Commit 529238d
feat: Modify get-actor-run - add waitSec and progress (#823)
`get-actor-run` returns the canonical run shape (status, storages,
stats, summary, nextStep) across all 8 Apify states. Text content
carries `summary \n nextStep`; structuredContent has the full shape — no
inlined items or record bodies.
Adds `waitSecs` (0–45, default 30) and emits `notifications/progress`
during the wait when `_meta.progressToken` is supplied.
`get-actor-run-widget` uses `waitSecs=0` so initial render is
non-blocking; widget self-polls.
`SUCCEEDED` with `itemCount=0` runs a one-item probe with one retry to
absorb Apify's ~5s pagination-counter lag — no false "no output" on a
run that did write items. KV shows up in `summary` only; never
recommended as `nextStep`, since it rarely carries real output (mostly
SDK state).
Follow-up PR #825 replaces `call-actor`'s `async` flag with the same
`waitSecs` and reshapes `storages` to a plural alias-map. Stacks on this
branch and lands together.
**Follow-up #847** — consolidate duplicated MCP server test fixtures
across three test files (surfaced during review); left out per "one
thing per change".
## Why this PR is bulky
Splitting the pieces below would leave master in a broken half-state:
- New shared module `src/tools/core/actor_run_response.ts` centralizes
the canonical shape, 8 status templates, wait+progress loop,
lag-fallback probe, and abort race. #825 (`call-actor` v4) reuses every
helper.
- Test coverage for the new contract — shape, 8 templates,
wait/progress, abort, lag-fallback.
- Widget UI in `src/web/src/pages/ActorRun/ActorRun.tsx` switched to a
`get-dataset-items` preview fetch with its own polling cadence — v4
dropped inlined items, so the UI is broken until the server stops
inlining.
- Spec, structured-output schema, tool-loader auto-inject, and widget
dev stub round out the v4 contract across modes.
Closes #822
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Jakub Kopecký <themq37@gmail.com>1 parent 90718db commit 529238d
40 files changed
Lines changed: 3060 additions & 2045 deletions
File tree
- res
- src
- mcp
- tools
- apps
- core
- default
- utils
- server-instructions
- web/src
- pages/ActorRun
- widgets
- tests
- integration
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | | - | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
74 | | - | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
| |||
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 104 | | |
113 | 105 | | |
114 | 106 | | |
| |||
173 | 165 | | |
174 | 166 | | |
175 | 167 | | |
176 | | - | |
177 | | - | |
178 | 168 | | |
179 | 169 | | |
180 | 170 | | |
| |||
227 | 217 | | |
228 | 218 | | |
229 | 219 | | |
230 | | - | |
231 | 220 | | |
232 | 221 | | |
233 | 222 | | |
| |||
324 | 313 | | |
325 | 314 | | |
326 | 315 | | |
327 | | - | |
328 | 316 | | |
329 | 317 | | |
330 | 318 | | |
| |||
1015 | 1003 | | |
1016 | 1004 | | |
1017 | 1005 | | |
1018 | | - | |
1019 | | - | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
1020 | 1011 | | |
1021 | 1012 | | |
1022 | 1013 | | |
| |||
1130 | 1121 | | |
1131 | 1122 | | |
1132 | 1123 | | |
1133 | | - | |
| 1124 | + | |
1134 | 1125 | | |
1135 | 1126 | | |
1136 | 1127 | | |
1137 | 1128 | | |
1138 | 1129 | | |
1139 | 1130 | | |
1140 | 1131 | | |
| 1132 | + | |
1141 | 1133 | | |
1142 | 1134 | | |
1143 | 1135 | | |
| |||
1434 | 1426 | | |
1435 | 1427 | | |
1436 | 1428 | | |
| 1429 | + | |
1437 | 1430 | | |
1438 | 1431 | | |
1439 | 1432 | | |
| |||
1453 | 1446 | | |
1454 | 1447 | | |
1455 | 1448 | | |
1456 | | - | |
| 1449 | + | |
1457 | 1450 | | |
1458 | 1451 | | |
1459 | 1452 | | |
1460 | 1453 | | |
1461 | 1454 | | |
1462 | 1455 | | |
1463 | 1456 | | |
| 1457 | + | |
| 1458 | + | |
1464 | 1459 | | |
1465 | 1460 | | |
1466 | 1461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | | - | |
6 | 3 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 4 | + | |
10 | 5 | | |
11 | 6 | | |
12 | | - | |
13 | | - | |
| 7 | + | |
14 | 8 | | |
15 | | - | |
| 9 | + | |
16 | 10 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 11 | + | |
21 | 12 | | |
22 | 13 | | |
23 | 14 | | |
24 | | - | |
25 | 15 | | |
26 | 16 | | |
27 | 17 | | |
28 | 18 | | |
29 | 19 | | |
30 | 20 | | |
31 | 21 | | |
32 | | - | |
| 22 | + | |
33 | 23 | | |
34 | 24 | | |
35 | 25 | | |
| |||
39 | 29 | | |
40 | 30 | | |
41 | 31 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
89 | 35 | | |
| 36 | + | |
90 | 37 | | |
0 commit comments