Repository navigation
feat(diagnostics): report runtime capabilities - #182379
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex review: needs changes before merge. What this changesThis PR adds passive runtime-capability reports to Doctor, Gateway diagnostics, and support exports while removing the heap-sampling prerequisite from native snapshots. Example: A Bun runtime supports native snapshots but rejects HeapProfiler.enable with error -32601.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep this maintainer-authored PR open: capability reporting is useful, but Bun snapshot cleanup regresses and the added export RPC breaks three existing CLI tests. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherRuntime metadata and explicit capture outcomes feed one capability collector, whose reports reach Doctor, authenticated Gateway clients, and redacted support archives. flowchart LR
A[Runtime build facts] --> C[Capability collector]
B[Explicit diagnostic captures] --> C
C --> D[Doctor report]
C --> E[Gateway diagnostics RPC]
C --> F[Redacted support archive]
Technical reviewBest possible solution: Keep the shared passive collector, preserve Bun snapshot-metadata cleanup without requiring heap sampling, and update the existing CLI export tests. Do we have a high-confidence way to reproduce the issue? The base source requires HeapProfiler.enable before native capture, matching the author's reported -32601 reproduction; the introduced cleanup regression is established by the exact pinned Bun source, and CI directly records the CLI test failures. Is this the best way to solve the issue? One passive collector shared by existing consumers is appropriate, but runtime identity must not bypass snapshot cleanup that the supported Bun implementation still requires. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dd5e80de5c15. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +299, Tests +239, Docs +42, Other +1. Total +581 across 22 files. Added test files: 2. View PR surface stats
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 October 24, 2026, 4:16 AM ET / 08:16 UTC. |
d1acbf3 to
152cd1d
Compare
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* feat(diagnostics): report runtime capabilities * fix(diagnostics): retain capabilities in maintainer tooling * test(diagnostics): cover capability snapshots in CLI exports * fix(diagnostics): use shared runtime option parser
What Problem This Solves
Operators cannot tell which diagnostic capabilities their running Node/Bun process supports, and native heap snapshots fail when that runtime lacks the unrelated inspector sampling domain.
User Impact
Doctor reports runtime flavor and capabilities. The read-only
diagnostics.capabilitiesRPC reports the serving Gateway, and support exports include separate redacted snapshots for the exporting process and the Gateway. Reports distinguish debugger breakpoints, CPU profiling, heap sampling, native snapshots, string code generation, executable-memory policy, interpreter availability, and the packaged native-module inventory.Unknown capability states remain explicit. This does not run generated code, load optional addons, open a debugger port, or start a profile. Native-module inventory is not a claim of backend compatibility: each target, signature, libc, and selected backend still needs qualification.
Why This Change Was Made
Build metadata and the existing capture owners supply the facts; diagnostics does not infer every capability from an AOT/JIT label. Explicit captures record independent observed outcomes, keeping unsupported methods separate from temporary admission failures. Native heap snapshots no longer depend on
HeapProfiler.enable, while Node retains its required inspector cleanup to release snapshot object tracking.Evidence
Small probes compiled with experimental Bun at
5d8fe974freproduce the heap-sampling prerequisite failure (-32601) and pass with native snapshots. The before/after runs took 0.599s/0.657s; compile times were 4.584s/2.741s. A bundled capability-owner probe compiled in 1.387s and ran in 0.594s with correct AOT identity and independent unknown profiling states. No full application AOT build or interpreter tripwire was used.The actual snapshot owner also passed under the same experimental Bun in an isolated environment: 2,037,504-byte snapshot written and removed, capability recorded as available, exit 0 in 2.914s.
Owning Node tests: heap snapshots 9/9 (430.923s wall, including cold worker preparation), capabilities RPC 2/2 (249.929s), runtime facts 3/3 (42.561s), heap profiling 19/19 (304.237s). The snapshot regression failed against the original owner; the unchanged real Node test confirms V8 object IDs are released after capture.
Grouped Doctor, support-export and CPU-profile run: Doctor 104/104 and 54 logging tests passed. Two strict ZIP entry expectations needed the new local capability file; both corrected cases passed the focused rerun (203.833s). The grouped command took 362.106s. Together these runs cover 193 selected tests with passing evidence.
The existing PR-wrapper inventory regression reproduced the new module missing from extracted tooling. Adding its single source-inventory entry makes the same test pass (105.17s wall).
Targeted types, production/test lint, formatting and whitespace checks passed. Independent Codex review completed clean through P2. Native/backend qualification remains specific to the exact target, signature, libc, and selected backend.
CI on the previous head caught three CLI export expectations that still assumed only the health RPC. Their correction requires both read-only RPCs and verifies the serving Gateway capability data in the actual ZIP for all three modes. Focused types, source-backed lint, and independent Codex review pass. Local Node/Bun runners stalled before executing these cases; the final exact-head Node CI jobs pass and supply this proof.
Integration with the shared startup-option parser is complete: diagnostics now consumes
node-runtime-env.mjsafter the parser relocation. The affected capability tests pass 3/3 (123.80s wall), and the extracted-tooling import closure passes 3/3 (77.21s). Targeted types, lint, and formatting pass. The small AOT capability probe still reports the correct flavor and independent unknown snapshot state after the move (0.26s bundle, 2.04s compile, 0.81s run).The parser-cutover review is complete and clean through P2. Final exact-head CI
40080123045completed: 68 jobs passed, 25 were skipped, and only two UI E2E shards plus their aggregate failed. All Android and security jobs passed. The three UI failures independently match scheduled main CI40078639310: home-attention activity publication, archive Undo visibility, and active-turn navigation to/usage. Their UI/client/protocol/QA input objects are unchanged in the actual tested merge. Landing uses the authorized native pre-existing-failure route; the red results are retained.