Split session artifacts into artifacts and references - #332687
Merged
Benjamin Christopher Simmonds (benibenj) merged 3 commits intoAug 26, 2026
Merged
Conversation
An artifact is something the session produced that is not an ordinary workspace edit: a pull request or issue it opened, a plan file written outside the workspace, another side effect of its work. A reference is something it did not produce but the user should look at because of the task: the pull request or commit that introduced a bug, a relevant page. The agent now says which it recorded through a mandatory `isArtifact` flag, so the tools are renamed to `add_artifact_or_reference`, `remove_artifact_or_reference` and `list_artifacts_and_references`, and the per-type `createdByThisSession` field is gone — being produced by the session is the definition of an artifact. Entries persisted before this change read back as artifacts. Tool calls render "Added artifact" or "Added reference" from the flag; removal takes its wording from what it actually removed. References get their own pill, always summarized as a count, placed directly after the artifacts pill so the two read as a pair. Only artifacts are promoted into the pull request and issue pills, which poll GitHub, but a reference keeps its link identity so anything those pills already show is offered exactly once. Along the way: - The artifacts pill no longer collapses into a lone entry unless it is a file, whose name and themed icon say what it is; every other single artifact stays behind "1 Artifact" so the row keeps a stable shape. `alwaysSummarize` becomes a `ChatPillSingleEntry` policy interpreted in one place. - Parsing GitHub issue and pull request references out of user messages is removed. It fed the same pills from a second source, which would show a recorded reference twice, and it guessed at intent the agent can now state outright. - A `uri` the client cannot open is rejected when it is recorded, instead of being reported as added and then appearing in no pill at all. - Reading persisted artifacts reports what it could not parse, so a corrupt row no longer empties a session's artifacts without a trace. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benjamin Christopher Simmonds (benibenj)
enabled auto-merge (squash)
August 26, 2026 06:22
Copilot started reviewing on behalf of
Benjamin Christopher Simmonds (benibenj)
August 26, 2026 06:22
View session
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ladislau Szomoru (@lszomoru)Matched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Splits session-produced artifacts from task references across storage, tools, GitHub promotion, and chat pills.
Changes:
- Adds mandatory
isArtifactclassification and separate References UI. - Renames artifact server tools and removes message-based GitHub reference parsing.
- Adds persistence diagnostics, URI validation, tests, and fixtures.
Show a summary per file
| File | Description |
|---|---|
sessionChatInputToolbar.fixture.ts |
Adds artifact/reference fixtures. |
chatTurnPills.test.ts |
Tests single-artifact rendering. |
chatTurnPills.ts |
Configures artifact summary policy. |
chatDropdownPill.ts |
Introduces single-entry policies. |
session.ts |
Adds isArtifact to session entries. |
localAgentHostSessionsProvider.test.ts |
Tests GitHub promotion behavior. |
baseAgentHostSessionsProvider.ts |
Promotes only produced GitHub entries. |
agentHostSessionArtifacts.ts |
Partitions artifacts and references. |
sessionChatPills.test.ts |
Tests References visibility. |
sessionArtifacts.test.ts |
Updates artifact fixtures. |
sessionChatPills.ts |
Registers the References pill kind. |
sessionCustomizations.ts |
Adopts the summary policy enum. |
sessionChatInputToolbar.ts |
Adds and positions References. |
sessionArtifacts.ts |
Builds separate artifact/reference sections. |
chatContributions.test.ts |
Removes obsolete parsing tests. |
artifactServerTools.test.ts |
Tests renamed tool displays. |
agentSideEffects.test.ts |
Removes reference-parsing coverage. |
agentHostPullRequestOperationProvider.test.ts |
Updates Git service mock. |
agentHostMergeOperationProvider.test.ts |
Updates Git service mock. |
agentHostGitStateService.test.ts |
Removes message parsing tests. |
agentHostContributions.test.ts |
Updates Git service mock. |
agentHostChangesetOperationService.test.ts |
Updates Git service mock. |
agentHostChangesetCoordinator.test.ts |
Updates Git service mock. |
sessionTestHelpers.ts |
Updates no-op Git service. |
sessionArtifacts.test.ts |
Tests classification and persistence parsing. |
githubPullRequestReferences.test.ts |
Removes deleted parser tests. |
githubIssueReferences.test.ts |
Removes text parser tests. |
artifactServerTools.ts |
Renames and expands artifact tools. |
githubReferencesContribution.ts |
Stops parsing outgoing messages. |
agentService.ts |
Logs persisted artifact corruption. |
agentHostGitStateService.ts |
Removes GitHub text parsing. |
sessionState.ts |
Removes parsed issue-reference state. |
sessionArtifacts.ts |
Persists and parses classification. |
sessionArtifactCollection.ts |
Validates classified tool input. |
serverToolNames.ts |
Renames artifact tool identifiers. |
githubPullRequestReferences.ts |
Deletes the PR text parser. |
githubIssueReferences.ts |
Retains URL-only issue parsing. |
agentHostGitStateService.ts |
Removes reference attachment API. |
Review details
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (1)
src/vs/platform/agentHost/common/sessionArtifacts.ts:155
readSessionArtifactsaccepts rows that lack their kind-specific payload (for example, afilewithouturior a pull request withoutlink). Such a row makesdroppedremain zero here, thentoSessionArtifactsilently removes it on the client, so the new corruption warning still misses malformed persisted entries. Validate the required fields per artifact type before computingdropped.
const artifacts = readSessionArtifacts({ [SESSION_META_ARTIFACTS_KEY]: raw });
return { artifacts, dropped: raw.length - artifacts.length };
- Files reviewed: 38/38 changed files
- Comments generated: 4
- Review effort level: Balanced
Contributor
Screenshot ChangesBase: Changed (2)Added (4) |
Christof Marti (chrmarti)
previously approved these changes
Aug 26, 2026
- `isArtifact` accepts only a boolean, with an absent field as the sole legacy default. A malformed value such as `"false"` or `null` no longer reads back as an artifact; the entry is rejected and counted among the dropped rows the caller warns about. - A recorded `uri` is validated by the client's own strict `URI.parse` rather than a hand-rolled pattern, so the two can no longer disagree. The previous check accepted values like `foo/bar:baz`, which the client then failed to open, leaving the entry in no pill at all. - Renamed server tools keep answering to the names they were advertised under. `IServerToolGroup` gains `legacyToolNames`, the host translates a legacy name before dispatching, and the display path falls back to it once no advertised tool matches — so restored history and prompts written against `add_artifact` still route and still render. Groups only ever see their current names. - The Sessions and agent host provider specifications now state that `ISession.artifacts` carries both categories and that consumers must use `isArtifact` to tell them apart. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benjamin Christopher Simmonds (benibenj)
requested a review
from Sandeep Somavarapu (sandy081)
as a code owner
August 26, 2026 07:40
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sandeep Somavarapu (sandy081)
approved these changes
Aug 26, 2026
Benjamin Christopher Simmonds (benibenj)
merged commit Aug 26, 2026
27fb212
into
main
54 of 55 checks passed
Benjamin Christopher Simmonds (benibenj)
deleted the
benibenj/agents/artifacts-tool-enhancements
branch
August 26, 2026 09:20
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.
An artifact is something the session produced that is not an ordinary workspace edit: a pull request or issue it opened, a plan file written outside the workspace, another side effect of its work. A reference is something it did not produce but the user should look at because of the task: the pull request or commit that introduced a bug, a relevant page.
The agent now says which it recorded through a mandatory
isArtifactflag, so the tools are renamed toadd_artifact_or_reference,remove_artifact_or_referenceandlist_artifacts_and_references, and the per-typecreatedByThisSessionfield is gone — being produced by the session is the definition of an artifact. Entries persisted before this change read back as artifacts. Tool calls render "Added artifact" or "Added reference" from the flag; removal takes its wording from what it actually removed.References get their own pill, always summarized as a count, placed directly after the artifacts pill so the two read as a pair. Only artifacts are promoted into the pull request and issue pills, which poll GitHub, but a reference keeps its link identity so anything those pills already show is offered exactly once.
Along the way
alwaysSummarizebecomes aChatPillSingleEntrypolicy interpreted in one place.urithe client cannot open is rejected when it is recorded, instead of being reported as added and then appearing in no pill at all.Notes
SessionChatPills_ReferenceSingleandSessionChatPills_ArtifactsAndReferencesfixtures need a screenshot baseline from CI.createdByThisSession: falsereads back as an artifact and can therefore become the session's main pull request. It only affects sessions that recorded someone else's pull request.Validation
tsc --noEmit, eslint over every changed file,valid-layers-check, and the affected node and chromium suites all pass.