Skip to content

Let an autopilot attach files to the sessions it starts #517

Closed

Description

@fctl-sh

An autopilot can't attach files to the sessions it starts: fctl run --attach and fctl send --attach fail in its own session's sandbox. Its sandbox's fctl has no token and relays its requests through fctl-agent and the host as AgentCall::Api, whose body is JSON only (Api::relayed in fctl-client says uploads don't work through it), and fctl_domain::autopilot::allows refuses POST /projects/{id}/attachments and POST /sessions/{id}/attachments. Since #516 it passes screenshots on as links it publishes with fctl publish, which works only where the project publishes screenshots, and the session then has to download the image to see it.

Carl Oscar suggested letting the API take attachments from autopilots too, so that a screenshot people send it reaches a session as an attachment, shown to that session's agent like any other.

  • Protocol: an optional way to carry a binary body in AgentCall::Api (for example body_base64 with a media type), added as optional fields; hosts and agents a version behind keep refusing it.
  • fctl-client and fctl: uploads through the relay, so --attach works in the autopilot's sandbox.
  • Control plane: allows lets an autopilot upload to start a session in its projects (Gate::Open, like starting one) and to sessions it started (Gate::Crew); the relay's frames go through the Worker's stack, so check a 5 MB upload's size against the frame limit and box the large futures (as fctl#505 did).
  • The autopilot's ~/AGENTS.md (feat(autopilot): pass screenshots on to its sessions as published links #516) then tells it to attach rather than publish.

Activity

  1. added
    enhancement
    control-plane
    agents
    on Nov 11, 2026
  2. fctl-sh commented on Nov 15, 2026

    @fctl-sh
    ContributorAuthor

    Another case for this, from the spaghetti autopilot (asked by Carl Oscar what fctl could do better): Carl Oscar attached his .3mf files to one of its sessions, another session needed them later, and the autopilot had to ask him to attach them again. It suggested letting an autopilot forward files people already sent, or keeping files people send available to every session in the projects it manages.

    Forwarding may be the cheaper half of this issue: those files are already stored on the control plane, so an autopilot could send them on by reference, e.g. fctl send shop#43 --forward shop#41 (the files people attached to their messages to shop#41), with no binary body through the relay. Its own uploads (a screenshot people sent it) would still need what this issue describes.

  3. fctl-sh commented on Nov 15, 2026

    @fctl-sh
    ContributorAuthor

    Done in #558, merged as 236de9f: an autopilot attaches files to the sessions it starts and steers (fctl run --attach, fctl send --attach) and reads the files sent in the sessions it reads (fctl files list / fctl files get, new, for people too), through its session's relay as bytes (AgentCall::ApiBytes, POST /api/v1/runner/sessions/{id}/relay).

    It isn't in a release yet. The control plane part reaches app.fctl.sh with main's deploy, but autopilots use it only once their runner runs a release with it (fctl-agent and the host) and their sandbox image's fctl has fctl files. Until then their ~/AGENTS.md keeps telling them to pass screenshots on as published links.

    As Carl Oscar decided, sessions still don't send files they make back to the autopilot: what one makes for another goes on its branch, or as a published screenshot.

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

    agentscontrol-planeenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions