Repository navigation
fix(cli): avoid initializing provider runtime during cleanup - #200139
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR gives CLI cleanup a direct internal entry to the existing session-resource registry, avoiding default provider-runtime initialization. Example: A one-shot CLI command finishes without using an AI provider.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it makes a focused cleanup improvement while preserving the existing resource owner and teardown order; no actionable defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherOne-shot CLI teardown drains provider resource callbacks held by the AI package; provider transports and the compatibility runtime continue using the same registry. flowchart LR
A[One-shot CLI command] --> B[CLI resource cleanup]
B --> C[Internal session resources entry]
D[Provider transports] --> E[Shared cleanup registry]
F[AI runtime compatibility entry] --> E
C --> E
E --> G[Resource cleanup callbacks]
Technical reviewBest possible solution: Use the existing registry through the narrow internal package entry while preserving provider cleanup and shared module identity. Do we have a high-confidence way to reproduce the issue? Current main's cleanup imports internal/runtime, which reexports default-runtime and initializes it at module evaluation; no target code was executed during this review. Is this the best way to solve the issue? The change is the smallest complete fix using the existing owner: expose its module directly, switch the cleanup import, and verify compiled and packed-package boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a139d420834e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +66, Config +6, Other +1. Total +73 across 7 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 16, 2026, 10:00 AM ET / 15:00 UTC. |
|
Merged via squash.
|
…tgres-compaction-watched-prompt-20261116 * commit '9e810f7101557b006d5ff223d955f14dc43329f0': (23 commits) chore(ui): refresh control ui locales (#200164) fix(update): stop reporting unset git config keys as failing checks (#200153) test: consolidate redundant coverage (198793, part 2) (#198936) revert: skills-used full-transcript scan on every chat history page (#200159) refactor(sessions): follow the chat by key for stored delivery references (#200099) fix(update): bridge 2026.11.5-beta.4 updaters (#200152) fix(gateway): avoid filesystem stalls during catalog refresh (#200136) fix(ci): match update refusal probe to selected candidate (#200043) fix(agents): keep read-only steering carriers when publishing suppressed user envelopes (#200156) test: consolidate suites while retaining recovery owners (#198933) test: consolidate redundant coverage (198789, part 2) (#198932) refactor(cli): consolidate camera command tests (#200144) fix(cli): avoid initializing provider runtime during cleanup (#200139) fix(ui): show mobile destinations without the drawer exit delay (#198879) chore(ui): refresh control ui locales (#200146) fix(knowledge): keep historical claims distinct and reject changed retries (#200140) fix(ui): align dropdown arrows on mobile New Session improve(sessions): archive inactive transcripts by default (#199899) refactor(agents): own background commands and yield waits by the chat (#200097) fix(models): guessed non-chat models leave the default picker instead of being refused (#200102) ...
What Problem This Solves
One-shot CLI commands can initialize an unused provider runtime while shutting down.
User Impact
Command output and configuration are unchanged. Session cleanup still runs, without initializing an unrelated provider runtime solely to reach its cleanup function.
Why This Change Was Made
Expose the existing session-resource registry through an internal package entry and import it directly from CLI cleanup. The broader runtime entry continues to share the same registry. No new registry, cache, or conditional cleanup path is added.
Evidence
5ed49aa7c35024563fa4cb26ade3efd0b0fa4e15: a fresh child called the realcloseCliResources; absent default-runtime state became initialized, the registered callback ran once, and both entries shared the registry. Native diagnostic completed successfully; the Actions cancellation reflects native lease teardown.9674081c7e37a2ffda41080de8ee6a3e43e08d6f: native validation passed all 28 focused cases, four type graphs, targeted formatting/lint, and the full build with declarations on Node 24.22.1. Tests cover cold compiled cleanup, resource retirement and one-shot exits, plus external packed-package registry identity and callbacks in both directions. Source and dependency inputs remained unchanged; native teardown completed successfully.The change adds seven shipping/configuration lines for the internal package boundary and 66 test/support lines. No quantified RSS or latency improvement is claimed.