Skip to content

feat(events): spot a turn that ends on a question, and filter on it - #293

Open
StuBehan wants to merge 1 commit into
mainfrom
feat/events-question-filter
Open

StuBehan wants to merge 1 commit into
mainfrom
feat/events-question-filter

Conversation

@StuBehan

Copy link
Copy Markdown
Collaborator

Every Stop from an agent reads "Done", so a turn that finished and a turn that ended asking you something look the same in Events, and you have to open each one to find out which is waiting on you.

Claude Code and Codex both send the last reply on Stop (last_assistant_message), so notify.sh now passes the last 2,000 characters of it through as last_message. Not for SubagentStop, a subagent's reply is for the agent that launched it. The app looks at the closing line of prose (skipping a trailing code block, list markers and emphasis) and if it ends on a "?" the row shows that question in place of "Done", with its own icon. Only the last line on purpose, an agent that asked something mid reply and then carried on isn't waiting on you.

The chip row gets Questions and Done chips ahead of the feed tags, so ⇧⏎ or option-click on Questions shows just those. F, Space and the rest work as they already did. Permission prompts still have no chip and can't be hidden, same reason as before. FeedTagFilter is EventTagFilter now since it isn't feed only any more. History records a question flag, so typing question in the history filter finds them.

Gemini, pi and older Claude Code builds don't send the reply, so their turns stay Done. Reading the transcript tail would cover those, left out of this one.

Before:

before

After:

after

Questions only (the prompt stays):

questions only

Tests are in AgentQuestionTests, EventListenerTests, EventLogTests and EventsListTests. I also ran the hook's payload builder against a scratch socket with a 3,000 character Stop reply and a SubagentStop to check what goes over the wire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant