Repository navigation
feat: let agents publish screenshots for pull requests on fctl - #71
Merged
kalaspuff merged 7 commits intoOct 18, 2026
Merged
Conversation
GitHub takes no uploads from a session's GitHub App token, so agents can't attach screenshots to pull requests (#40). Agents in projects that opt in now publish them with `fctl publish`: fctl-agent hands the image to the host, which uploads it with its runner token; the control plane keeps it in the project's FilesObject and serves it at a link with a 256-bit random token until it expires (30 days by default, 1 to 60 days per project). Publishing needs the instance's admins to allow it and the project to turn it on; both are off by default, and turning either off takes the screenshots offline. The transcript shows each published screenshot in a notice, people who manage its session can delete it sooner (`fctl unpublish`), and `cargo xtask dev` publishes one when fake-claude is asked for a screenshot.
Admin → Settings gets the instance's switch, the project's agent settings get theirs with how long links work, and the transcript shows each screenshot the agent published, with its Markdown to copy and, for people who manage the session, a way to delete it sooner.
The architecture, an ADR, the CLI and security docs, and the screenshots skill, which now says how a session shows its screenshots: attach them where GitHub takes them, and publish them with fctl publish where it doesn't.
…s-seemingly-can-t-attach-sc # Conflicts: # crates/fctl-domain/src/settings.rs # crates/fctl-host/src/session.rs # crates/fctl/src/cmd/projects.rs # docs/adr/README.md # docs/cli.md # web/src/components/session/transcript.tsx # web/src/routes/session.tsx
This was referenced Oct 18, 2026
kalaspuff
deleted the
fctl/35-as-github-apps-seemingly-can-t-attach-sc
branch
October 18, 2026 14:33
kalaspuff
pushed a commit
that referenced
this pull request
Oct 25, 2026
…lp (#277) ## Summary `fctl publish --help` and `fctl review --help` printed parts of their help far to the right: their texts went on to new lines without a `\`, so the spaces that indent those lines in the source came out in the help. `fctl publish --help` printed its second sentence and its examples 22 to 24 spaces in, and `fctl review --help` four of its five examples 30 spaces in. Both now read like the other commands' help. They came in with #71 and #223. A new test walks every command's help texts (descriptions, before and after help, and every argument's help) and fails on a line indented by more than 8 spaces, which is as far as any help indents on purpose (`fctl review submit --help`'s JSON example). It fails on main's `fctl publish` and passes with this change. Found while working on the pull request below; it's separate so that it gets its own line in the release notes. - #276 `fctl review --help`, ending with, before: ``` Examples: fctl review # the project's reviews, newest first fctl review settings --on --effort high fctl review start acme/web#12 fctl review threads # a review agent, in its sandbox fctl review submit review.json # a review agent, in its sandbox ``` After: ``` Examples: fctl review # the project's reviews, newest first fctl review settings --on --effort high fctl review start acme/web#12 fctl review threads # a review agent, in its sandbox fctl review submit review.json # a review agent, in its sandbox ``` [fctl session](https://app.fctl.sh/s/ses_01M5SSYJC8AZTVMF34HFYXXB8H) Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub takes
gh pr create/edit --attachuploads only with a person's token, and sessions have the GitHub App's, so agents couldn't show screenshots in pull requests (#40). They now fall back to publishing them on fctl, at a link that's practically impossible to guess, and put that link in the pull request. Projects opt in, and so must the instance.What changed
fctl publish shot.pngworks in a session's sandbox. fctl-agent takes the image over the session socket and checks it. The host uploads it with its runner token (POST /api/v1/runner/sessions/{id}/published), and the control plane stores it in the project's FilesObject. fctl prints the link and Markdown to paste, and--jsongives the same data.https://app.fctl.sh/api/v1/published/<token>/<name>. The token is 256 random bits, and D1 (published_files) keeps only its SHA-256. Anyone with the link can open the image, including GitHub's image proxy. Responses arenosniff, have the same sandboxing CSP as attachments,Cross-Origin-Resource-Policy: cross-originandX-Robots-Tag: noindex, and arepublic, no-cachewith an ETag, so a deleted or expired image stops showing (a matchingIf-None-Matchgets 304).screenshot_days), which covers the 24 hours to 60 days asked for. The FilesObject's alarm deletes the bytes, and the hourly cron trigger deletes the rows.fctl admin set --publish-screenshots on. It is stored in D1'ssettingsasInstanceSettings.fctl projects set --publish-screenshots on --screenshot-days 7.~/AGENTS.mdgets a section only where the project publishes and the sandbox's fctl has the command. It says to try--attachfirst and to publish when GitHub refuses. It also says how long links last, to publish nothing secret, and to say so if it publishes something by mistake.screenshot_publishednotice carrying the file. The web app shows the image with Copy Markdown and, for people who manage the session, Delete behind a confirmation. Deletion is also available asfctl unpublish <link>andDELETE /api/v1/published/{token}. Viewers and editors can't delete.screenshot.published,screenshot.deletedandinstance.settings_updated.screenshotbehavior draws a small PNG and publishes it, socargo xtask devexercises the whole path.screenshotsskill, which now says to publish when--attachis refused.Compatibility
ProjectSettings.publish_screenshotsandscreenshot_days,Notice.published,Features.publish_screenshots,publish/published) and a new session-socket request.fctl publish, and nothing waits on an answer it can't give.fctl logsandfctl attach.0010_published_files.sqlis new. The FilesObject creates its table withIF NOT EXISTS.keep_unsent), so an older CLI can't quietly turn publishing off or lengthen retention.How I verified it
cargo xtask checkpasses: fmt, gen, Biome and tsc, clippy native and wasm, all Rust and web tests, and the web build. It passes again after mergingmain(feat: stop idle sessions after ten minutes and resume them for a message #67, build(deps): use @hyperstructure/design v0.4.0 #68, feat: show when a session's runner is away or can't reach its agent #69).keep_unsent, and the wire formats,cargo xtask dev:fctl publishrefuses ("This project doesn't publish screenshots…") and~/AGENTS.mdhas no screenshots section.~/AGENTS.mdsays 7 days. The link serves the exact bytes with the headers above; HEAD works,If-None-Matchgets 304, and a wrong token gets 404.fctl unpublish(or Delete in the web app): 404./admin/settings.--screenshot-days 61is rejected by the CLI, and0by the API.Screenshots
At 654ec0c, against
cargo xtask dev. This session can't attach them:gh pr edit --attachrefuses its token, which is what this pull request fixes, and app.fctl.sh won't havefctl publishuntil it ships. What they show:160×90 · 43 KB), Copy Markdown and Delete. At 390 px the actions wrap under the image.After it merges
fctl publishwith hosts and sandbox images of that release.Refs #40. This covers screenshots and both skills. It doesn't publish short video recordings (
.webm/.mp4): GitHub doesn't play videos from other hosts in a description, and Safari needs range requests to play them from a link. Animated GIF and WebP do work.Session: https://app.fctl.sh/s/ses_01M57K8M7GHV0F7BR9NN41P6WZ