Skip to content

AH AI edit attribution - #326061

Closed
amunger wants to merge 24 commits into
mainfrom
aamunger/aiEditAttribution
Closed

AH AI edit attribution #326061
amunger wants to merge 24 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 5 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>
Handle client-tool failures that arrive before Copilot registers its permission request, and suppress stale ready actions after terminal completion. Add unit and real Copilot replay coverage for the disconnect race.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep automatic MCP authentication probes non-interactive so unsupported dynamic client registration is only surfaced after the user chooses Authenticate.

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}`);
});
connor4312 and others added 13 commits July 15, 2026 15:18
…onnect-race

agentHost: unblock disconnected client tool calls
…gistration

agentHost: defer interactive MCP client registration
* sessions: prompt timeline rail becomes one scrollbar that fans in on scroll/hover

Reshape the prompt timeline into a single scrollbar lane instead of a pill
column sitting next to the transcript's native scrollbar. At rest it is a plain
scrollbar (the rail draws its own thumb and the transcript's native vertical
slider is hidden while the rail is active). On a deliberate gesture the thumb
recedes and the prompt pills fan in over the same lane with a macOS-dock style
fisheye:

- Hard/fast scroll (wheel-velocity gated, capture phase so it works mid-content
  not just at the scroll limits) blooms the fan centred on where you are, and it
  glides continuously with the viewport as you keep scrolling. The reveal is
  gated on a real scrollTop change, so flicking against the top/bottom limit -
  or programmatic virtualization nudges - never opens it.
- Hovering the lane blooms the fan and lets it follow the cursor; dragging the
  lane scrubs the transcript; clicking a pill still jumps; keyboard focus reveals
  the pills. It quietly collapses back to a plain scrollbar after a short linger
  once you stop scrolling and are not hovering.
- Pills are laid out as an evenly-spaced dock centred in the lane (stable under
  virtualization) rather than scattered by content position; the two-tone
  green/red diff decoration and the hover card are preserved.

Also reduces forced reflows on the hover/scroll paths (position the card and
lane from cached geometry instead of getBoundingClientRect) and avoids churning
the linger timer every scroll frame. Reduced-motion disables the fisheye but
still reveals the calm dock.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* sessions: address prompt timeline PR feedback

- normalize wheel deltas via StandardWheelEvent so line-mode devices trigger the fan
- keep the native scrollbar when the rail is too narrow (below MIN_HOST_WIDTH) to replace it
- use generic mouse listeners for lane scrub + mark guard so touch/iOS works
- track keyboard focus: reveal a calm dock (:focus-within) with the fisheye suppressed
- scale scrollTop into the estimated coordinate space before interpolating the fan focus
- map the thumb/scrub math onto the list viewport height (ScrollbarState-style)
- use --vscode-cornerRadius-circle for the thumb radius
- extract the hard-wheel detector into a named helper

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* distance update

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove low-usage tools from vscode-general tool set

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Initial plan

* Set agents.voice.handsFree to false by default

Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix remote Agent Host dependencies

Include fs-copyfile in REH packages and verify that startup imports are declared in the remote manifest.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Smoke test packaged remote Agent Host

Launch the packaged Agent Host with its bundled Node after native REH builds and require it to bind a WebSocket listener.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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>
Introduce a service-free state machine that reconciles model edits, Agent Host transitions, and disk snapshots with deterministic duplicate, conflict, and dirty-model outcomes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep one reconciler per canonical resource across remote authorities, model lifecycle changes, and resource renames.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the characterization seam introduced for SCM-trigger testing without depending on the concrete repository adapter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
amunger and others added 6 commits July 16, 2026 09:13
Mirror open-model, Agent Host, and disk observations into the canonical registry without changing production telemetry ownership. Keep projection and snapshot comparison diagnostic-only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Capture local and Agent Host references at long-term flush boundaries, compare scoped tracker and details snapshots, and checkpoint repeated windows without changing telemetry ownership. Release closed shadow resources after queued comparisons finish.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move long-term editSources.details ownership to one canonical per-resource stream shared by local models and Agent Host edits. Preserve local focus windows, stats, and ARC while removing the AH synthetic emitter and transitional shadow runtime.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Agent Host edits now ship only through the canonical long-term tracker, so a tracking-scope field cannot distinguish production cohorts. Keep origin and harness as the meaningful Agent Host source dimensions and remove leftover comparison-only helpers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the validated rebased implementation while recording the previously pushed pre-rebase commits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@amunger

amunger commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #326403, which contains the final implementation as one commit on top of latest main.

@amunger amunger closed this Jul 17, 2026
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.

7 participants