Skip to content

fix: leave done sessions out of Needs you after an answer - #496

Merged
kalaspuff merged 2 commits into
mainfrom
fctl/1071-i-have-a-needs-you-message-for-a-session
Nov 9, 2026
Merged

kalaspuff merged 2 commits into
mainfrom
fctl/1071-i-have-a-needs-you-message-for-a-session

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Needs you kept a finished session as "Waiting for your reply" when the last message someone sent it only answered its agent's question. Since #455 a session leaves Needs you once its pull requests are all merged or closed and nobody wrote to it since, but an answer counted as writing to it. So an agent that asked something after the merge stayed in Needs you, the tab title and the app icon until its idle timeout stopped the session, about 10 minutes after its last turn. That's what happened in the session that shipped #493: after the merge its agent asked whether to re-run main's failed deploy job, and Carl Oscar answered "I re-ran it".

SessionDO now also records when a person last sent a message that didn't answer the agent's question, in a new optional requested_at on the session, written through to D1 (migration 0056_session_requested_at.sql). Needs you compares the merge with requested_at instead of messaged_at. So an answer alone leaves the session done, while someone who asks for more after the merge still sees the reply, even if they also answer a question the agent asks along the way. messaged_at keeps its meaning, since the autopilot in #494 reads it to tell that a message is about to wake a session. Hosts and agents are unaffected.

The migration fills requested_at from messaged_at for existing sessions, as their answers can't be told apart, and SessionDO's write keeps that value until a message sets its own. Sessions that were idle when this deploys, with a message after their merge, can still drop out of Needs you early: a live update from their session object carries no requested_at.

Verified with unit tests in needs.test.ts, and in cargo xtask dev with fake-claude sessions. The migration filled requested_at on existing sessions, and a rename (a write without it) kept it. A session that asked with fctl ask and was answered with fctl send got messaged_at but no requested_at. One sent a request, then asked about it and was answered, kept the request's time. That held in the session and in the session list alike. In the browser, with merged pull requests patched into the session lists (the dev stack has no GitHub), the first left Needs you and the second stayed. cargo xtask check --quick passes.

Screenshots

Needs you in cargo xtask dev, for two sessions whose pull requests merged before anyone wrote to them. "Only answered its question" got just an answer. "Asked for more, then answered" got a request, then an answer to what its agent asked about it. Before: today's rule, which compares the merge with the last message. After: only the session with more to do waits for a reply.

Before After
before.png after.png

Related

Worth confirming

  • Decision: whatever a person sends while the agent asks counts as the answer, typed or clicked, as it already does for clearing the question. "I re-ran it, and also look at X" is an answer too: if the agent does X without opening a pull request, its reply doesn't show in Needs you. Followers still get the "waits for your reply" notification when that turn ends.
  • Decision: the migration is numbered 0056, as feat: put a project on autopilot (experimental) #494 takes 0055. D1 applies whichever it hasn't, in either merge order.

fctl session


Note

Medium risk. It adds a D1 column with a backfill and changes a field on the public session API, though the effect is limited to what the web app's Needs you list shows.

What it does. Leaves a session out of the web app's Needs you list when its pull requests are all merged or closed and the only message since was an answer to its agent's question. It tracks this with a new requested_at time, set when a person sends a message that doesn't answer a question, and the list compares the merge time with it instead of with messaged_at.

Migration and API field. Migration 0056_session_requested_at.sql adds sessions.requested_at and fills it from messaged_at for existing sessions; the session API gains requested_at.

fctl review's first look at 92d961b · 11 files, +96 −23 · Review agent settings

Needs you lists a session whose pull requests are all merged or closed
as waiting for a reply only when someone wrote to it after the last of
them was. An agent that asked after the merge (whether to re-run a failed
deploy, say) and got its answer stayed there, as "Waiting for your
reply", until its idle timeout stopped the session.

SessionDO now notes when a person's message answers the agent's question
(Session.answered_at, written through to a new sessions.answered_at
column, migration 0056), beside messaged_at, which keeps its meaning.
Needs you treats a last message that only answered the question as
asking nothing new of the agent.
@fctl-review

This comment has been minimized.

Comment thread web/src/lib/needs.ts Resolved
Replaces answered_at with requested_at: when a person last sent the
session a message that didn't answer its agent's question. Needs you
compares the merge with it, so that someone who asks for more after the
merge, then answers a question the agent asks about it, still sees the
reply, while an answer alone leaves the session done.

Migration 0056 (not shipped) fills requested_at from messaged_at for
existing sessions, and SessionDO's write keeps D1's value while its
summary has none.
@kalaspuff
kalaspuff merged commit dbc8bc2 into main Nov 9, 2026
12 of 14 checks passed
@kalaspuff
kalaspuff deleted the fctl/1071-i-have-a-needs-you-message-for-a-session branch November 9, 2026 19:07
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