Skip to content

AH AI edit attribution #326061

Draft
amunger wants to merge 3 commits into
mainfrom
aamunger/aiEditAttribution
Draft

AH AI edit attribution #326061
amunger wants to merge 3 commits into
mainfrom
aamunger/aiEditAttribution

Conversation

@amunger

@amunger amunger commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

amunger and others added 3 commits July 14, 2026 19:19
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>
Copilot AI review requested due to automatic review settings July 15, 2026 22:06
@amunger amunger changed the title Aamunger/ai edit attribution AH AI edit attribution Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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}`);
});
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.

2 participants