Skip to content

refactor(chat): share reactor event-subscriber helper across sinks - #1054

Merged
TheGreatAxios merged 1 commit into
cl-7916-chat-director-replace-ontaskschange-and-onactivatetools-withfrom
cl-7969-harden-reactor-event-subscriber-paths
Sep 15, 2026
Merged

TheGreatAxios merged 1 commit into
cl-7916-chat-director-replace-ontaskschange-and-onactivatetools-withfrom
cl-7969-harden-reactor-event-subscriber-paths

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

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 files
  • bun run check (lint + typecheck + build + guard): exit 0
  • New tests: src/agent/chat-event-subscribers.test.ts (valid dispatch for both events, malformed-payload debug logs, unrelated-event ignore) and a stale-queue test in src/agent/director.test.ts (verified it fails without the queue-clear fix, passes with it)

Fixes CL-7969

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.
@linear-code

linear-code Bot commented Sep 14, 2026

Copy link
Copy Markdown

CL-7969

@TheGreatAxios
TheGreatAxios merged commit 3b7dc90 into cl-7916-chat-director-replace-ontaskschange-and-onactivatetools-with Sep 15, 2026
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.
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