You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 3, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 3, 2026. It is now read-only.
MetaOrigin is missing 'MCP' — every MCP-launched run crashes at finalize #72
The platform now stamps MCP-launched Actor runs with meta.origin = 'MCP', but MetaOrigin in apify_shared/consts.py only defines nine values — DEVELOPMENT, WEB, API, SCHEDULER, TEST, WEBHOOK, ACTOR, STANDBY, CLI — with no MCP.
Effect
apify-client deserializes the run object via ActorRun.model_validate whenever Actor.set_status_message runs — including the SDK's own finalize(), which calls set_status_message(..., is_terminal=True). On a run with origin='MCP' that validation raises:
pydantic_core.ValidationError: 1 validation error for ActorRun
meta.origin
Input should be 'DEVELOPMENT', 'WEB', 'API', 'SCHEDULER', 'TEST', 'WEBHOOK', 'ACTOR', 'STANDBY' or 'CLI' [type=enum, input_value='MCP', input_type=str]
The traceback is entirely inside the SDK (apify/_actor.pyset_status_message → finalize → ActorRun.model_validate), and it fires after the Actor's actual work has already succeeded. So a run that analyzed its input and wrote its output correctly is still marked FAILED at finalize. For an Actor designed to be called over MCP, this fails every run.
Reproduce
Launch any Python Actor through the Apify MCP (mcp.apify.com / call-actor). The run gets meta.origin='MCP' and crashes at finalize with the error above. Confirmed against the latest published apify-shared (the value is absent on master too).
Ask
Add MCP = 'MCP' to MetaOrigin.
Workaround in the meantime
For anyone hitting this before the enum ships: wrap Actor.set_status_message and swallow the ValidationError when it's about meta.origin — the status is already set on the platform by the time validation runs, so only the typed return value is lost (and callers ignore it).
Activity