feat(chat): realtime session-activity signals (Phase 3)#6
Merged
Conversation
Report every persisted user/assistant turn to the hub so the ranch chat index updates live, without waiting for the S3 reconcile interval. - IActivityReporter port in agent/session; SessionService.append emits a SessionActivity (user/assistant only, non-internal, non-transient) via a reporter wired at the composition root to the bridle socket transport. - BridleRepository.reportActivity emits `session_activity` over the always-on agent-hub socket (no-op when disconnected); routed through ChannelGateway / ChannelModule. - Tag synthetic loop-control events (continuation prompts + pre-cutoff partial assistant chunks) with data.transient=true (fix 8) so they're excluded from both the activity signal and the transcript reader. - v0.27.0 + session activity-emit spec. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Companion to the ranch chat-history feature. Reports every persisted user/assistant
turn to the Bridle hub so the ranch chat index updates live, without waiting for the
S3 reconcile interval. The runtime stays host-agnostic (no DB dependency).
Changes
IActivityReporterport inagent/session;SessionService.appendemits aSessionActivity(user/assistant only, non-internal, non-transient) via a reporterwired at the composition root.
BridleRepository.reportActivityemitssession_activityover the always-onagent↔hub socket (no-op when disconnected — reconcile is the safety net); routed via
ChannelGateway/ChannelModule.chunks) with
data.transient=trueso they're excluded from both the activity signaland the transcript reader (fix 8).
Behavior / risk
Purely additive. No-op when bridle isn't connected; the append path is fire-and-forget
(wrapped in try/catch). No change to persistence or existing channels.
Verification
tscclean; new session activity-emit spec (emits for user/assistant; skipstool/internal/transient); full runtime suite (73) green.
session_activityreaches the ranchhandler → chat index updates without Sync.