Skip to content

feat: agents ask people for their input with fctl ask - #441

Merged
kalaspuff merged 5 commits into
mainfrom
fctl/850-agents-ask
Nov 7, 2026
Merged

kalaspuff merged 5 commits into
mainfrom
fctl/850-agents-ask

Conversation

@fctl-sh

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

Copy link
Copy Markdown
Contributor

Summary

Agents can now say they need a person. Instead of ending a turn with a question buried in their last message, an agent runs fctl ask "Round Danish prices to whole kroner, or keep øre?" -o "Round to whole kroner" -o "Keep øre" and ends its turn. The question shows above the session's composer with its answers as one-click replies, in blue on the Agent Floor, project pages and the sidebar, and in fctl show and fctl sessions. People who follow the session get a notification of its own: "shop#231 asks you", with the question and its answers. Any message from a person answers it: an answer clicked is sent as the reply as it is, and the question goes away.

  • How it travels. fctl ask goes through fctl-agent and the host to the control plane like fctl memory (AgentCall::Ask), so no credential enters the sandbox. SessionDO keeps the session's one open question (Session.question, written through to sessions.question by migration 0051), broadcasts it at once, and drops it when it delivers a message with an author, whether it came from the page, the CLI or Linear. fctl ask --withdraw takes it back, and a new question replaces the old one. Review agents ask nobody.
  • Notifications. A turn that ends with a question open notifies as Kind::Asking instead of an ordinary finished turn, to people who want to hear when a session waits for them. A question asked after the turn ended notifies at once.
  • Agents. fctl-agent tells Claude about fctl ask where the sandbox's fctl has it, instead of "say so plainly and stop", and writes a question_asked notice so the question stays in the transcript after it is answered. fake-claude asks with ask <question> / <answer> / <answer>.

I tested it end to end in cargo xtask dev with fake-claude: the question went through fctl-agent and the host, showed on the page, in the list and in fctl show, and clicking an answer sent it and cleared the question. Unit tests cover the validation, the notification text and digests, the CLI's arguments, fctl-agent's instructions, fake-claude's word matching and the question card. Clippy (native and wasm), the touched crates' tests, npm run check and the web tests pass. ADR 0078 records the decision.

Hosts and fctl-agents from before this refuse the call, and fctl ask then tells the agent to update the runner's fctl. Their agents keep the old instruction, because fctl-agent checks whether the sandbox's fctl has fctl ask.

Screenshots

From cargo xtask dev at 79f528c, 1440 px wide, cropped to the page.

What the agent asks, above the composer, and in the transcript:

The question card, dark
The question card, light

After clicking an answer: it's sent as the reply, and the question goes:

Answered

The Agent Floor:

A session that asks, on the Agent Floor

Related

The sidebar work comes in four pull requests: #440 (merged), this one, #442, and #443, which builds the tree sidebar on all three. This branch has main merged in since #440 merged. #441 and #442 both add a command on neighboring lines of fctl's main.rs, so whichever merges second needs main merged in first; #443 shows how that resolves.

Worth confirming

  • Decision: any message from a person answers the question, not only one sent from the card. People often answer in their own words, and a question that lingered after a reply would be noise.
  • Decision: questions notify through the existing "waits for your reply" setting, with no setting of their own.
  • Decision: one open question per session; asking again replaces it.

fctl session


Note

Medium risk. It adds a field to the session protocol, a new migration, a new agent-facing call and a new API and state in the session Durable Object, all of which hosts and agents one version behind must tolerate.

What it does. Adds fctl ask, which lets an agent put a question to people, with optional answer choices, in the middle of a session. The question is stored on the session, shows in lists, the sidebar and a card on the session page, and is cleared when a person answers or when the session fails or is stopped. A late question on a stopping, stopped or failed session is refused, and an identical repeat changes and notifies nothing.

New migration and protocol field. 0051_session_questions.sql adds a column for the open question, and the session types in fctl-proto gain an optional question, so older hosts and agents keep working without it.

fctl review's first look at 725e138 · 40 files, +1236 −132 · Review agent settings

An agent that needs a person to go on asks with fctl ask, offering
answers to click (-o), and ends its turn. The call goes through
fctl-agent and its host like fctl memory (AgentCall::Ask). SessionDO
keeps the session's one open question (Session.question, written
through to sessions.question by migration 0051), shows it to viewers
and dashboards at once, and drops it when a person's message arrives.
Followers hear of it as the turn ends, in a notification of its own:
"shop#231 asks you", with the question and its answers.

The session page shows the question above the composer with its
answers as buttons; the transcript keeps a question_asked notice; the
Agent Floor, project pages and the sidebar show sessions that ask in
blue; fctl show and fctl sessions print the question. fctl-agent tells
Claude about fctl ask where the sandbox's fctl has it, and fake-claude
asks with 'ask <question> / <answer> / <answer>' (ADR 0078).
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner November 7, 2026 01:03
@fctl-review

This comment has been minimized.

Comment thread crates/fctl-control/src/do_session.rs Resolved
Comment thread crates/fctl-control/src/do_session.rs Resolved
…topped

A question stayed on a session that failed or that someone stopped, so
lists and the sidebar went on saying it asked, with nobody able to
answer. It goes now when the session fails, and when FleetDO stops it
for a person or a deletion (ControlState::drop_question); an idle stop
or a runner's drain keeps it, since a message resumes the session and
answers it. Also puts SessionDO's ask and the transcript's
QuestionNotice where they don't take another's doc comment.
@fctl-review

This comment has been minimized.

Comment thread crates/fctl-control/src/do_session.rs Resolved
Comment thread crates/fctl-control/src/do_session.rs Resolved
Comment thread crates/fake-claude/src/main.rs Resolved
… once

- A question that came after FleetDO's stop dropped one, or after the
  session failed, stayed with nobody to answer it: SessionDO refuses a
  new one while the session is stopping, stopped or failed (taking one
  back still goes).
- The same question again, as an agent that retries after a timeout
  asks it, no longer publishes it again or notifies again.
- Find in the transcript reads a question_asked notice as its question
  alone, as the page shows it.
- fake-claude asks only on a line that starts with 'ask', not wherever
  a message says it (fctl's follow-ups do).
@fctl-sh

fctl-sh Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

On the finding in the review summary (find in page): fixed in 0bbc0e3. find.ts now indexes a question_asked notice as question.text alone, the same text QuestionNotice puts in its data-find element. Searching for "Asked" or for an answer chip no longer counts matches the page cannot highlight. find.test.ts covers it.

fctl-sh Bot and others added 2 commits November 7, 2026 02:07
# Conflicts:
#	crates/fctl-domain/src/validate.rs
#	crates/fctl-proto/src/api.rs
#	docs/architecture.md
@kalaspuff
kalaspuff merged commit 3fb34e7 into main Nov 7, 2026
12 of 13 checks passed
@kalaspuff
kalaspuff deleted the fctl/850-agents-ask branch November 7, 2026 10:41
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