* OTel visibility in Copilot Chat UI (#47)
* [msrc/1.123] 114763
* Add maxAttributeSizeChars configuration to OpenTelemetry settings
---------
Co-authored-by: Zhichao Li <zhichli@microsoft.com>
(cherry picked from commit 042dc59dbb51f58ef03a6909d5dfb0292a6b2576)
(cherry picked from commit be6ab8b589)
* Prompt before connecting to non-loopback remote host:port authorities (#46)
A direct `<host>:<port>` remote authority (no resolver `+` prefix) bypasses
resolver extensions and connects straight to the given server. Since this form
can originate from untrusted sources (e.g. the `remoteAuthority` of a
`.code-workspace` file), a crafted workspace could silently point the window's
extension host backend at an attacker-controlled server.
Centralize a confirmation prompt at the connection point in the renderer:
when resolving a direct authority whose host is not loopback (localhost,
127.0.0.1, ::1), ask the user to confirm before connecting and abort if
declined. Add `isLoopbackHost` helper and tests.
(cherry picked from commit 9505d0fca49eadb707c450d18dcb41a46b720a9e)
(cherry picked from commit 9673132502)
* GitHub - improve host parsing (#48)
(cherry picked from commit 4b6e2467dbd828018d602f73cc25d1b11f699d2c)
(cherry picked from commit 9fea92e141)
* path traversal fix (#50)
* fix path traversal
* fix compilation
(cherry picked from commit 9b31ff896671125cbfc65f33731c4a99660d6201)
(cherry picked from commit a703741497)
* Path - improve isEqualOrParent calculation (#49)
(cherry picked from commit 0f1ba1ea103757f3023cc1f9c3eb7327c3ec4b02)
(cherry picked from commit 5927baa7af)
---------
Co-authored-by: Zhichao Li <Li.Zhichao@microsoft.com>
Co-authored-by: Zhichao Li <zhichli@microsoft.com>
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
Co-authored-by: Ladislau Szomoru <lszomoru@microsoft.com>
Co-authored-by: Sandeep Somavarapu <sasomava@microsoft.com>
* Add ChatResponseInfoPart proposed API and stream.info()
Add a new 'info' chat content kind that mirrors the existing 'warning'
path and renders via ChatErrorContentPart with ChatErrorLevel.Info, which
already has blue notification styling (.chat-info-codicon). Expose this
via a new ChatResponseInfoPart proposed API and stream.info() method.
Cherry-picked from 87ce530566 (src/vs and src/vscode-dts parts only).
* Disable github.copilot.chat.cli.remote.enabled in agents window
The /remote slash command targets the CLI chat in the main workbench.
Explicitly keep it disabled in the agents sessions app via the session
configurationDefaultsOverrides.
* Adopt types in copilot ext
Starts working through some basic repo wide eslint rules for the copilot extension. Stuff like missing semicolons and missing readonly modifiers for disposables
* Fix Copilot CLI terminal profile launch for non-default shells (fish, Git Bash, custom profiles, etc)
* retrun parentehsis
* better follow terminLEnvironment
* Make sure to cover windows for powershell well
* addres feedback on fish
* clean up non null asesrtion
* add support for windows
* use git bash converter from terminal suggest code
* comment should be less verbose
* better qaulity comments
* tools: add binary file support with hexdump display
Adds support for reading and displaying binary files in the read file tool
with a hexdump-formatted view. This enables better handling of binary content
in the IDE context without attempting to interpret them as text.
- Adds hexdump utility to format binary data in a readable hex/ASCII view
- Extends readFileTool to detect binary files and provide formatted output
- Adds binaryFileHexdump prompt component for displaying binary content
- Integrates binary file variable support in file variable display
- Updates test fixtures with binary file handling scenarios
Fixes https://github.com/microsoft/vscode/issues/284178
Fixes https://github.com/microsoft/vscode/issues/299973
(Commit message generated by Copilot)
* pr comments
* baseline update
* baseline update
* Update devcontainer.
* Switch module settings, turn on `noEmit`, and drop explicit `lib`.
* module->namespace
* Switch troublesome packages to use `import = require()` syntax.
* Remove unnecessary declaration file.
* Drop DOM declarations.
* Fix up errors from more restrictive signature of `vscode.l10n.t`.
* Fix chat-lib script - we no longer have that stray file.
* Update dependencies.
* The reckoning: Update all the vscode.proposed.*.d.ts files
and run the update on post install
* Improve proposed update and check
- Pin it to a commit
- Require that update be run manually, not as post install
- Add PR check
---------
Co-authored-by: João Moreno <joaomoreno@users.noreply.github.com>
* nes: tests: fix trailing whitespace sensitivity
* nes: xtab: split promptCrafting.ts up
* nes: recent files: split up into functions
* nes: recent files: more strategies to include recent files
* fix: transform older focal ranges through edit chain in historyEntriesToCodeSnippet
Older history entries' focal ranges (from getNewRanges()) pointed into
stale document states, not the most recent content. Now each older
edit entry's ranges are projected forward through subsequent edits
using StringEdit.applyToOffsetRange(). VisibleRanges entries no longer
contribute focal ranges since their offsets cannot be reliably
transformed.
* add validator
* [POC] Growth chat sessions with NeedsInput status indicator
Proof of concept for https://github.com/microsoft/vscode/issues/292430
This demonstrates using the agent sessions sidebar to drive Copilot
awareness for anonymous/free-tier users by showing a session with
"Input Needed" status that displays "GitHub Copilot is now enabled.
Try for free?" in the sidebar.
**GrowthChatSessionItemProvider** — Returns a single session item with
`status: NeedsInput` so the sidebar immediately shows the "Input Needed"
badge and description text without the user needing to click first.
**GrowthChatSessionContentProvider** — When the user opens the session:
1. Only serves content for the known `growth-tip` session ID. Untitled
sessions (created when navigating away) get empty history, preventing
a bug where users were trapped in a loop of re-created sessions.
2. Uses `activeResponseCallback` to stream the response (markdown +
confirmation part) rather than static history. The callback keeps
the response alive by awaiting token cancellation, which is critical
to avoid a race condition where `$handleProgressComplete` deletes
queued progress chunks before the main thread initializes the session.
3. Schedules a delayed `refresh()` so the sidebar re-queries items and
`handleSessionModelOverrides` can detect the NeedsInput model state.
**GrowthChatSessionParticipant** — Simplified to a basic request handler.
Requires exposing `NeedsInput = 3` in the extension API:
- `vscode.proposed.chatSessionsProvider.d.ts` — Add NeedsInput to enum
- `extHostTypes.ts` — Add NeedsInput = 3 to ChatSessionStatus
- `extHostChatSessions.ts` — Add case 3 to convertChatSessionStatus
- **Can't exit growth session**: Content provider was serving growth
content for ALL URIs with the copilot-growth scheme, including
untitled sessions created on navigation. Fixed by checking session ID.
- **NeedsInput never triggers with static history**: Confirmations in
history don't set NeedsInput because the response is already complete.
Fixed by using activeResponseCallback to keep the response active.
- **activeResponseCallback race condition**: Callback completing before
main thread initialization causes $handleProgressComplete to delete
queued chunks. Fixed by keeping the callback alive until cancellation.
- Remove debug logging ([GrowthItemProvider], [GrowthContentProvider])
- Activation blockers temporarily commented out in extension.ts
- Cloud agent registration temporarily disabled
- No gating on user state (anonymous, free tier, signed-in, etc.)
- Hardcoded message content needs localization
- No telemetry or analytics
- No dismiss/archive mechanism for the growth session
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Mark copilot-growth session as isReadOnly instead of canDelegate (adopt microsoft/vscode#8e9ec4c5f59)
* Clear growth session attention badge on open and remove placeholder boilerplate
- Track seen state in GrowthChatSessionItemProvider; mark session as
seen when content provider is opened so NeedsInput badge clears
without requiring a confirmation click
- Remove confirmation hack, never-resolving promise, and delayed
refresh from content provider; return a request/response history
with a Copilot overview instead
- Add random tip pool to participant request handler
- Remove debug sendMessage command
- Register agent for isReadOnly contributions so request routing works
* hacks to not clear eager calls to provideChatSessionContent()
* tidy
* off by default
* update config file
* simplify
* config
* remove merge accident
* codereview
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* utils: implement AsyncIterUtils#map/filter/etc.
* fix streamToLines
* completions checks for cancellations similarly to SSEProcessor
* fix: add cancellation checks and finishedCb call to convertStreamToApiChoices
Align convertStreamToApiChoices (used by fetchAndStreamCompletions2)
with SSEProcessor (used by fetchAndStreamCompletions):
- Pass cancellation token and check it after awaiting each chunk,
after finishedCb, and after yielding each choice
- Add finally block to destroy the network stream on completion/cancel
- Call finishedCb with finished=true for unfinished completions at
stream end (matches SSEProcessor.finishSolutions behavior)
* fix: prevent double-yield in convertStreamToApiChoices
Add a yielded flag per completion, matching SSEProcessor's
solution.yielded guard. Without this, StreamedCompletionSplitter
could yield a trimmed first segment on a newline, then yield the
full untrimmed text again when finish_reason arrives — resulting
in a spurious ghost text suggestion cached at the wrong location.
Also ensure finish_reason explicitly overrides solutionDecision
to yieldSolution=true, continueStreaming=false, matching
SSEProcessor's semantics.
* Initial plan
* Filter out Claude plan files from edit tracking
- Modified `_onWillEditTool` to filter out plan files before tracking edits
- Plan files (in ~/.claude/plans/) are now excluded from the "files changed" UI
- Added unit tests to verify plan file filtering logic works correctly
- Regular files and files in other .claude subdirectories are still tracked properly
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
* Improve plan file filtering with proper path comparison
- Use `isEqualOrParent` instead of string prefix comparison for robust path checking
- Prevents false positives like filtering `.claude/plans-backup/` files
- Added test case to verify files with similar prefix are not filtered
- All 9 tests pass
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
* Refactor: Move plan file filtering to ExternalEditTracker
- Added constructor parameter `ignoreDirectories` to ExternalEditTracker
- Filtering logic now lives in trackEdit() method for better testability
- Updated claudeCodeAgent to pass plan directory when creating tracker
- Created comprehensive unit tests for ExternalEditTracker class (7 tests)
- Removed old planFileFiltering.spec.ts as logic moved to tracker
- All tests pass (7 new + 9 existing = 16 total)
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
* Fix formatting: Remove extra blank lines in constructor
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
* fix tests
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Co-authored-by: Tyler Leonhardt <tyleonha@microsoft.com>
* Add question carousel functionality and related types for chat interactions
* feat: enhance logging for question carousel processing and answer conversion
* feat: enhance answer processing in AskQuestionsTool to support freeform text input
* cleanup: remove unused AskQuestionResult type from IQuestionAnswer
* clenaup: restore package.json
* feat: enhance AskQuestionsTool to handle no stream scenario and improve carousel answer conversion
* logService: feat: migrate ITracer to ILogger interface
Replace deprecated ITracer interface with ILogger across inline edits
and xtab providers. Add LogTarget.fromCallback() and withExtraTarget()
to ILogger for callback-based logging support previously provided by
ITracer's sub() method.
* tracing: migrate off of ITracer in favor of ILogService
* Update src/extension/xtab/node/xtabProvider.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* address copilot review
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds support for file deletion in the apply_patch tool by introducing
new VS Code API types for workspace-level file edits. The apply_patch
tool now properly reports deleted files through the new workspaceEdit()
response stream method.
- Introduces ChatWorkspaceFileEdit interface to represent file-level
operations (create, delete, rename) with optional oldResource and
newResource properties
- Adds ChatResponseWorkspaceEditPart class for workspace edits containing
file-level operations
- Updates ExtendedChatResponsePart type to include the new workspace edit
part type
- Adds workspaceEdit() method to ChatResponseStream for reporting
file-level edits
- Modifies applyPatchTool to track deleted files in a separate set and
report them through the new workspaceEdit() method
- Removes subagentInvocationId from ChatToolInvocationData base interface
and moves it to optional streamData parameter in beginToolInvocation()
- Changes chatStreamToolCallId from readonly to mutable in
LanguageModelToolInvocationOptions to allow modifications
Fixes https://github.com/microsoft/vscode/issues/275705
(Commit message generated by Copilot)
* Start work on handling tool calls as they stream in
* Explore partial tool streaming
* consume new proposal
* Match main PR
* Better partial json handling
* Plumb through tool call id to invoke
* Hack internal ids to be the stream id
* Add suppot for a few more stream handlers
* Accumulate args
* Show lines instead of characters
* Fix tests
* Leave debug string commented
* Feedback
Enables the same `no-unexternalized-strings` with have in `vscode` in this repo. This make sure we have a more consistent style across repos and when generating edits
issue: The Array.isArray(value) check at line 113 will never be reached because arrays are also objects in JavaScript. The earlier check at line 105 (typeof value === 'object') will catch arrays first and pass them to stringifyObj(), making the array-specific handling code unreachable.