You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* agent-host: report git-driven session file diffs (Written by Copilot)
Adds an alternative diff source for agent sessions that derives changes
from the working-tree git state instead of from edit-tool emissions, so
edits made via terminal/shell commands also show up in the Changes view.
Approach
--------
* IAgentHostGitService gains computeSessionFileDiffs() and showBlob().
* gitDiffContent.ts encodes 'git-blob:' content URIs that pin a blob to
a session + sha + repo-relative path.
* AgentService routes 'git-blob:' resourceRead requests to
gitService.showBlob(); AgentHostFileSystemProvider.stat() short-
circuits 'git-blob:' alongside 'session-db:' so the diff editor's
stat-then-read flow works end-to-end.
* AgentSideEffects._tryComputeGitDiffs runs after each turn (debounced
with the existing diff scheduler) and overrides edit-tool diffs when
git is available.
Tests
-----
Unit + integration coverage in src/vs/platform/agentHost/test/node/.
* agent-host: regression tests for git-blob: stat fast-path
Adds five tests against AgentHostFileSystemProvider covering the
synthetic content scheme fast-path in stat(): git-blob: and
session-db: URIs must return a File stat directly without trying
to list a parent directory that doesn't exist.
Verified by reverting the git-blob: branch of the theallowlist
new 'git-blob: stat' and 'full stat-then-read round-trip' tests
fail with EntryNotFound, which is exactly the error the diff
editor surfaced when opening a diff of a new file.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agent-host: address Copilot review feedback
- agentHostGitService: bump default execFile maxBuffer to 32MB so
diff output in large repos doesn't fail with ENOBUFS and silently
drop terminal-driven diffs.
- agentHostGitService.showBlob: validate sha is a hex object name
before passing it to git, so a malformed git-blob: URI can't
inject options or resolve to surprising refs.
- mockAgent terminal-edit branch: void+catch the async IIFE so a
filesystem failure surfaces as a chat delta instead of an
unhandled rejection (test flake source).
- agentSideEffects.test: replace setTimeout(100) with awaiting the
SessionDiffsChanged envelope event for both new diff-computation
deterministic and immune to slow CI.tests
- sessionDiffsRealSdk integrationTest: shell-quote the target file
path so temp dirs containing spaces don't break the prompt.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agent-host: use IFileService and INativeEnvironmentService in AgentHostGitService
Replace direct fs/promises and os.tmpdir usage with platform services so
the temp-index dance in computeSessionFileDiffs goes through the same
file system abstraction as the rest of the workbench. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agent-host: set COMMAND_HOOK_LOCK=1 in temp-index env for GVFS repos
Mirrors the extension's buildTempIndexEnv which sets this flag to avoid
holding the GVFS command hook lock during temp-index git operations.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agent-host: inject IAgentHostGitService via DI into AgentSideEffects
Instead of threading gitService through IAgentSideEffectsOptions, register
it in the local ServiceCollection and inject it via @IAgentHostGitService
decorator, which is the normal pattern everywhere else. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix deleted file diffs: use IChatSessionFileChange2 with undefined modifiedUri for deletions
For deleted files, the 'modified' side of the diff editor must be absent.
The renderer detects deletions via `change.modifiedUri === undefined`, so
producing `IChatSessionFileChange2` (which carries a `uri` key alongside
optional `modifiedUri`) is the right shape.
Previously diffsToChanges returned IChatSessionFileChange (required
modifiedUri) and fell back to the deleted file's pre-deletion path as
modifiedUri, causing the diff editor to try to read a nonexistent file.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments