Skip to content

pull-actor: read a version's source files back, the counterpart of push-actor #1427

Description

@DaveHanns

Problem

push-actor has no counterpart: an agent can ship source to the platform but cannot read it back. An Actor whose code is not in the sandbox, because it was pushed from another machine or created in Apify Console, cannot be fixed over MCP; the agent has to ask the user for the files. apify pull does this for the CLI.

Proposal

A pull-actor tool in the versions category taking actor (ID or name) and an optional versionNumber (defaults to the only version). For a SOURCE_FILES version it returns the files as push-actor takes them: path, content, and base64 encoding for binary files, straight from GET /v2/acts/{actorId}/versions/{v}. For a TARBALL version it downloads the zip and unzips it. Versions from a Git repository or gist are reported as such, not fetched: the response carries the sourceType and the repository URL with its branch and subdirectory (https://…/repo.git#branch:subdir), and tells the agent to clone it in its sandbox. The server does not clone arbitrary URLs, and private repositories are reachable only with the platform's deployment key, which the MCP server does not have; the agent's own git access does the job.

Notes

  • Git-sourced Actors and push-actor. As in the CLI, push-actor with mode: replace on a GIT_REPO or gist version switches it to files hosted on Apify, and the repository stops deploying. The CLI warns the user when it does this; pull-actor must say it up front ("this Actor builds from repository X, branch Y; commit there, a push would detach it"), and push-actor should say in its response that the switch happened (a small follow-up on feat: Add push-actor tool #1333).

  • Sources can be up to 3 MiB inline and larger as a zip, so the response needs a size guard: report file paths and sizes always, and let the caller pick files or accept a cap on the total returned. The design decides where the cap sits.

  • The files come back in the exact shape push-actor accepts, so pull, edit, push is a round trip.

  • Secrets are not involved; environment variables are not part of the source.

Part of #1351.

Draft PR: #1433

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions