fix(projects): strip ephemeral proxy prefix from project_id - #13
Open
GetsEclectic wants to merge 1 commit into
Open
fix(projects): strip ephemeral proxy prefix from project_id#13GetsEclectic wants to merge 1 commit into
GetsEclectic wants to merge 1 commit into
Conversation
In a sandbox whose git remotes are rewritten by an HTTP proxy to local_proxy@127.0.0.1:<port>/git/<owner>/<repo>, the port is ephemeral (new each session) and leaked into the project_id, so issues created in one session became unresolvable in the next and every write-path command aborted with "Cannot find project path". Normalize by stripping the local_proxy@<host>:<port>/git/ prefix to a stable <owner>/<repo>. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Problem (write-blocking)
In a sandbox whose git remotes are rewritten by an HTTP proxy to
http://local_proxy@127.0.0.1:<port>/git/<owner>/<repo>, the<port>is ephemeral — a new port each session._extract_project_id_from_git_remotekeeps everything after the scheme, so the port lands in theproject_id. Issues created in one session become unresolvable in the next, and everytrc update/close/commentaborts with:(Hit in practice running
trcinside Anthropic's Claude-on-the-web cloud sandbox, whose egress proxy rewrites every git remote this way.)Root cause
_extract_project_id_from_git_remote(trace_core/projects.py) strips the URL scheme and.gitsuffix but otherwise returns the remainder verbatim, so the ephemerallocal_proxy@<host>:<port>/git/prefix becomes part of the project identity. The canonical JSONL is unaffected (project_id is dropped on export); only the per-machine SQLite-to-project-path mapping breaks.Fix
After scheme stripping, detect the proxy signature and reduce it to
<owner>/<repo>:Anchored on the literal
local_proxy@userinfo so it cannot touch a real-world remote. Ports37849and38291both normalize to<owner>/<repo>;https://github.com/...andgit@github.com:...remotes are unchanged.Tests
tests/test_proxy_project_id.py: