Skip to content

fix(sdk): avoid duplicate URI scheme after leading whitespace - #6449

Open
ktz03 wants to merge 1 commit into
volcengine:mainfrom
ktz03:fix/sdk-uri-leading-whitespace
Open

ktz03 wants to merge 1 commit into
volcengine:mainfrom
ktz03:fix/sdk-uri-leading-whitespace

Conversation

@ktz03

@ktz03 ktz03 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Description

The Python SDK sends viking://viking://resources/notes for a canonical resource URI preceded by a space. Recognize the existing scheme after leading whitespace so ls and read retain one scheme.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Fixes #6445

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Recognize a canonical viking:// URI after removing leading whitespace.
  • Preserve canonical suffix characters, shorthand paths, internal spaces, and root forms.
  • Extend the existing SDK behavior tests with eleven successful-response cases for public ls and read request URIs.

Testing

On Windows with Python 3.12.14 and httpx 0.28.1, using the exact SDK source component overlay and the existing SDK test file:

  • Baseline: 3 failed, 10 passed, 89 deselected. The failures are the three duplicate-prefix cases.
  • Fixed: 13 passed, 89 deselected. This covers eleven regression cases and two adjacent existing positive tests.
  • A real localhost endpoint returned controlled HTTP 200 responses for eleven fixed SDK calls; all eleven decoded request URIs matched expectations. This coverage overlaps the regression table.

The full SDK suite and an actual OpenViking server, storage, or model integration were not run.

The local source-overlay harness was invoked with python test_scripts/run_focused_pytest.py baseline baseline-native and python test_scripts/run_focused_pytest.py fixed fixed-native. It passed the test file to pytest.main with an empty local configuration and selected resource_uri_normalization_preserves_canonical_suffix or ls_and_tree_preserve_query_options_and_pagination or glob_normalizes_scope_uri. This was a focused component run, not a full checkout test run. The public request reproduction is included in #6445.

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Not applicable.

Additional Notes

This is a focused normalization fix. It adds no dependencies and leaves the existing shorthand branch intact. No additional documentation, explanatory code comments, or dependent change is required. The full-suite checkbox remains unchecked because validation was limited to the selected thirteen tests.

Recognize the existing scheme after leading whitespace while preserving
canonical suffix characters and the existing shorthand/root branches.
Cover public ls/read request URIs with successful-response regressions.
@ktz03
ktz03 marked this pull request as ready for review October 23, 2026 01:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Bug]: Python SDK duplicates URI scheme after leading whitespace

1 participant