Skip to content

Empty sessions view: cannot call joinPath#309777

Merged
aeschli merged 3 commits intomainfrom
aeschli/angry-fly-439
Apr 14, 2026
Merged

Empty sessions view: cannot call joinPath#309777
aeschli merged 3 commits intomainfrom
aeschli/angry-fly-439

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented Apr 14, 2026

FIY @sandy081 @bpasero Maybe you want to revisit unknown:///, not clear what kind of errors the user will see with this unresolvable location.

Copilot AI review requested due to automatic review settings April 14, 2026 08:41
@aeschli aeschli enabled auto-merge (squash) April 14, 2026 08:41
@aeschli aeschli self-assigned this Apr 14, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering Bot commented Apr 14, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jrieken

Matched files:

  • src/vs/base/common/uri.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

Screenshot Changes

Base: b8258174 Current: 8933fb8a

Changed (3)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after
agentSessionsViewer/NeedsInput/Dark
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a crash in the Agents/Sessions window caused by URI.joinPath being invoked on URIs with an empty/missing path (e.g. empty sessions view / missing repo metadata), which previously threw [UriError]: cannot call joinPath on URI without path.

Changes:

  • Adjusts the Copilot chat sessions adapter to use a fallback repository URI that includes a path (unknown:///) when repo metadata is missing.
  • Changes URI.joinPath to treat an empty path as '/' instead of throwing.
Show a summary per file
File Description
src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts Uses a safer fallback URI (unknown:///) to avoid downstream joinPath failures when repo URI is missing.
src/vs/base/common/uri.ts Alters core URI.joinPath behavior for empty-path URIs (no longer throws; normalizes to '/').

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread src/vs/base/common/uri.ts Outdated
Comment on lines +362 to +363
// treat empty path as slash to simplify join and normalization
uri = uri.with({ path: _slash });
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

URI.joinPath used to throw for URIs without a path (e.g. URI.parse('foo:') or URI.parse('foo://bar')). With this change it will silently treat an empty path as '/', which contradicts the existing contract validated by src/vs/base/test/common/uri.test.ts (the URI#joinPath test currently asserts these cases throw) and will break those tests/consumers. Consider keeping the throw and fixing the callers that construct path-less URIs (ensure they use a '/' path), or narrowly applying the fallback only for schemes where empty-path join semantics are well-defined and tests are updated accordingly.

Suggested change
// treat empty path as slash to simplify join and normalization
uri = uri.with({ path: _slash });
throw new Error(`[UriError]: cannot join path on URI without path`);

Copilot uses AI. Check for mistakes.
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.

3 participants