Skip to content

fix(client): honor explicit resource URL handle mode - #4254

Open
rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/explicit-resource-handles-20261013
Open

rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/explicit-resource-handles-20261013

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

Description

An explicit resource_urls=handle choice was dropped by the Go SDK and the dsh plugin. On deployments configured with RESOURCE_URL_MODE=public, the server consequently inherited the public setting. The plugin's restricted-key retry also kept inheriting that setting instead of switching to handles.

Both clients now send explicit handle selections. Omitted/empty SDK options still inherit the deployment default, and the plugin still defaults to public URLs. The JSON-search and streamed-answer fallback tests exercise the actual resource-resolving routes.

Type of Change

  • Bug fix
  • Test

Testing

  • Go SDK: the original code fails six handle-mode request cases while eighteen controls pass; the fix passes all twenty-four. Actual loopback HTTP/SSE requests cover message history, both search APIs, both chat APIs and stream resumption.
  • From client: go test -count=1 ./... and go vet ./... pass.
  • From packages/dsh-weknora: locked npm ci, npm test (60 tests), and npm run typecheck pass. Four new client regressions fail against the original implementation; twelve client controls pass there.
  • Go formatting and git diff --check pass. Full root make test is blocked by uncached dependencies with GOPROXY=off; root make lint cannot run because golangci-lint is not installed locally. Full root checks are not claimed to pass.

Checklist

  • Changed source files are formatted
  • Targeted package tests pass
  • Broader local-check limitations documented above
  • Whole patch reviewed, including an independent review of the plugin changes
  • Added regressions covering both clients and default behavior

No API changes. Prepared and checked with Codex assistance.

Copilot AI balanced review requested due to automatic review settings October 13, 2026 14:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation consistently preserves explicit handle selections and provides comprehensive regression coverage.

0 open findings

What changed in this PR

Fixes explicit resource_urls=handle handling in the Go SDK and dsh plugin while preserving default inheritance behavior.

Changes:

  • Sends explicit handle mode instead of omitting it.
  • Corrects restricted-key fallback to retry with handles.
  • Adds HTTP, JSON-search, and streaming regression coverage.
File Description
packages/​dsh-weknora/​test/​helpers/​mock-weknora.mjs Models deployment defaults and route-specific restrictions.
packages/​dsh-weknora/​test/​client.test.mjs Tests explicit handles and restricted-key fallback.
packages/​dsh-weknora/​src/​client.ts Always sends the selected resource URL mode.
client/​resource_urls.go Preserves explicit Go SDK handle selections.
client/​resource_urls_test.go Updates helper-level expectations.
client/​resource_urls_http_test.go Covers all affected Go SDK routes over HTTP/SSE.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants