Skip to content

feat: move Linear tickets through In Progress, In Review and Done - #322

Merged
kalaspuff merged 6 commits into
mainfrom
fctl/448-when-an-agent-starts-working-on-a-linear
Oct 28, 2026
Merged

kalaspuff merged 6 commits into
mainfrom
fctl/448-when-an-agent-starts-working-on-a-linear

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Delegated Linear tickets never moved to In Progress. Linear starts every delegation's agent session thread with a comment of its own ("This thread is for an agent session with fctl."). fctl took any comment for a mention, so it skipped the move and told the agent that someone had mentioned fctl with those words. fctl now tells delegations from mentions by Linear's words. It also moves a session's ticket through its team's workflow as the session works:

  • In Progress as a delegated ticket's session starts, also when the delegation reaches a session already on it. A mentioned ticket moves once its agent changes something.
  • In Review when a turn ends with the session's pull request open for review.
  • Done once the session's pull requests have merged, none is still open, and one of them completes the ticket (Fixes ENG-123, not Part of ENG-123). The session's alarm has the control plane read their titles, descriptions and branches from GitHub as they merge. When GitHub, D1 or Linear can't answer, it tries again after a minute, ten minutes, an hour and six hours, since nothing else would.

Moves only go forward and never out of done or canceled. Each has a per-project switch, all on by default: the Tickets tab, or fctl projects set --linear-start/--linear-review/--linear-done. The tab and fctl workspaces linear teams name the states fctl found in the team's workflow. Agents are told what fctl moves. They move a ticket that needs no pull request to Done themselves, and in sessions that didn't start from a ticket they move the tickets their task works on. ADR 0063 records the decisions.

The Linear stand-in now starts a delegation's thread the way Linear does. I reproduced the bug with it in cargo xtask dev: ENG-1 stayed in Todo, and the agent was told "Dev Owner mentioned fctl … This thread is for an agent session with fctl.". With the fix:

  • a delegation moves its issue to In Progress and the agent hears it was delegated;
  • a mention whose agent writes a file moves its issue to In Progress;
  • a mention that only asks a question stays in Todo.

The smoke test now checks the first of these, and cargo xtask check and cargo xtask dev --smoke pass. In Review and Done couldn't run end to end: dev projects have no repository, so their sessions open no pull requests. Unit tests cover how far a session has come, which state that means in a workflow, and whether a pull request completes a ticket.

Screenshots

At 3e10eaf: a project's Tickets tab with Linear chosen, 1440 px wide. Three switches replace "Start tickets as their sessions start", each naming the state fctl found in the team's workflow. The delegation steps say how the ticket moves on, and the picture of a delegated ticket shows it In Review once its pull request is up.

Before After
Before: the Tickets tab, light After: the Tickets tab, light
Before: the Tickets tab, dark After: the Tickets tab, dark

The switches at a phone's width (390 px):

After: the ticket states at 390 px

Worth confirming

  • Decision: A mention moves its ticket to In Progress only once its agent changes something, because a mention may only ask a question. A delegation moves it at once, as Linear asks of agents.
  • Decision: In Review comes when a turn ends with a non-draft pull request open, not as the pull request opens. By then the agent has waited for CI, and Linear's GitHub integration has made its own default move to In Progress on open, which a move at the same moment would race.
  • Decision: Done needs every pull request of the session merged or closed, and one merged that completes the ticket, read as Linear reads magic words. Fixes/Closes/Resolves ENG-123 complete it; Part of/Refs/Related to don't. With neither, the key in the title or branch (which fctl names after the ticket) counts. When GitHub or Linear can't answer, fctl stops trying after about seven hours.
  • Decision: The new moves are on by default, so existing Linear projects get them once this deploys. A team whose Linear GitHub integration moves tickets elsewhere on merge (to a QA state, say) needs to turn fctl's Done off.
  • Decision: In sessions that didn't start from a ticket, agents are told to move the tickets they work on themselves, since fctl doesn't know which those are. A merge of their pull requests moves nothing unless Linear's GitHub integration does.
  • Assumption: Linear's delegation comment starts with "This thread is for an agent session". This comes from other open-source agents built on Linear (Cyrus, Roomote, agentconnect), not from Linear's docs; I couldn't try it against Linear itself.
  • Assumption: A team's review state is its first started state with the word "review" in its name. Teams without one stay in their first started state.

fctl session

fctl-sh Bot added 4 commits October 28, 2026 20:05
…ons work

Linear starts every delegation's agent session thread with a comment of
its own ("This thread is for an agent session with fctl."), which fctl
took for a mention: delegated tickets never moved to In Progress, and
agents heard that someone mentioned fctl with those words. fctl now
tells them apart, and moves a session's ticket on as it works: to its
team's first started state as a delegation starts, or once a mentioned
session's agent changes something; to its review state when a turn ends
with a pull request up; and to its first completed state once the
session's pull requests merged, one that completes the ticket among
them. Each move has a project setting, on by default.
…the docs

move_on reads the project's switches before it makes a Linear client, so
sessions of projects that turned the moves off cost nothing there. ADR
0063 records the decision, and the guides say how fctl moves Linear
tickets on. The Tickets tab's hints say a mention's ticket starts once
its agent changes something, and its picture of a delegated ticket shows
it In Review once its pull request is up. The smoke test checks that a
delegation reaches the agent as one.
A session's ticket was in its project's Linear team (and project) when
the session started; move_on now checks it still is before moving it,
as every other ticket call does.
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner October 28, 2026 20:15
@fctl-sh

This comment has been minimized.

Comment thread crates/fctl-control/src/do_session.rs Resolved
Comment thread crates/fctl-control/src/delegations.rs Resolved
Comment thread crates/fctl-control/src/do_session.rs Resolved
Comment thread crates/fctl-domain/src/tickets.rs Resolved
Comment thread web/src/components/project/tickets.tsx Resolved
…and retry

fctl's review of b034f2a found that a ticket stayed In Review when the
last open pull request closed unmerged after another merged, and when
GitHub or Linear couldn't answer as one merged. The session now asks for
the Done check whenever its pull requests become all merged or closed,
or one more merges while none is open, and its alarm runs the check,
trying again after a minute, ten minutes, an hour and six hours when
GitHub, D1 or Linear couldn't say. A batch that ends a turn leaves the
moves to the turn's end, so a ticket moves and the transcript says so
once; a pull request whose state nobody looked up yet no longer counts
as up for review; and the Tickets tab says Done follows a pull request
that fixes the ticket.
@fctl-sh

This comment has been minimized.

Comment thread crates/fctl-control/src/delegations.rs Resolved
fctl's review of 3e10eaf found that a pull request first reported
already merged could reach the Done check before the session recorded
it in pull_request_sessions: the check found nothing to read and
settled as not done. It now asks again later, as when GitHub can't
answer.
@kalaspuff
kalaspuff merged commit 06b07a1 into main Oct 28, 2026
10 checks passed
@kalaspuff
kalaspuff deleted the fctl/448-when-an-agent-starts-working-on-a-linear branch October 28, 2026 22:03
kalaspuff pushed a commit to hyperstructure/fctl-site that referenced this pull request Oct 29, 2026
…88)

## Summary

The privacy policy's Linear entry now says what fctl does there as it
works today: it moves a ticket on through its team's workflow as its
session works (to In Progress, In Review and Done, as the project lets
it), which it has done since hyperstructure/fctl#322, rather than only
to its first started state. It also says agents reach "the tickets their
project takes from Linear" instead of "the tickets of their project's
team", which stays true once a project can take tickets from several
teams (hyperstructure/fctl#331), so this can merge before, with or after
that pull request. What fctl stores and who receives it don't change;
`updated` moves to today.

- hyperstructure/fctl#331

[fctl session](https://app.fctl.sh/s/ses_01M63YR66H5WGRSBA13X57VW9B)

---------

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant