Commit 73d6465
feat: propagate task statusMessage to tasks/get and tasks/list (#556)
* feat: Pass ActorRun.statusMessage into task statusMessage
When an Actor run's statusMessage changes during long-running async task
execution, update the task store's statusMessage via updateTaskStatus.
This allows clients polling tasks/get to see real-time Actor progress.
Closes #555
https://claude.ai/code/session_011o5nwJS86T6dkG889LaefQ
* chore: Update package-lock.json
https://claude.ai/code/session_011o5nwJS86T6dkG889LaefQ
* feat: Poll Actor run status and update task statusMessage even without progressToken
Refactor ProgressTracker to support working without a progressToken.
When in task mode, the Actor run status is polled every 5s and the task
store statusMessage is updated even if the client didn't provide a
progressToken for progress notifications.
Closes #555
https://claude.ai/code/session_011o5nwJS86T6dkG889LaefQ
* feat: Send notifications/tasks/status when Actor run statusMessage changes
After updating the task store, also send the MCP-spec
notifications/tasks/status notification so clients get real-time
task status updates without polling tasks/get.
https://claude.ai/code/session_011o5nwJS86T6dkG889LaefQ
* fix: propagate statusMessage to internal tools in task mode and add integration test
The onStatusMessage callback was only wired up for 'actor' type tools but not
for 'internal' tools like call-actor. This meant tasks/get, tasks/list, and
notifications/tasks/status never included statusMessage for internal tool tasks.
- Extract onStatusMessage callback above both tool type branches so it is shared
- Fix streamable HTTP test URL from /mcp to / after route change
- Add integration test verifying statusMessage in tasks/get, tasks/list, and
notifications/tasks/status across all transports
* fix: simplify statusMessage propagation — store only, no notifications
- Remove notifications/tasks/status sending from onStatusMessage callback;
clients retrieve statusMessage via tasks/get and tasks/list polling
- Remove try/catch wrappers in updateProgress — errors propagate to the
interval-level catch in startActorRunUpdates
- Remove onStatusMessage unit tests (covered by integration test)
- Tighten integration test: check stream (tasks/get) and tasks/list separately
- Add TODO for future notifications/tasks/status push support
* fix: restore try/catch in updateProgress, add actor tool task statusMessage test
* docs: add flaky test warning comments linking to #558
* fix: Review feedback for PR #556 (#568)
fix: wrap internal tool branch in try/finally, dedupe tests, add onStatusMessage unit tests
- Wrap internal tool `tool.call()` in try/finally to ensure `progressTracker.stop()`
is always called, matching the actor tool branch pattern. Prevents leaking the
polling interval if the tool throws.
- Extract `assertStatusMessagePropagated()` helper to deduplicate the two nearly
identical statusMessage integration tests.
- Add unit tests for the `onStatusMessage` callback: called with message, not called
when message is undefined, and errors are handled gracefully.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>1 parent 64b4dff commit 73d6465
5 files changed
Lines changed: 202 additions & 83 deletions
File tree
- src
- mcp
- utils
- tests
- integration
- unit
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
1016 | 1023 | | |
1017 | 1024 | | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
| 1025 | + | |
1031 | 1026 | | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1035 | 1039 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1045 | 1049 | | |
1046 | | - | |
1047 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1048 | 1057 | | |
1049 | 1058 | | |
1050 | 1059 | | |
1051 | 1060 | | |
1052 | | - | |
| 1061 | + | |
1053 | 1062 | | |
1054 | 1063 | | |
1055 | 1064 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
40 | 38 | | |
41 | | - | |
42 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
| |||
93 | 108 | | |
94 | 109 | | |
95 | 110 | | |
| 111 | + | |
96 | 112 | | |
97 | | - | |
| 113 | + | |
| 114 | + | |
98 | 115 | | |
99 | 116 | | |
100 | 117 | | |
101 | | - | |
| 118 | + | |
102 | 119 | | |
0 commit comments