AH AI edit attribution #326061
Draft
amunger wants to merge 3 commits into
Draft
Conversation
Attribute Agent Host file edits in a workbench-side synthetic tracker and emit scoped long-term edit source details after disk reconciliation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the canonical copilotcli provider identifier for harness metadata and GitHub edit-telemetry forwarding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoid recording disk-based Agent Host edit attribution when an open text model has unsaved changes, pending a product decision on dirty-document reconciliation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Agent Host AI edit attribution to edit telemetry.
Changes:
- Tracks Agent Host file edits and reconciles them with current file contents.
- Adds harness, origin, and tracking-scope telemetry metadata.
- Adds focused attribution and dirty-model tests.
Show a summary per file
| File | Description |
|---|---|
textModelEditSource.ts |
Adds Agent Host metadata to chat edit sources. |
editTracker.ts |
Exposes pending external-edit application. |
editSourceTrackingImpl.ts |
Uses the shared telemetry sender. |
editSourceTrackingFeature.ts |
Registers Agent Host tracking. |
editSourceTelemetry.ts |
Defines and sends detailed telemetry. |
agentHostEditSourceTracking.ts |
Implements Agent Host attribution tracking. |
agentHostEditSourceTracking.test.ts |
Tests attribution and dirty-model handling. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Medium
Comment on lines
+303
to
+305
| if (!this._detailsEnabled.get() || action.type !== ActionType.ChatToolCallComplete || !isAhpChatChannel(envelope.channel.toString())) { | ||
| return; | ||
| } |
Comment on lines
+412
to
+426
| private async _readText(resource: URI, missingAsEmpty: boolean): Promise<string | undefined> { | ||
| try { | ||
| const value = (await this._fileService.readFile(resource)).value.toString(); | ||
| if (value.includes('\0')) { | ||
| this._logService.trace(`[AgentHostEditSourceTracking] Skipping binary file ${resource.toString()}`); | ||
| return undefined; | ||
| } | ||
| return value; | ||
| } catch (error) { | ||
| if (missingAsEmpty && toFileOperationResult(error) === FileOperationResult.FILE_NOT_FOUND) { | ||
| return ''; | ||
| } | ||
| throw error; | ||
| } | ||
| } |
Comment on lines
+213
to
+215
| this.flush('10hours').then(() => this._onDidExpire(), error => { | ||
| this._logService.error(`[AgentHostEditSourceTracking] Failed to flush ${this.resource.toString()}: ${error}`); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.