Repository navigation
Connectors list linked conversations once when a listener attaches - #49410
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Status. The problem: when a connector started listening, it went through every linked conversation twice. Now it goes through them once and gets the same result. There is no visible change. Perf scan (fresh reviewer, head c6de39e): PASS.
Review: the code review is clean. One wording problem in the PR description has been fixed. Nothing is deferred. Verified: CI is green and |
|
Benchmark: head=c6de39e7bf401af49ba545f03467725129e56299 gate=PASS. Corpus: 2,000 linked conversations, 10 connector listener attaches on the real |
…hes (STA-18473) (stablyai#49410) (cherry picked from commit 2986270)
ELI5
When a connector starts listening, Orca went through every linked conversation twice. Now it goes through them once.
What Changed
ConversationEvents.watch()pruned leftover turn dates by listing every link, then listed every link again to build the first snapshot. The prune now uses the pane keys from that one snapshot pass, run right after it. The snapshot only reads dates for linked panes and the prune only removes unlinked ones, so the result is the same.Why
Each listener attach cost an extra full link enumeration (and two arrays sized to the link count) on the main process. This is the release-blocker regression from #48604.
Linked Issue
STA-18473
Visual Proof
N/A: no UI change; main-process work count only.
Testing
ConversationEvents.watch()(2,000 links, 10 attaches), not committed: link visits 40,000 → 20,000,allLinkspasses 20 → 10, time ~23 ms either way (the index cache makes each pass cheap).pnpm check:changedpasses on this head (Linux).Performance
Less work: one link enumeration per connector listener attach instead of two. No new timers, triggers or consumers; idle wakeups 0 → 0.
Risk
Level: Low. Pruning now runs after the snapshot instead of before. Both touch only in-memory turn dates for panes the other leaves alone. Back out with a plain revert.
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)