Repository navigation
fix(sdk): parse file:// URLs instead of slicing the scheme off - #6482
Merged
Merged
Conversation
Contributor
Author
|
The Could a maintainer re-run the failed job once the mirror is healthy? Nothing in the diff touches the image or its dependencies. |
Closed
75 of 86 tasks
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.
HUMAN:
Fixed
file://source resolution from #6348. I reviewed the diff and the tests; a file URL names a path, not a string to slice.AGENT:
Why
resolve_source_pathhandledfile://by slicing the scheme off (Path(source[7:])). Two valid spellings broke:file://localhost/tmp/skillbecame the relative pathlocalhost/tmp/skill, because the authority segment was treated as a path component.file:///tmp/my%20skillkept the escape, so the resolved path pointed at a directory literally namedmy%20skillinstead ofmy skill.Summary
urlparseand take its path, decoding percent-escapes withunquote; an empty orlocalhostauthority is dropped, and any other authority is preserved as a UNC-style prefix.test_resolve_file_url_with_localhost_authorityandtest_resolve_file_url_decodes_percent_escapesfrom theworktree-test-edge-casesbranch (commit f2fcf6e) without theirxfail(strict=True)markers, per the [Bug]: Edge-case tests expose ~70 bugs across the SDK, agent server, tools and workspaces #6348 menu's acceptance criteria.Issue Number
Part of #6348 (menu sub-items: "file:// URLs are sliced instead of parsed, so the 'localhost' authority becomes a relative path component" and "... so percent-escapes such as %20 are not decoded")
How to Test
Before this change both new cases fail (
WindowsPath('/tmp/my%20skill'), andlocalhost/...as a relative path); after, all threefile_urlcases pass.tests/sdk/plugin/is 384 passed, with five pre-existing network/git-dependent failures that fail the same way on unpatchedmain.ruff check/formaton the touched files are clean.Type
Notes
file:///tmp/skillresolves exactly as before.