Repository navigation
fix(transcripts): stop reporting replaced captures as active - #131344
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 27, 2026, 10:07 PM ET / August 28, 2026, 02:07 UTC. ClawSweeper reviewWhat this changesThe PR prevents retired Discord and meeting transcript captures from continuing to appear active or appending late utterances after replacement or stop. Merge readinessKeep open: the proposed lifecycle fences address the reported replacement race, but the branch turns a public provider status into irreversible closure without an additive terminal signal, risking existing transcript plugins. Priority: P2 Review scores
Verification
How this fits togetherTranscript providers feed utterances and lifecycle status into the agent transcript tool, which persists captures and exposes their state to operators and models. Discord voice and meeting bridges are provider implementations on that path. flowchart LR
A[Discord voice or meeting bridge] --> B[Transcript provider callbacks]
B --> C[Transcript tool runtime]
C --> D[Capture store]
C --> E[Status and model tool output]
F[Replacement or stop] --> B
F --> C
Decision needed
Why: The transcript provider contract is exported through the Plugin SDK, while its existing status shape cannot distinguish a transient inactive state from permanent retirement. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +180, Tests +692, Docs +12. Total +884 across 21 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Add an explicit additive terminal lifecycle signal or close callback, finalize only on that signal, and retain bare inactive status as nonterminal unless a provider opts into closure. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: an existing plugin can report the exported bare inactive status and the introduced callback immediately finalizes its capture; no current-main runtime execution was performed in this read-only review. Is this the best way to solve the issue? No: exact-binding retirement is the right direction for the reported race, but treating every inactive status as terminal is not the safest public SDK contract because temporary inactivity is indistinguishable. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f1e996068d8d. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Reviewed the latest ClawSweeper finding and both rank-up moves against the provider contract, current main, stable The callback belongs to the exact capture admitted by The SDK type is shipped, but the reviewed stable contract contains no promise that an inactive capture can later resume through the same callback. No audited provider or tagged documentation establishes the temporary-inactivity behavior proposed by the finding. I am therefore not adopting the requested bare-inactive-is-nonterminal regression: it would assert a different lifecycle contract and leave the existing terminal seam unconsumed. This addresses the first rank-up move through the explicit contract documentation already in the patch; the second is skipped for that reason. Unexamined third-party provider behavior remains unproven, rather than being claimed compatible by test coverage. The earlier requests for live Discord evidence are also explicitly accounted for: the owner selected Waive live Discord proof after the approved QA credential locations lacked the required QA item. No live Discord call or production state mutation was performed. Controlled real-tool/registered-provider/manager/SQLite regression evidence covers retirement, preserved historical notes, late-delivery rejection, historical stop isolation, and manager destruction; it is not live-channel evidence. CI on |
5b63c37 to
a1aa0dd
Compare
|
Land-ready proof for The shared transcript owner now consumes the exact capture's terminal fact. Discord replacement/detach/destruction retires that binding before notification, and deferred STT/realtime delivery keeps the original binding identity. The shared meeting bridge preserves independent subscribers and drains final delivery before retirement. Historical stop cannot stop the replacement; original notes and stop time remain available. Terminal persistence failures are visible under This fixes the owner boundary rather than adding provider-specific core deduplication, polling, or replacement prohibition. Removed duplicate explicit-stop persistence, the obsolete selector-based store updater, and per-stop symbol state. Production +379/-199 (net +180); tests/test support +732/-34 (net +698); docs +17/-5 (net +12), 23 files. Production growth supplies the missing exact-capture lifecycle/recovery state and producer fences. No schema, configuration, environment, or dependency additions. Original pre-fix regressions failed through the real tool, registered Discord provider, manager/session, and SQLite boundary. Original focused proof covered 203 distinct tests in 15 files. Since the necessary conflict rebase, 94 distinct tests in seven files have passed across the final source and test follow-ups, including main's auto-start warning behavior. The full moved integration proves only the replacement remains active, historical notes survive, stale delivery is rejected, stopping history does not stop the live replacement, and manager destruction records terminal state. Executed proof commands: node --import ./scripts/tsx.mjs scripts/check-no-extension-test-core-imports.ts
node scripts/run-vitest.mjs src/agents/tools/transcripts-tool.lifecycle.test.ts src/agents/tools/transcripts-tool.auto-start.test.ts src/agents/tools/transcripts-tool.test.ts src/meeting-bot/transcripts-bridge.test.ts
node scripts/run-vitest.mjs src/agents/tools/transcripts-tool.test.ts test/transcripts-tool.discord-lifecycle.integration.test.ts test/transcripts-tool.discord-provider.integration.test.ts
node_modules/.bin/tsgo -p extensions/discord/tsconfig.json --noEmit
node scripts/run-vitest.mjs test/transcripts-tool.discord-lifecycle.integration.test.ts extensions/discord/src/voice/voice-session.lifecycle.test.ts
git diff --check 6f59c0a3fe5794706e24f5bcfd7711e2851ef02b
node scripts/watch-pr-ci.mjs 131344 2017ebeb17a3bf401b12ceeb22f6cca26d687365
scripts/pr review-init 131344
scripts/pr review-checkout-main 131344
scripts/pr review-checkout-pr 131344
scripts/pr review-artifacts-init 131344
scripts/pr review-validate-artifacts 131344The first combined rebase run had one one-second fixture-poll failure; explicit provider-entry synchronization and unconditional cleanup fixed it, and the subsequent full 17-test tool suite passed. An unrelated broad boundary scan hit its existing 120-second local limit; no timeout was increased. Canceled local attempts are not counted as proof. CI runs 33134539643 and 33137777356 exposed two test-boundary problems: the integration suite's location and an internal-package import newly reachable through the test API. Both were reproduced and repaired through the existing public test/SDK seams, without dependency or baseline changes. Final CI run 33138569857 is completed / success on Fresh independent Codex autoreview through the repository helper completed without findings at its P0-only reporting threshold, including each test repair and the conflict resolution. Native review artifacts and the exact-head guard passed. The latest completed ClawSweeper finding and both rank-up suggestions have an explicit source-backed disposition; unexamined third-party provider behavior is not claimed proven. Live Discord proof was explicitly waived by the owner. Approved QA credential locations lacked the required item. No live Discord call, production state mutation, or secret-value read was performed. Controlled integration evidence is not live-channel proof. This waiver does not waive CI, review, or native merge gates. The actual conflicts were limited to an import and docs text from #131381; its shutdown warnings and export recovery guidance are preserved. Companion #130860 and separate realtime onClose work remain excluded. Proceeding only through native |
|
Merged via squash.
|
…w#131344) * fix(transcripts): retire replaced captures from active status * test(transcripts): move Discord lifecycle proof across public test boundary * test(transcripts): synchronize pending startup without polling * test(discord): keep voice harness imports on public SDK
What Problem This Solves
Fixes an issue where users who stop or replace a Discord transcript capture can still receive late utterances in the retired transcript, see both old and new captures reported as active, or have historical stop actions reach the provider again. The live capture and its durable notes have different lifetimes, but core bookkeeping did not consume provider termination notifications.
Closes #127426 — Discord transcript stop or replacement does not fence in-flight utterance delivery.
Related: #130860 — preserving meeting logs through voice reconnects. That open capture-owner refactor is separate: this PR repairs the pre-existing core lifecycle gap and deferred transcript delivery without including or depending on its commits. The separate realtime
onCloserepair is also not bundled.Why This Change Was Made
The existing
onStatuscallback now closes the exact admitted capture, and provider-driven completion and explicit stop share one finalizer that preserves terminal timestamps, persists the summary once, and retains visible recovery ownership when persistence fails. Discord retires the old binding before notification and carries its exact subscription through queued audio, STT, and realtime delivery; the shared meeting bridge drains final delivery and independently retires subscribers even when meeting metadata persistence fails.User Impact
transcriptsstatus reports current capture subscriptions rather than historical notes. A replaced capture gets a durable stop time and summary, remains available to list/show/summarize, and cannot accept a delayed utterance or stop its replacement. Historical stop preserves its recorded timestamp and admitted source/account/agent ownership.Temporary transport disconnects do not terminate a subscription. Simultaneous meeting subscribers remain independent. Provider completion stores summaries without creating file exports; explicit stop, import, and summarize actions still materialize artifacts. Ended captures whose persistence failed appear separately under
pendingFinalization, with an instruction to retrystopwithout stopping the provider again. This retry state is process-owned; no new automatic recovery replay across Gateway restart is introduced.There is no provider-status polling, source-based deduplication, Discord policy in core, or new schema, configuration, environment, or dependency surface. The CLI documentation explains active capture versus durable history and persistence recovery.
Evidence
AI-assisted implementation and validation. The final committed patch is byte-identical to the reviewed staged diff. Fresh pre-commit autoreview reported no actionable findings at its default P0-only threshold; that review did not run tests and is not a claim of broader review or live proof.
The original regression uses the real transcripts tool, Discord provider/manager, and SQLite store under the test harness. Before the repair, replacing
firstwithsecondproducedactive: ["first", "second"]instead of["second"], leftfirst.stoppedAtunset, and invoked provider stop when stopping historicalfirst. After the repair, onlysecondis active,firstretains its utterance and summary, historical stop never reaches the provider, the replacement stays connected, and manager destruction finalizes it.Negative tests against the original source also reproduced 12 core failures, 11 Discord failures, and meeting subscriber termination failures. Isolating the old STT/realtime producer paths while retaining repaired core reproduced all four selected delayed-delivery failures, so the producer proof does not rely only on the core callback fence.
Executed focused commands recorded during implementation:
The focused proof covers 203 distinct tests in 15 files, including account ownership, manual import, source sanitization, summary/store behavior, shared meeting lifecycle, and Discord replacement/delivery. A subsequent final core/meeting rerun passed 41 tests in 3 files after test-style/type corrections. All changed-file gates passed, including core/plugin production and test typechecks, lint, formatting, import cycles, and storage guards. The full build passed. Build and plugin lint artifact preparation were serialized for the final proof after an earlier concurrent attempt raced over generated SDK output.
Production LOC: +379 / -199 = +180; tests: +702 / -10 = +692; docs: +16 / -4 = +12, across 21 files. The net production growth supplies the missing exact-capture terminal/recovery state, one shared finalizer, the operator-visible pending outcome, and producer-side audio subscription identity. A smaller consumer-only filter would leave retired callbacks deliverable and persistence failures without an owner. The repair removes duplicate explicit-stop durable bookkeeping, the obsolete selector-resolving
TranscriptsStore.updateStoppedwrapper, and the separate per-stop symbol; it adds no production file or generic lifecycle framework.Live-proof limitation and maintainer decision: the maintainer explicitly waived live Discord QA for this deterministic lifecycle repair after the dedicated QA credentials could not be found at their documented locations. No live Discord call or production-state mutation was performed. The evidence above is controlled tool/provider/manager/SQLite and meeting-lifecycle boundary proof, not live channel proof. Landing still requires exact-head CI, current review resolution, and the repository-native prepare/merge gates. The optional QA harness safety findings discovered during proof preparation were preserved separately and are not included in this PR.