Repository navigation
fix(artifacts): record why a bundle download falls back to the inline endpoint - #324
Merged
Merged
Conversation
… endpoint tryBundleDownload returned false at seven different points, and the fallback is silent: the inline download still delivers the file. So there was no way to tell a deployment without bundle delivery from a dropped connection or a stream that broke partway. Each point now returns a reason, and tryBundleDownload sends it as a "bundle download fell back" telemetry event (context cli.download) with the route, upload id, duration, HTTP status or error name/message/code, and the bytes received before a stream broke. A 501 (no bundle delivery on this deployment) is logged at info; everything else at warn. Nothing is printed: the MCP server uses the same gateway, and its stdout is the JSON-RPC channel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Merged
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.
Why
Artifact and HTML-report downloads try bundle delivery first: a signed manifest from the API, then a ZIP streamed from the delivery service. If anything about that goes wrong, the CLI silently falls back to the inline download endpoint. The user still gets their file, which is the point. But
tryBundleDownloadreturned a barefalsefrom seven different places. So the fallback left no record of why: a deployment without bundle delivery, a non-OK response, a dropped connection, or a stream that broke partway all looked the same.What changed
tryBundleDownloadnow calls a newattemptBundleDownload, which returnstrueor a reason:manifest_request_failed,manifest_unavailable(501),manifest_http_error,manifest_invalid_json,manifest_incompletebundle_request_failed,bundle_http_error,bundle_stream_failedtryBundleDownloadsends abundle download fell backtelemetry event (contextcli.download) through the existing telemetry service. It carries:reason,route(e.g.artifacts-bundle),upload_idandduration_ms;statusfor HTTP errors;error_name,error_messageanderror_code(the low-level cause, e.g.UND_ERR_SOCKET) for thrown errors;bytes_receivedfor a stream that broke partway. This is counted as bytes arrive, because the partial file on disk understates it: the write stream is torn down with buffered bytes still unflushed.info, since it's the expected answer from a deployment without bundle delivery. Everything else is logged atwarn.DCD_TELEMETRY_DISABLED=1turns the event off, like all CLI telemetry.Testing
report-download.service.test.ts:pnpm typecheck,pnpm lint(no new warnings),pnpm test:unit(576 passing),pnpm build.🤖 Generated with Claude Code