Repository navigation
fix: bound stalled real-SDK capture and runtime checks - #68
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: blocked before merge. Reviewed September 8, 2026, 12:37 PM ET / 16:37 UTC. ClawSweeper reviewWhat this changesAdds a configurable 30-second deadline to in-process plugin registration, timeout exits in two capture CLIs, documentation, and regression tests. Merge readiness⛔ Blocked before merge - 5 items remain The fix remains necessary on main and in v0.3.24. Direct capture has convincing runtime proof, but the prior timeout-termination blocker remains in other registration callers. Priority: P2 Review scores
Verification
How this fits togetherPlugin Inspector imports plugin entrypoints to record their registrations for compatibility reports and synthetic probes. This change bounds the registration wait; callers must then report the failure and terminate CLI processes containing lingering plugin handles. flowchart TD
A[Plugin entrypoint] --> B[In-process registration]
C[Configured timeout budget] --> B
B --> D{Registration settles?}
D -->|Yes| E[Captured registrations]
D -->|No| F[Classified timeout]
E --> G[Reports and synthetic probes]
F --> H[Caller error handling and CLI exit]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Provide bounded, classified failure across all registration CLI callers, verify the larger-budget path for slow plugins, and complete Crabpot consumer validation. Do we have a high-confidence way to reproduce the issue? Yes, source identifies a concrete path: registration that retains an interval and never settles reaches the new deadline, but runtime-check/CI error wrapping and synthetic CLI handling do not terminate the process. No reviewer execution was performed. Is this the best way to solve the issue? Not yet: the timer is a focused repair and direct capture is demonstrated, but timeout handling must cover the shared callers and the configured escape path for slow registrations. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 84ede904fd6e. LabelsLabel 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 (3 earlier review cycles)
|
Bound real-SDK captureEntrypoint register() with the same 30s PLUGIN_INSPECTOR_CAPTURE_TIMEOUT_MS budget as the mock-SDK child path. A plugin whose register() never settles now fails with capture-timeout instead of hanging the inspector process. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
82d05fc to
c5471d9
Compare
Reuse the owned capture child for CLI execution while preserving in-process API runtime and retained handler identity. Bound API phases with cooperative cancellation and document the JavaScript preemption limit. Integrate the landed child-process policy and preserve reviewed CommonJS loader behavior. Keep real SDK linked dependency resolution unchanged.
Record the landed PR73 ancestry without changing the reviewed and tested candidate tree.
What Problem This Solves
Fixes an issue where real-SDK capture or runtime checks could hang on plugin imports, busy registration, or retained timers. A rejected registration wait alone cannot stop plugin code running inside the inspector process.
Why This Change Was Made
CLI real-SDK capture now uses the existing owned-child process policy from #59. This covers
capture,capture-cli, and runtime checks enabled by flags or plugin config. The child loads installed SDK dependencies with normal Node resolution, flushes complete JSON, and sheds retained plugin handles.Programmatic real-SDK capture stays in-process to preserve caller runtime objects and retained handler identity. Its budget follows finite API option, environment, then 30-second default precedence. Timeout or caller cancellation stops later inspector-owned phases, aborts supported setup reads, and observes late rejection. Arbitrary in-process JavaScript, imports, and plugin side effects cannot be forcibly canceled.
The integration preserves #73 loader cleanup, CommonJS source scanning, and mock-only SDK error classification. Mock capture retains its existing symlink behavior. The contributor branch ancestry and @SebTardif credit are preserved.
User Impact
Real-SDK CLI imports and registration now fail within the configured process budget, including busy loops and active-handle hangs. Healthy plugins still return complete capture results. API consumers retain in-process identity semantics with an explicit bounded-wait contract. No package dependencies, public helper exports, report fields, or finding codes are added.
Evidence
Development proof used sanitized direct AWS with Node 22.19.0, isolated HOME/environment, no hydration, and a verified absent instance-role credential endpoint. Exact-head GitHub CI is recorded below.
c5471d932e558f07a9c20b97c4e1fabca2a26a52: four CLI routes required the outer watchdog, and import/cancellation API checks missed the expected rejection.npm run release:contentspassed before the PR73 integration.ERR_MODULE_NOT_FOUNDfor a dependency beside the SDK's real path. Restricting the flag to mock capture repaired that boundary.node --test test/in-process-register-timeout.test.js test/sdk-mock.test.jspassed 48/48. This covers linked-SDK success through all four CLI routes, busy/import/pending timeouts, retained-handle cleanup, complete JSON, unsuccessful partial output, API budgets/cancellation/late rejection, and inherited mock/CJS behavior.registration-execution-errorinstead of the isolated capture'scapture-error. The one-value repair passed all six API boundary cases on the retained AWS lease; no unrelated changes or extra review cycle were needed.982e0570d83fd103fba3466bfe37b5a6cf816cdc; tree:33d5d2dda5fb0ca86d561f055dc23553d43a4403. Both original contributor and current-main ancestry are retained. The dependency ancestry merge was tree-identical to the reviewed candidate.f24c2778125f9cdd94d1801dbb68910e81ec30202e119ba40c67b28334102c8a.982e0570d83fd103fba3466bfe37b5a6cf816cdc.Scope is capture and runtime-check execution. Synthetic probe execution remains a separate unit. Crabpot source/package smoke and release follow-through remain with the coordinated release integration lane; no package was published and no live Gateway proof is claimed. Final maintainer source review and the sole merge slot are granted for
982e0570d83fd103fba3466bfe37b5a6cf816cdc; the P2 cancellation finding is resolved with red/green proof and no accepted findings remain.