feat: Split get-actor-run into data + -widget tools#734
Conversation
57df5bc to
8b19378
Compare
f837504 to
4e18bed
Compare
8b19378 to
66c1cae
Compare
4e18bed to
e98eb0c
Compare
66c1cae to
153dc48
Compare
e98eb0c to
2fb2e87
Compare
2fb2e87 to
293b758
Compare
5422636 to
48ac831
Compare
7ad1d42 to
2d70f8c
Compare
48ac831 to
f1764e6
Compare
There was a problem hiding this comment.
Pull request overview
This PR completes the decoupled “data tool + -widget tool” rollout for Actor run status retrieval by making get-actor-run mode-independent and adding an apps-only get-actor-run-widget tool for rendering the live progress UI.
Changes:
- Makes
get-actor-runa single shared, data-only tool across default/apps modes and removes widget metadata from the base tool. - Adds
get-actor-run-widget(apps-only) to render the Actor run progress widget with widget_metaon tool + response. - Updates server instructions and unit tests to reflect the split and new disambiguation rules.
Reviewed changes
Copilot reviewed 52 out of 53 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/tools/core/get_actor_run_common.ts |
Converts base get-actor-run metadata to data-only and adds widget response _meta enhancements. |
src/tools/apps/get_actor_run_widget.ts |
Introduces the new apps-only widget tool for Actor run progress. |
src/tools/apps/get_actor_run.ts |
Removes the former apps-mode variant (widget behavior moved to the new tool). |
src/tools/categories.ts |
Registers get-actor-run as mode-independent and adds get-actor-run-widget under the ui category (apps-only). |
src/utils/server-instructions/index.ts |
Updates widget workflow rules and adds the get-actor-run vs get-actor-run-widget disambiguation bullet. |
src/const.ts |
Adds HelperTools.ACTOR_RUNS_GET_WIDGET. |
tests/unit/tools.get_actor_run.widget.response.test.ts |
Adds unit coverage for widget tool response/tool _meta and schema behavior. |
tests/unit/tools.mode_contract.test.ts |
Updates mode contract assertions to include the new widget tool and base tool category mapping. |
tests/unit/tools.categories.test.ts |
Updates expectation that get-actor-run is the same tool instance across modes. |
tests/integration/suite.ts |
Renames the get-actor-run integration test title to reflect the data-only base tool. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
58758b1 to
fdc5b62
Compare
MQ37
left a comment
There was a problem hiding this comment.
🔴 Blocker — paymentRequired: true regression breaks agentic-payment run reads
getActorRunMetadata lost paymentRequired: true (src/tools/core/get_actor_run_common.ts), and the new getActorRunWidgetTool doesn't set it either. Both get-actor-run and get-actor-run-widget are now unpaid.
Verified with mcpc against ?payment=x402: master advertises _meta.x402 + x402 description hint, this branch doesn't.
Why this matters: in agentic-payment mode, the paymentRequired flag is what engages the Skyfire/x402 plumbing the MCP server needs to read run data. Without it, run-status calls (and the widget's auto-polling) won't work for agentic-payment users.
Fix: restore paymentRequired: true on getActorRunMetadata (re-inherits into defaultGetActorRun) and add it to getActorRunWidgetTool. Sibling PR #724 kept it on both halves of the call-actor split — same posture expected here. Worth adding a unit assertion to lock this in. Tracked in #766 (automated agentic-payment integration tests).
|
@jirispilka also these integration tests are failing: |
|
Opened #768 (stacked on this branch) with a small integration test asserting |
|
@MQ37 the tests are passing now. |
Final step (6 of 6) of the #577 umbrella rollout. Mirrors the decoupled-pattern recipe from #722 (fetch-actor-details), #723 (search-actors), and #724 (call-actor): - get-actor-run is now mode-independent and data-only. No tool-level widget _meta in either mode; runs category entry is a plain ToolEntry instead of a mode map. - New get-actor-run-widget (apps-only) renders the live progress widget. Input is strict: { runId } only. Tool- and response-level widget _meta (ui.resourceUri = ui://widget/actor-run.html). Reuses the shared buildGetActorRunSuccessResponse({ widget: true }) helper. - buildGetActorRunSuccessResponse widget branch now also sets openai/widgetDescription on the response _meta, matching the other three widget tools. - Apps server instructions: added the fourth disambiguation bullet pairing get-actor-run (silent data lookup) with get-actor-run-widget (live progress widget), using the same vocabulary as the existing three splits. WORKFLOW_RULES untouched — the "NEVER poll get-actor-run after call-actor-widget" rule is orthogonal. - Deleted src/tools/apps/get_actor_run.ts; widget rendering now lives in the sibling tool rather than a mode toggle. https://claude.ai/code/session_01SF9P6g91UrVMahn4bLsUNf
- Drop stale rolling-rollout note from server-instructions header (split is now complete) - Extend "no polling after widget" rule to also cover get-actor-run-widget - Rename integration test to drop misleading "widget" label (it exercises the data tool) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…768) Asserts that tools with paymentRequired: true advertise _meta.x402 with the expected fields (scheme, network, asset, payTo, amount) when the server runs in x402 payment mode, and that free tools do not. Pins the expected paid set with a hardcoded list so silent drift (e.g. a tool losing paymentRequired) is caught here. Tracks #766.
…mCount to totalItemCount
f84b1b3 to
378fb32
Compare
PR chain — part of #577
Step 6 of 6 in the #577 umbrella rollout.
Stacked on #724 (branch
claude/call-actor-split-I2C7T); rebase tomasteronce #720–#724 merge.openai→appsfetch-actor-detailssplit (pilot)search-actorssplitcall-actorsplitget-actor-runsplitCloses #719. Completes the umbrella.
Summary
Final application of the decoupled pattern validated in #722 / #723 / #724.
get-actor-runis now mode-independent and data-only. No tool-level widget_metaineither mode; the
runscategory entry is a plainToolEntryinstead of a mode map.get-actor-run-widget(apps-only) renders the live progress widget. Input isstrict:
{ runId }only. Tool- and response-level widget_metawithui.resourceUri = ui://widget/actor-run.html,visibility = ['model','app'], non-emptycsp. Reuses the sharedbuildGetActorRunSuccessResponse({ widget: true })helper.buildGetActorRunSuccessResponsewidget branch now also setsopenai/widgetDescriptionon response
_meta, matching the other three widget tools.get-actor-run(silent data lookup) with
get-actor-run-widget(live progress widget), using the samevocabulary as the three preceding splits.
WORKFLOW_RULESuntouched — the "NEVER pollget-actor-runaftercall-actor-widget" rule is orthogonal to this split and stillvalid under today's auto-polling
call-actor-widget.src/tools/apps/get_actor_run.ts— widget rendering now lives in the siblingtool rather than a mode toggle on a shared handler.
No
-internalequivalent existed forget-actor-run, so no deletion on that side.Tests
npm run type-check— passesnpm run lint— passesnpm run test:unit— 615 passednpm run build— passesTest plan
npm run type-checknpm run lintnpm run test:unitnpm run buildnpm run test:integration) — human-run per CLAUDE.mdtools/callwith a realAPIFY_TOKENand runId — manualapify-mcp-server-internalimpactPurely additive surface on the widget side. Base
get-actor-runkeeps the same name andbyte-identical input/output schemas across modes, so the hosted server should continue
working with no edits. The only potentially-breaking rename is the shared
buildGetActorRunSuccessResponsenow emitsopenai/widgetDescriptionon the response —harmless for consumers that ignore extra
_metakeys. Please confirm on the internalside.
https://claude.ai/code/session_01SF9P6g91UrVMahn4bLsUNf