Skip to content

fix: open only http and https links from chat - #232

Merged
dungdong-aws merged 8 commits into
Amazon-Q-Developer:feature/dungdongfrom
dungdong-aws:fix/chat-link-schemes
Nov 18, 2026
Merged

dungdong-aws merged 8 commits into
Amazon-Q-Developer:feature/dungdongfrom
dungdong-aws:fix/chat-link-schemes

Conversation

@dungdong-aws

@dungdong-aws dungdong-aws commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Open chat and legacy web links only when they use HTTP or HTTPS and include a host.
  • Apply the same validation to external window/showDocument requests from the language server. Other schemes are rejected with an error and are not opened.
  • Preserve the original validated URL string so OAuth and sign-in query parameters remain unchanged.
  • Retain the VS Code URI-object fallback for compatibility.
  • Return an error to the language server when the link is not opened.

Server-side companion: Amazon-Q-Developer/language-servers#3061 applies the same web-URL requirement to the MCP OAuth authorization endpoint.

Verification

  • npm run testCompile -w packages/amazonq
  • npm run compileOnly -w packages/amazonq
  • Changed-file ESLint
  • Changed-file Prettier
  • git diff --check
  • Added positive and negative tests for chat links and external ShowDocument requests.

@dungdong-aws dungdong-aws changed the title fix(amazonq): open only http and https links from chat fix: open only http and https links from chat Oct 29, 2026
@dungdong-aws
dungdong-aws changed the base branch from main to feature/dungdong October 29, 2026 21:49
@dungdong-aws dungdong-aws reopened this Oct 29, 2026
@github-actions

Copy link
Copy Markdown
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@dungdong-aws

Copy link
Copy Markdown
Contributor Author

Follow-up 29be8c1bd fixes the desktop CI test seam. The production handler was unchanged: the new tests now stub vscode.window.showWarningMessage directly, assert the exact modal request, and verify rejected schemes never prompt or open. Independent review accepted exact HEAD 29be8c1bdd99523ce41fb9b4385b8d00a97c6cd3. Fresh CI is required before merge.

@dungdong-aws
dungdong-aws marked this pull request as ready for review November 16, 2026 20:29
@dungdong-aws
dungdong-aws requested a review from a team as a code owner November 16, 2026 20:29
@dungdong-aws

Copy link
Copy Markdown
Contributor Author

The repeated desktop CI failures were caused by the raw-string openExternal workaround bypassing the shared test stub and reaching VS Code’s native external-website dialog. Fixed in ed6903cca by injecting the opener into registerMessageListeners with the production default unchanged; tests now control the final sink directly while executing the real validation, modal, OAuth preservation, fallback, and error paths. Independent review accepted exact HEAD ed6903cca009c3bec57c5143bf87eadbeba8199f. Fresh desktop CI is required.

…t-link-schemes

# Conflicts:
#	packages/amazonq/test/unit/amazonq/lsp/chat/messages.test.ts
@dungdong-aws
dungdong-aws merged commit b30e096 into Amazon-Q-Developer:feature/dungdong Nov 18, 2026
18 checks passed
dungdong-aws added a commit that referenced this pull request Nov 19, 2026
* fix: read developer override settings from user settings only (#230)

* fix(amazonq): read developer override settings from user settings only

* fix(amazonq): scope packaged developer settings

* fix(amazonq): use extension mode for dev overrides

* fix(amazonq): defer developer settings until activation

* fix(amazonq): own developer settings lifecycle

* fix(amazonq): scope developer settings in manifest

* fix: show code issue text as plain text in hovers and tooltips (#231)

* fix(amazonq): show code issue text as plain text in hovers and tooltips

* fix(amazonq): keep code issue text wrapping between words in hovers and tooltips

MarkdownString.appendText turns every space into  , so long finding text
could only wrap mid-word. Escape the text with a helper that keeps spaces.

* fix: keep MCP server setting values out of the Amazon Q log (#240)

The chat webview message log keeps MCP settings messages with the values
of the name, transport, scope, timeout and command fields and tool
permission choices. The URL keeps only its origin, arguments keep only
flag names, env variables and headers keep only their names, and other
field values are hidden. Other messages are logged as before.

* fix: open only http and https links from chat (#232)

* fix(amazonq): open only http and https links from chat

* fix: validate external language server links

* fix: preserve validated external link queries

* test: stub external link confirmation directly

* test: inject external link opener

* fix(amazonq): open validated language-server web links without an extra prompt
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.

4 participants