feat(wire): AgentEvent::Asked — a pending human-answerable question on the wire#143
Merged
Conversation
9b3497b to
294c961
Compare
A projection consumer (ADR-0035) needs to know "an agent is waiting on a
human" without re-deriving it from its local grid. Add an additive
AgentEvent::Asked on the EVENT (0xB3) stream at tag 0x09 (after ADR-0033's
terminal_control 0x08), carrying { id, question, suggestions, elapsed_seconds }
as a field-tagged TLV body so the suggestion list and elapsed counter are
additive. An older decoder skips it by length to AgentEvent::Unknown.
The v1 ask-trigger is the `phux-ask` terminal-title sentinel: libghostty-vt
surfaces no OSC 9/777, so the title is the closest signal an agent can drive
and the server can observe without disturbing the snapshot synthesizer.
Coalesced so a re-asserted marker doesn't re-fire; retitling clears the ask.
Full agent-state detection (manifests / hooks) is follow-up (phux-2sl6).
Additive: no tag renumbered, PROTOCOL_VERSION stays 0.5.0
(CHANGELOG 0.5.0-draft.8). ADR-0035 records the mechanism decision.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
294c961 to
e250e74
Compare
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.
Adds an additive
AgentEvent::Askedso a projection consumer (phux-mobile, phux-web) can tell "an agent is waiting on a human" — render the question and raise a notification — without re-deriving it from its local grid. Sibling of ADR-0033'sTerminalControl; a structured agent-surface signal, not a new wire tier.What
AgentEvent::Askedat event tag0x09(afterterminal_control's0x08) on theEVENT(0xB3) stream:{ id, question, suggestions: [str], elapsed_seconds: opt<u64> }. Body is field-tagged TLV (id=1, question=2, suggestion=3 repeated, elapsed_seconds=4), so the suggestion list and counter are additive; an older decoder skips it by length toAgentEvent::Unknown.phux-asktitle sentinel. The server decides a pane is asking from its terminal title (phux-ask[<id>]:<question>?s=a|b|c), coalesced so a re-asserted marker doesn't re-fire. libghostty-vt surfaces no OSC 9/777, so the title is the closest signal an agent can drive and the server can observe without disturbing the snapshot synthesizer.AgentEventvariant vs the spec-onlyTERMINAL_EVENT/RUN_HOOK).PROTOCOL_VERSIONstays0.5.0(CHANGELOG0.5.0-draft.8).Why a draft, not 0.6.0
Matches the established convention — every recent additive wire change (ADR-0032/0033, QUIC, per-spawn TERM) landed as a
0.5.0-draft.NwithPROTOCOL_VERSIONheld at0.5.0until the release is cut.Tests / validation (local)
cargo test -p phux-protocolgreen (incl. theaskedroundtrip, the proptest strategy covering bothTerminalControlandAsked, and the forward-compat skip test now using tag0x0a).cargo check -p phux-server --testsgreen (the title-sentinel emission +agent_asked.rsintegration test compile).just docs-checkgreen (84 files; CHANGELOG top ↔PROTOCOL_VERSIONsync).Follow-up
PHUX_REV) and ships the foreground notification; it will re-pin to this branch's merge commit.🤖 Generated with Claude Code