Repository navigation
fix(telemetry): cancel pending sends before CLI exit - #295
Open
XXPermanentXX wants to merge 2 commits into
Open
XXPermanentXX wants to merge 2 commits into
XXPermanentXX wants to merge 2 commits into
Conversation
…ialization failure
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When telemetry stalls,
flushTelemetry()currently stops waiting after its budget but leaves DNS/HTTP work alive, so a command can print its complete result and still take tens of seconds to exit. This change cancels that work within the telemetry budget and releases unused response bodies.Related to #294. This PR is stacked on #293 (
output-contract-review); its diff contains only this telemetry fix. After #293 lands, retarget or rebase ontomainas needed. Keep #294 open until the published Windows binary has been verified.Changes
Validation
Final-tree related regression: 98/98 passed across 10 files, including telemetry, proxy, Ctrl-C, EPIPE, concurrent invocations, and output/error behavior.
Final full offline run (Node 26.13.0, Bun 1.3.14, 2 workers): 8,280 passed / 297 gated / 2 failed, 401 files, approximately 692 seconds. This is not an all-green full run. Failures were the existing compiled-binary version check (macOS SIGKILL) and a Sandbox polling-timeout assertion receiving the lower-level request-timeout message.
Isolated rerun of both existing suites: 59/61 passed; all 13 Sandbox tests passed, while two compiled-binary startup cases received SIGKILL. On unchanged telemetry baseline
6f0cd3d0, the same two binary SIGKILL failures reproduced; the selected Sandbox recovery cases passed. These paths do not invoke the changed telemetry send (direct HTTP probe / telemetry-disabled runner), and no existing test was altered to hide the failures.Normal pre-commit hooks passed: regenerated skill assets without adding unrelated changes, then ran
vp check --fix.git diff --checkpassed; the committed contents exactly match the tested tree.Separate Node 26.13.0 / Bun 1.3.14 loopback probes: successful HTTPS CONNECT with proxy authentication, NO_PROXY bypass, and stalled CONNECT cancellation all passed (6 cases). Successful delivery retained the exact POST payload; the shared dispatcher stayed intact. Stalled CONNECT sends cancelled at about 1 second and both child processes exited naturally.
Same-machine Bun 1.3.14, identical fake business gateway and 6-second stalled telemetry, three runs each: median process exit 6.322 -> 1.312 seconds for stalled headers and 6.330 -> 0.337 seconds for stalled body. Business JSON and exit code were unchanged. A separate 50-second stalled-header reproduction exited in 1.499 seconds after the fix, compared with 50.414 seconds before.
Follow-up for Windows verification
DO_NOT_TRACK=1, andNO_UPDATE_NOTIFIER=1independently, recording output-complete time and actual process exit.