Repository navigation
feat: let comments, failed checks and merges bring agents back - #228
Merged
kalaspuff merged 10 commits intoOct 23, 2026
Merged
Conversation
…failed checks and merges Projects can turn on follow-ups (ProjectSettings.follow_ups): comments that address the agent (@fctl, @agent, or fctl:/agent: at the start) from people who can write to the repository, failed checks of the newest commit, and merges or closes of pull requests fctl's app opened reach the session that opened them, in a message from fctl that resumes it if it stopped. The session gathers what comes together (a review and its comments) for ten seconds, holds failed checks while a turn runs and drops those a newer commit made old news, and passes on at most three failed checks in a row while nobody messages the agent.
fctl projects set --follow-ups comments,checks,closed (or all, none), and fctl projects show says which. fake-claude answers fctl's follow-up messages on its own, so that their words set off none of its behaviors.
…in transcripts A project's Settings get a Pull requests section with three switches: comments that mention the agent, failed checks, and merges or closes. The transcript shows what brought the agent back as GitHub has it: people's comments with their avatars and a review's comments on lines under it, failed checks by name, a merge or close, with what fctl told the agent a click away. A session's pull requests say what brings its agent back.
…cks by GitHub's head GitHub's GraphQL API names an app's bot without [bot] (fctl-sh where REST says fctl-sh[bot]), so lookups now ask for the author's type and spell bots as REST does: otherwise failed checks of fctl's own pull requests never reached their agents. Failed checks are old news once GitHub says the pull request's head is another commit, whoever pushed it, rather than when the agent has another commit checked out, which a person's push to its branch also makes true. Held checks wait ten seconds once the turn ends, for what the agent pushed then. Conversation comments look the pull request up for its branches, and the agent hears where changes go once it merged.
…gent didn't hear A follow_up_held notice carries the follow-up fctl kept from the agent (Notice.follow_up; clients from before it show the message), which the transcript shows as the failed check, muted, with why it wasn't passed on. The settings' copy says what each switch does in fewer words, and a follow-up's hover-only time takes no line of its own on phones.
The architecture (Follow-ups), ADR 0042, self-hosting (the three events the GitHub App subscribes to), the CLI and automation guides, fake-claude's answer in the development guide, the roadmap, and what this repository's agents may count on after they open a pull request.
…ivery once A comment GitHub delivers twice while the first copy still gathers counts as taken once, so that its reaction and audit entry come once.
A comment's delivery is matched to the sessions that list its pull request, and their projects' follow-ups, before any GitHub call, and a comment on the conversation looks its pull request up (with the lighter query reviews use) only where several sessions list it or it merged. Follow-ups that a session couldn't be told of with its pull requests go once more on their own; a delivery without GitHub's ids routes none; Enterprise Managed Users' logins (ada_acme) pass; and grouping returns each follow-up's keys.
…-possible-to-configure-proje # Conflicts: # docs/adr/README.md
kalaspuff
pushed a commit
to hyperstructure/fctl-site
that referenced
this pull request
Oct 23, 2026
The privacy policy says what follow-ups receive, keep and send, for hyperstructure/fctl#228, which lets projects bring their agents back to the pull requests they opened: when someone who can write to the repository mentions `@fctl` or `@agent` in a comment, when a check fails, when a pull request merges or closes. With follow-ups on in a project, app.fctl.sh: - **receives** comments and reviews on pull requests through the GitHub App's webhook (the app subscribes to Issue comment, Pull request review and Pull request review comment), and asks GitHub whether a comment's author may write to the repository; - **keeps** the comments it passes on to an agent (their text, link, and their author's GitHub login and picture), with failed checks and merges, in the session's transcript, and records each comment it passes on in the workspace's audit log, with its author's login and link; - **sends** them to the session's agent, and so to the Claude account it runs on, and **posts** an 👀 reaction on each comment it passes on, which everyone who can read the repository sees. The changes: - **Projects and sessions**: the messages fctl sends agents include, where follow-ups are on, the comments that mention the agent (text, link, author's login and picture), failed checks and merges. - **GitHub**: the webhook also tells us about comments and reviews; which of them we keep and why. - **Audit logs**: each comment passed on, with its author's login and link. - **Why we use it**: a row for passing people's comments to agents and asking GitHub about their access (legitimate interests: letting the people a repository trusts direct its agents from GitHub, and nobody else). - **GitHub** (services you connect): the reaction on comments passed on. - **Anthropic**: what follow-ups pass on goes to the Claude account the session runs on. Retention needs no change: follow-ups are part of the session's transcript, which goes with the project. Session: https://app.fctl.sh/s/ses_01M5M5MN1ME75KPJSE74983JEE Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
kalaspuff
approved these changes
Oct 23, 2026
kalaspuff
deleted the
fctl/161-it-should-be-possible-to-configure-proje
branch
October 23, 2026 12:34
fctl-sh Bot
added a commit
that referenced
this pull request
Oct 23, 2026
#228 gave UserMessage an optional follow_up, which a schedule's first message never carries.
kalaspuff
pushed a commit
that referenced
this pull request
Oct 23, 2026
The deploy of #228 to app.fctl.sh [failed](https://github.com/hyperstructure/fctl/actions/runs/39954400672/job/120417687330#step:8:1) on its first request to Cloudflare's API. `wrangler d1 migrations apply` got a 429 (`Please wait and consider throttling your request speed [code: 971]`, with a `Retry-After` of 40 s) and gave up. Rerunning the job 45 minutes later deployed it. ## Why it failed Cloudflare throttles a token, an account or an address once it has made too many requests (the documented limit is 1,200 per 5 minutes per user). It then answers 429 with a `Retry-After` for up to five minutes, even to a client's first request. That is what happened here, so the requests that used up the limit came from somewhere else: other use of the account's API, or the runner's address. Nothing in a run's logs tells which. fctl.sh's own deploy, about 40 s earlier, made only a dozen or so requests. Wrangler 4.151.1 retries a 429 only in some of `wrangler deploy`'s requests (`retryOnAPIFailure`, waits of up to 60 s). Its D1, KV and secret commands send each request once and fail at the first 429. The newest wrangler, 4.152.0, does the same, so upgrading wouldn't help. ## What changes - `util::retry_throttled` runs a wrangler command that calls the API, and runs it again when the API throttled it. It gives wrangler a `WRANGLER_OUTPUT_FILE_PATH` and reads the `command-failed` entry wrangler writes there (`"code": 971, "retry_after_ms": 40000`), so wrangler keeps its terminal, its prompts and its colours. It waits what the API asks plus a second (a minute for a 971 without a `Retry-After`), at most four attempts in all. It gives up at once on a wait over five minutes, and runs any other failure only once. - Running a command again from the start is safe: a throttled request never ran, `migrations apply` applies only the migrations not applied yet, and the deploy, secret and KV writes end the same way when repeated. - Every wrangler command xtask runs against the API goes through it: `cargo xtask deploy` (migrations, deploy, the secret list after it, `d1 create`), `cargo xtask secrets` and `cargo xtask publish`. That last one covers the Release workflow's KV writes to fctl.sh/releases, which had the same exposure. - docs/self-hosting.md and docs/development.md (Deploying) say so. ## Verification - Unit tests in `xtask/src/util.rs`. They parse the entries wrangler writes, and drive `retry_throttled` with a stand-in `wrangler` script: throttled once then done, throttled every time (it gives up after 4 runs), a failure that isn't throttling (1 run) and a wait over five minutes (1 run). - End to end against a local stand-in for Cloudflare's API (wrangler's `CLOUDFLARE_API_BASE_URL`, a dummy token, telemetry off). It answers the first request of each kind with exactly what Cloudflare sent (429, code 971, `Retry-After: 2`): - Without the fix, `wrangler d1 migrations apply DB --remote` failed with the same output as CI. - `cargo xtask deploy fctl-sh --skip-build` printed `Cloudflare's API throttled wrangler: running it again in 3 s (attempt 2 of 4)`, ran the migrations again and applied the pending one. `wrangler deploy` then failed because no Worker was built here, and that failure was not retried. - `cargo xtask secrets fctl-sh` (the secret list) and `cargo xtask publish` (KV puts) each recovered from a throttled first request. - Against an API that throttles every request: four runs, then `Error: Cloudflare's API throttled wrangler 4 times in a row`. - `cargo xtask check lint` and `cargo xtask check test` pass. Session: https://app.fctl.sh/s/ses_01M5MEKPMFJDMW1AX89Y9N5G6Q Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
kalaspuff
pushed a commit
that referenced
this pull request
Oct 23, 2026
When fctl's review agent posts findings on a pull request that one of fctl's agents opened, fctl passes them on to that agent in a message (#225). The session's transcript showed that message whole: each finding's explanation, then the instructions for the agent and the `gh api` command it answers with. A single finding took most of a page, and several took more. People rarely need to read all of that, so the transcript now shows the review in a few lines, with the whole message a click away. ## What changed - **The message carries the review it is about** (`UserMessage.review`, a new `PassedOnReview`), as follow-ups carry theirs (`UserMessage.follow_up`, #228). It holds the pull request, the commit, the review's summary and session, and for each finding its severity, title, file and lines, and its comment on GitHub. `fctl_domain::reviews::passed_on_review` builds it from the same `Found` as the message's text, in the same order (most severe first, through a shared `order`). The agent gets the same text as before. - **The transcript shows it in a few lines**, styled like a follow-up's failed checks: "fctl's review agent found 2 issues in web#12 at 3f2a1c9", then one line per finding (its title, then its severity and `path:lines`). Each finding's title opens its comment on GitHub, or the review's summary for a finding on lines the diff doesn't show. **What fctl told the agent** opens the whole message. The agent's name opens the review's session, the pull request opens the review's summary, and the commit opens the commit. - **Findings messages sent before this change** have no review in them. They show their first five lines with a **Show all** button. Only these get cut: they are recognized by the words `passed_on` starts them with. Other messages from fctl stay whole, including a scheduled run's task (#229, which sends it as a message from fctl), and so do people's messages. ## Compatibility All additive, no migration. `UserMessage.review` is optional, and clients without it show the message's text as before. The internal `/review-findings` body's new `shown` field defaults to nothing. Neither hosts nor agents read the field. ## How I verified it - **Unit tests** cover the proto wire format, including a message without a review. In the domain, they check that `passed_on_review` lists findings in the message's order and links each by where it is on GitHub: its comment, the summary, or nothing known. Web tests check the findings view (lines, links, one issue, no summary, the message a click away), the transcript (a review goes to the new view, old findings messages get cut, and a short task, a long scheduled task and people's long messages stay whole), and that the builder keeps the review on its item. - `cargo xtask check` passes. One run failed in xtask's `runs_a_throttled_command_again`, an intermittent race in tests from #230 that this branch doesn't touch (#232); the rerun passed. - **End to end in `cargo xtask dev`**, through a temporary route I didn't commit. It hands made-up findings to SessionObject's `/review-findings` as `pass_on` does: the real `passed_on`, `held_back` and `passed_on_review`, the internal call, and the stored event. A session got the finding from the screenshot in the request, and the message's text came out identical to it. fake-claude answered it, and the page showed the review in a few lines. The stored event carried the review (`GET …/events`). An `fctl` binary built from main printed the same event with `fctl logs --json`, without the field, so older clients read it as before. A message sent without the review, like one from before this change, showed its first lines and opened with Show all. I didn't run posting on GitHub, `spots` or `pass_on`'s choice of session against a GitHub stand-in. This change leaves them as they were, and their tests cover them. ## Screenshots From `cargo xtask dev` at 444dfee (the views haven't changed since), with fake-claude's answer after each message. The pull request and finding are the ones from the screenshot in the request. **The message from the request**, light, 1440 px wide: | Before | After | |---|---| |  |  | **On a phone** (390 px): | Before | After | |---|---| |  |  | **Dark:**  **Three findings**, most severe first: one on lines the pull request deletes ("old version"), and one in the review's summary:  **What fctl told the agent**, opened:  **A findings message sent before this change**, which has no review in it:  Session: https://app.fctl.sh/s/ses_01M5MFGRENHK8PHRFQXJ53360Z --------- Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
This was referenced Oct 23, 2026
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.
Projects can now bring their agents back to the pull requests they opened (follow-ups): a comment that mentions the agent, a failed check, a merge. Each reaches the session that opened the pull request in a message from fctl, which resumes the session if it stopped, on the Claude subscription it ran on, as a person's message would. Fixes #8, as the session refined it: comments count only from people the repository trusts, only when they address the agent, and only from people, not apps.
What it does
fctl projects set --follow-ups comments,checks,closed/all/none,ProjectSettings.follow_ups).fctl projects showsays which are on. An update that leaves the field out (an older tab or CLI) keeps what was stored.@fctlor@agentanywhere, or starts withfctl:,agent:,fctl,oragent,(any case). Quotes (>), code (backticks, fenced blocks) and HTML comments don't count, so people can quote a request or write`@fctl`to explain it; edits don't count either. A review that addresses the agent brings its comments on lines.User, not a[bot], so not fctl's own review agents, whose findings already come back on their own path), with anauthor_associationofOWNER,MEMBERorCOLLABORATOR, and GitHub's permission endpoint must say they may write to the repository (admin, maintain or write). A member of an organization who may only read a public repository can't steer an agent that pushes. Everyone else costs no GitHub call.check_run/check_suite/statusdelivery, the lookup names the newest commit's failed checks (failed, timed out or couldn't start, by each check's latest run, and failed or errored statuses; cancelled runs and runs waiting for approval don't count).gh pr comment, orgh api …/comments/{id}/repliesin a thread); which checks failed, what still runs, and how to look into them; after a merge, what may be left to do. It says that only people who can write to the repository reach the agent this way.follow_up.comment).Decisions worth a look
What instance admins need to do
Subscribe the GitHub App to Issue comment, Pull request review and Pull request review comment (Permissions & events). No new permission: the app reads and writes issues and pull requests already, so installations accept nothing. app.fctl.sh's app needs this change for comments; failed checks and merges work with the events it has. Recent Deliveries answers
{"ok":true,"follow_ups":1}for a comment that reached an agent.Compatibility
All additive:
ProjectSettings.follow_ups,UserMessage.follow_up,Notice.follow_up(older clients show the message's text),Features.github_webhook, and the internal/follow-upandPullRequestsSeen.follow_ups.FollowUpEventreads kinds a newer control plane adds asotherinstead of failing the event. No migration: the session object'sfollow_upstable is createdIF NOT EXISTS. Older hosts and agents take follow-ups as any message; fake-claude answers them on its own, so their words set off none of its behaviors.A bug this found on the way
GitHub's GraphQL API names an app's bot without
[bot](fctl-sh, typeBot), where REST saysfctl-sh[bot]. The webhook lookups now ask for the author's type and spell bots as REST does; without that, failed checks of fctl's own pull requests would never have matched. I checked it against #225 with the sandbox's token.How I verified it
fctl_domain::follow_ups(16 tests: addressing, with quotes, code spans, fences, HTML comments, emails,@fctl-sh, team mentions; payload parsing of the three comment events; trust and write access; keys; grouping; every message; the cap), webhook lookups (failed check names, bot authors), settings that keep unsent follow-ups, the proto wire format (and an unknown kind), the CLI flag, fake-claude, and the web helpers and component (follow-ups.test.ts,follow-up.test.tsx).cargo xtask checkpasses.cargo xtask dev, against a local stand-in for GitHub's API and a bare repository standing in foracme/web(not committed; the Worker pointed at it by a local patch I reverted), with signed deliveries:renovate[bot]), aCONTRIBUTOR, aMEMBERGitHub says may only read (the only one that cost a call), a comment without a mention,@fctlin backticks, a quoted request; an archived session; a project with comments off.webalone,issues/pull_requestswrite, revoked).Screenshots
From
cargo xtask devwith the runs above, at f66ec00. GitHub avatars are generated stand-ins.Settings → Pull requests (light, dark, 390 px):
A session brought back by a comment, with what brings its agent back under its pull request:
A review with its comments on lines (light, dark):
Failed checks, then a merge, and what fctl told the agent, opened:
Held back after three in a row:
On a phone (390 px):
Other repositories
Session: https://app.fctl.sh/s/ses_01M5M5MN1ME75KPJSE74983JEE