-
Notifications
You must be signed in to change notification settings - Fork 9
docs: add case study for image upload failures in private repos #1034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #1033
…te repos This case study analyzes why images uploaded to PR comments didn't display in a private repository (kogeletey/egida-test) while the same approach worked correctly in a public repository. Key findings: - raw.githubusercontent.com URLs require authentication for private repos - GitHub returns 404 (not 403) for unauthenticated requests to private files - gh gist create doesn't support binary files as a fallback - GitHub has no REST API for uploading images to issue/PR comments Included artifacts: - Complete session log from the failed image upload session - Summary of comments from both failed and successful PRs - Timeline reconstruction and root cause analysis - Proposed solutions including external image hosting Fixes #1033 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit adds the raw data collected for the case study: - failed-session-log.txt: Complete execution trace from the failed session - successful-pr-comments-raw.json: Comments from successful public repo PR - failed-pr-comments-summary.json: Summary of comments from the failing PR 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
This reverts commit d5ee7ea.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
Let's do |
|
🤖 AI Work Session Started Starting automated work session at 2025-12-29T19:44:09.117Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
- Add new "Uploading images to GitHub comments" section to all prompt files - Clarify that raw.githubusercontent.com URLs only work for public repos - Provide alternative solutions for private repos (external hosting, base64, etc.) - Note that gh gist create doesn't support binary files - Fix Prettier formatting in case study README.md This addresses the root cause of issue #1033 by providing guidance to the AI agent on how to properly handle image uploads in private repositories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
These lines should be removed. Also your analysis is wrong, because user has authentication and has access to pull request in private repository, yet images are not shown. You need to redo the analysis based on data in original issue. |
|
🤖 AI Work Session Started Starting automated work session at 2025-12-29T20:04:02.860Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
…doesn't support auth - Remove incorrect external image hosting recommendations per user feedback - Clarify that raw.githubusercontent.com does not support authentication at all - Even authenticated users cannot view images from private repos via raw URLs - Browser's HTTP requests to fetch images cannot carry GitHub authentication tokens - Update case study with corrected root cause analysis - Recommend base64 encoding as the only viable solution for private repo images 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
Can we try https://github.com/link-foundation/gh-upload-image? Will it work? |
|
🤖 AI Work Session Started Starting automated work session at 2025-12-31T10:23:23.867Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
Investigation: gh-upload-image ToolI investigated the gh-upload-image tool as requested. What the Tool DoesThe tool aims to upload images to GitHub using the undocumented Test ResultsI installed and tested the tool: $ npm install github:link-foundation/gh-upload-image
$ npx gh-upload-image test-image.png -r link-assistant/hive-mind --verboseResult: 422 Unprocessable Entity error The API returned GitHub's "Your browser did something unexpected" error page, which indicates the endpoint is detecting that the request is not coming from an actual browser session. Root CauseThe undocumented
The OAuth token from ConclusionCurrently, gh-upload-image does NOT work due to GitHub's anti-automation measures on this undocumented endpoint. The concept is sound - if it worked, it would solve the private repository image problem perfectly since Current Recommended Solutions (from existing guidance)For now, the guidance in the system prompts remains correct:
If the This analysis was based on testing performed on 2025-12-31 |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
This PR addresses issue #1033 (image uploads not working in private repository comments) by:
Key Findings
raw.githubusercontent.comdoes not support authentication at allTechnical Details
According to GitHub Community Discussion #160828:
What Failed
PR comment in
kogeletey/egida-test(private) referenced images like:These URLs return 404 for everyone - even authenticated users with repository access - because the browser making the image request cannot authenticate with
raw.githubusercontent.com.Solution Implemented
Added new "Uploading images to GitHub comments" guidance section to all prompt files:
src/claude.prompts.lib.mjssrc/agent.prompts.lib.mjssrc/codex.prompts.lib.mjssrc/opencode.prompts.lib.mjsThe guidance includes:
Files Changed
docs/case-studies/issue-1033/README.md- Comprehensive case study with corrected analysisdocs/case-studies/issue-1033/logs/- Supporting logs and datasrc/*.prompts.lib.mjs- Added private repo image handling guidance to all 4 prompt files.changeset/private-repo-image-guidance.md- Updated changesetExternal References
Test Plan
Fixes #1033
🤖 Generated with Claude Code