Repository navigation
fix: leave done sessions out of Needs you after an answer - #496
Merged
kalaspuff merged 2 commits intoNov 9, 2026
Merged
Conversation
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.
This comment has been minimized.
This comment has been minimized.
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
approved these changes
Nov 9, 2026
kalaspuff
deleted the
fctl/1071-i-have-a-needs-you-message-for-a-session
branch
November 9, 2026 19:07
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.
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_aton the session, written through to D1 (migration0056_session_requested_at.sql). Needs you compares the merge withrequested_atinstead ofmessaged_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_atkeeps 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_atfrommessaged_atfor 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 norequested_at.Verified with unit tests in
needs.test.ts, and incargo xtask devwith fake-claude sessions. The migration filledrequested_aton existing sessions, and a rename (a write without it) kept it. A session that asked withfctl askand was answered withfctl sendgotmessaged_atbut norequested_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 --quickpasses.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.Related
Worth confirming
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_attime, set when a person sends a message that doesn't answer a question, and the list compares the merge time with it instead of withmessaged_at.Migration and API field. Migration
0056_session_requested_at.sqladdssessions.requested_atand fills it frommessaged_atfor existing sessions; the session API gainsrequested_at.fctl review's first look at
92d961b· 11 files, +96 −23 · Review agent settings