Repository navigation
fix(cue): route Dispatch completions by agent and retain worker identity - #1955
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Route desktop exits with source identity src/main/cue/cue-types.ts, src/main/process-listeners/exit-listener.ts, src/__tests__/main/process-listeners/exit-listener-cue.test.ts, src/main/process-listeners/__tests__/exit-listener.test.ts, CLAUDE-CUE.md, docs/maestro-cue-events.md |
The exit listener looks up subscriptions using a parsed agent ID when available. Completion notifications include the source process ID and, for tab targets, the source tab ID. Tests cover matching, filters, completion outcomes, provenance, and excluded process types. Documentation describes Cue-owned and external completions and their matching behavior. |
Propagate identity through completion events src/main/cue/cue-completion-service.ts, src/main/cue/cue-output-filter.ts, src/main/cue/cue-fan-in-tracker.ts, src/__tests__/main/process-listeners/exit-listener-cue.test.ts |
Single-source events and fan-in results include available source process and tab identifiers. Fan-in tests cover per-agent aggregation, latest completion selection, and partial results after timeout. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant ExitListener
participant CueCompletionService
participant CueFanInTracker
ExitListener->>CueCompletionService: Notify completion with process and tab identity
CueCompletionService->>CueFanInTracker: Record completion data for fan-in
CueFanInTracker->>CueCompletionService: Return filtered outputs and source identities
Possibly related issues
- Route autonomous/scheduled agent turns (ScheduleWakeup, /loop, Cue) back to the chat relay #1127: The PR updates
agent.completedsubscription matching and preserves completion identity through fan-in, but does not implement the chat relay described in the issue.
Suggested reviewers: pedramamini
Merge Risk: 
Minimal · up to 2bb36
-
No merge-blocking issue was established. The change is ready for normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "fix(cue): route Dispatch completions by agent and retain worker identity" matches the main change. The raw summary and objectives show the PR routes Dispatch AI-tab exit completions by base agent ID instead of composite process ID, and keeps sourceProcessId and sourceTabId through single-source and fan-in events. The title names the fix, the Cue scope, and both parts of the change. It is specific and fits the changeset.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 7 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryRoutes desktop AI-tab completions to Cue subscriptions by base agent while keeping the process and explicit tab IDs.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
E[Desktop AI-tab exit] --> P[Parse process ID]
P --> A[Match base agent]
A --> S{Source count}
S -->|One| O[Event with process and tab IDs]
S -->|Several| F[Collect latest arrival per agent]
F --> J[Full or partial event with per-source IDs]
O --> D[Cue dispatch]
J --> D
Reviews (1) · Last reviewed commit: "fix(cue): preserve dispatch identities t..." · Reviewed by Greptile |
Summary
Dispatch AI-tab exits currently use a composite process ID where Cue subscriptions expect an agent ID or name, so the subscriber is never notified.
Reuse the canonical process-ID parser, preserve structured outcomes, and retain each source's known process/tab identity in full and partial fan-in results. External Dispatch completions still have no stdout or
source_subprovenance; Cue-owned lineage and the separate plugin event remain unchanged.Evidence
After: 167 tests passed across eight targeted exit, parser, completion-chain, fan-in, durability and output-filter suites on
2bb36e99bb16d5ac562670c16884343823009bde.Merge Danger
Door: two-way
Optional completion payload fields; no storage migration or productive configuration change.
Blast Radius: Cue
Completion routing is technical execution evidence. Deliverable acceptance and dependency release remain the controller's responsibility.
Summary by CodeRabbit
New Features
Documentation