refactor(chat): share reactor event-subscriber helper across sinks - #1054
Merged
TheGreatAxios merged 1 commit intoSep 15, 2026
Conversation
Extract the duplicated tasks-changed/tools-activate subscriber blocks into handleChatDirectorEvent, log invalid payloads at debug level instead of dropping them silently, and clear queued task-change notifications when a turn throws.
TheGreatAxios
merged commit Sep 15, 2026
3b7dc90
into
cl-7916-chat-director-replace-ontaskschange-and-onactivatetools-with
13 checks passed
TheGreatAxios
added a commit
that referenced
this pull request
Sep 15, 2026
…1042) * feat(chat): replace onTasksChange/onActivateTools with reactor events Hosts subscribe to custom.chat.tasks.changed and custom.chat.tools.activate on the agent stream; TUI repaints the task panel, exec activates tools. Fixes CL-7916 * refactor(chat): share reactor event-subscriber helper across sinks (#1054) Extract the duplicated tasks-changed/tools-activate subscriber blocks into handleChatDirectorEvent, log invalid payloads at debug level instead of dropping them silently, and clear queued task-change notifications when a turn throws. * chore(deadcode): drop stale usage allowlist, cover eval fixtures fetchCodexUsage/fetchCodexModels/fetchXaiUsage deleted by #1031; four completion-harness fixtures loaded by path from script.json. * chore(deadcode): update keeper test for post-trim allowlist The CL-6815 trim removed the three usage-formatter exports; the scoped exemption keeper now pins the two remaining constants flags plus the negative sibling probe.
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.
Summary
Extract the near-identical TUI + exec reactor event-subscriber blocks into one shared helper (
handleChatDirectorEvent), log invalid payloads at debug level instead of dropping them silently, and clear queued task-change notifications when a turn throws instead of flushing them stale. Behavior-preserving refactor otherwise; event shapes and emitter behavior unchanged.Verification
bun run test: 7395 pass, 0 fail across 512 filesbun run check(lint + typecheck + build + guard): exit 0src/agent/chat-event-subscribers.test.ts(valid dispatch for both events, malformed-payload debug logs, unrelated-event ignore) and a stale-queue test insrc/agent/director.test.ts(verified it fails without the queue-clear fix, passes with it)Fixes CL-7969