feat: agent→human console replies + exclusive board subscriptions#198
Open
ivanmkc wants to merge 2 commits into
Open
feat: agent→human console replies + exclusive board subscriptions#198ivanmkc wants to merge 2 commits into
ivanmkc wants to merge 2 commits into
Conversation
Two console additions on top of the workspace-wide inbox: - Agent → human replies: POST /reply (token-gated) appends a kind:reply event into the SAME per-scope thread as human messages and broadcasts it live, so the human can watch what the agent is doing. Replies are excluded from unread / the ?all=1 aggregate so an agent never nudges itself. The viewer renders them as left-aligned agent bubbles. CLI: termchart reply. - Board subscriptions (takeover model): POST /subscribe / /unsubscribe + GET /subscriptions give one owner per scope so two watching sessions don't both act on the same board. A fresh subscribe takes over and the SSE subscribe broadcast names the evicted session; unsubscribe only releases if you still own it. CLI: termchart subscribe/unsubscribe/subscriptions --session <id>. Tests: SubscriptionStore (takeover, owner-only release, isolation), reply excluded from unread/aggregate, server /reply + /subscribe + SSE broadcasts, CLI reply/subscribe/unsubscribe/subscriptions. Full suite green (viewer 494, CLI 184); verified end-to-end against a live viewer.
…s advisory Code-review follow-ups on the replies + subscriptions work: - CLI inbox now knows kind:reply — a plain read prints '[n] reply <text>' instead of mislabeling the agent's own reply as a human 'message' (the consume path returns replies; only unread/--all drop them). - Cap subscribe session id at 200 chars (parity with MAX_INBOX_*). - Comments/help no longer overclaim: ownership is ADVISORY (server doesn't gate writes on it), and the subscribe SSE broadcast is a forward hook with no consumer yet — say so instead of asserting eviction is delivered.
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.
Stacked on
feat/global-inbox(#190). Two console additions so multiple watching sessions coordinate, and so the human can see the agent respond.Agent → human replies
POST /reply(token-gated) appends akind:replyevent into the same per-scope console thread as human messages and broadcasts it live over SSE — the human sees what the agent is doing in real time.unreadand the?all=1aggregate, so an agent never nudges itself with its own reply.termchart reply --project --agent --message.Board subscriptions (takeover model)
POST /subscribe//unsubscribe+GET /subscriptions— one owner per scope so two sessions don't both act on the same board's messages.subscribetakes over; the response and the SSEsubscribebroadcast name the evicted session so it can stand down.unsubscribeonly releases if you still own it. CLI:termchart subscribe/unsubscribe/subscriptions --session <id>.Design choices (per request): takeover (newest wins), explicit unsubscribe for clean release (takeover reclaims crashed sessions), persistent reply in the thread.
Tests —
SubscriptionStore(takeover, owner-only release, isolation), reply-excluded-from-unread/aggregate, server/reply+/subscribe+ SSE broadcasts, CLIreply/subscribe/unsubscribe/subscriptions. Full suite green (viewer 494, CLI 184); verified end-to-end against a live viewer.Review note: base is
feat/global-inbox; the diff will collapse to just this commit once #190 merges.