Repository navigation
fix(#1924): report attachment download failures instead of hiding them - #1925
Open
fullsend-ai-coder[bot] wants to merge 2 commits into
Open
fullsend-ai-coder[bot] wants to merge 2 commits into
fullsend-ai-coder[bot] wants to merge 2 commits into
Conversation
The download loop in the code-implementation attachments reference could lose images without the agent noticing: a failed gh api call looked like "no attachments", curl had no time limit, failed downloads left 0-byte files and no summary, sort -u held every URL until all comment pages were fetched (signed URLs expire after 300 s), the URL pattern ran on into trailing HTML, and videos were downloaded too. Changes to the bash block: - set -o pipefail and chain the gh calls with &&, so a listing error ends in an INCOMPLETE message; grep's "no match" stays a success. - curl gets --proto '=https' and --max-time 60; a failed, empty or non-image download is deleted and reported as FAILED. - Drop sort -u. De-duplicate by file name inside the loop and use grep --line-buffered (with & decoded in the loop) so each download starts as soon as its URL is read. - Tighten the pattern to [^"<>[:space:]]+ and skip .mp4/.mov. - Print "downloaded X/Y". The prose now says to re-run once on failure and otherwise mark the work PARTIAL in the commit message and pr_body, never substituting a placeholder. Tested with stubbed gh/curl: gh 403, mixed curl failures, a non-image response, duplicate and plain-text links, a video, no attachments, and a slow comment page (first download starts before it returns). shellcheck passes on the block. pre-commit could not fetch hook repos (TLS error), so the applicable pre-commit-hooks v6.0.0 hooks and lint-release-cases were run directly and passed; skillsaw 0.18.0 --strict passes. A real stalled transfer was not exercised. Closes #1924 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the multi-pattern case arm (*.mp4 | *.mov) and the [[ ]] image check with test comparisons. This matches the shell dialect the sandbox's Tirith hook accepts. Behavior is unchanged; the stubbed gh/curl scenarios and shellcheck still pass. Tirith still blocks the whole block when it is pasted inline as one command (the original block on main is blocked the same way). Saving it to a file and running it with bash works. Not changed here. Related to #1924 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 2:14 PM UTC · Completed 2:22 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.11 |
|
Risk Assessment: low (1/5) DetailsSingle skill reference doc updated by a bot with low churn and fully aligned issue scope, presenting low risk overall despite touching a protected path. |
ReviewFindingsMedium
|
This branch was previously 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.
Summary
Updates
skills/code-implementation/references/attachments.mdso failed issue-attachment downloads show up in the agent's output and are not silently lost.Changes to the download block:
set -o pipefailplus&&between the twogh apicalls means a 403/404/rate-limit ends inINCOMPLETE: listing or download failed. When grep finds no matches (exit 1), that still counts as a success, so "no attachments" stays clean.curlgets--proto '=https'and--max-time 60. A failed, empty or non-image/*download is deleted and reported asFAILED <n>-<name>. The signed URL is never printed.sort -u. Duplicates are skipped by file name inside the loop.grep --line-bufferedand decoding&in the loop (nosedstage) mean each download starts as soon as its URL is read.[^"<>[:space:]]+, so a plain-text link (<a href="U">U</a> and more) givesUonce..mp4/.movare skipped.downloaded X/Y.The prose now says: on
INCOMPLETE/FAILED, run the block once more (this fetches fresh signed URLs). If a needed image is still missing, mark the work PARTIAL in the commit message andpr_body, name the missing<uuid>s, and never use a placeholder. Existing rules (noAuthorizationheader, no signed URLs in files, commits orpr_body) are unchanged.Testing
gh/curl:gh403 on the issue:downloaded 0/0followed byINCOMPLETEINCOMPLETEtext/htmlresponse were both deleted and reported, givingdownloaded 2/4<a href><img src>link was fetched once&decoded.mp4was skippeddownloaded 0/0with no errorshellcheck(repo args) passes on the extracted block, before and after the second commit.skillsaw 0.18.0 --strictpasses.pre-commitcould not fetch hook repos in the sandbox (TLS error), so I ran the applicablepre-commit-hooksv6.0.0 hooks andlint-release-casesdirectly, and they passed.scan-secretspasses.--max-time 60, and real GitHub downloads (code: verify issue-attachment download in the sandbox on a private repository #1923 covers sandbox verification).Caveat (pre-existing, not changed here)
In this sandbox, Tirith blocks the download block when it is pasted inline as one Bash command, because it cannot parse the brace-group/
while readpipeline. The original block onmainis blocked the same way. Writing the block to a file and runningbash <file>works, and that is how it was tested above. The second commit replaces thecasealternation and[[ ]]with plaintestchecks to match the accepted dialect, but that alone does not unblock the inline paste. This may be worth handling with #1923.Related
#1922 and #1923 also touch this reference doc. Whichever lands second may need a rebase.
🤖 Generated with Claude Code
Closes #1924
Post-script verification
agent/1924-attachment-download-failures)88e5770175ac0cab3a3624255556362ff1e73e63..HEAD)