Files
vscode/build/agentHost
roblourensandCopilot 675354c07e agentHost: support copilotd metadata and schema controls (#339034)
* agentHost: support copilotd metadata and schema controls

Normalize VS Code and copilotd metadata behind host-neutral helpers and recognize the advertised session/model configuration keys. Preserve compatible outgoing metadata, retries, steering display records, and context usage across restoration.

Keep generated declarations pinned without vendoring schemas, and add shared compatibility and real-handler wire regression coverage.

(Written by Copilot)

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

* agentHost: add app-compatible tool presentation fallbacks

Recognize known Copilot app tool aliases when host presentation is generic, while preserving explicit metadata and existing tool cards. Keep replacement request metadata across retries.

(Written by Copilot)

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

* agentHost: simplify config properties and defer prompt metadata

Replace generic enum bindings with concrete schema-property selectors and explicit approval/isolation conversions. Remove model-text and command-marker support, their generated contracts, contribution and custom persistence for a separate change.

(Written by Copilot)

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

* agentHost: break tool presentation import cycle

Move inline tool-input extraction to the dependency-light input module and retain the sessionState re-export. Keep Copilot tool presentation from importing the state facade that already depends on metadata readers.

(Written by Copilot)

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

* agentHost: repair session picker fixture setup

Keep fixture providers aligned with schema-aware pickers and register their quick input dependency, fixing screenshot render failures without changing production behavior.

(Written by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-02 01:04:45 +00:00
..
…

Copilot metadata contracts

copilotd-source.json records the upstream repository, source commit, and spec path. Schemas are not vendored. The generator's small contract list maps the 15 selected schema filenames to stable TypeScript export names.

After installing the root development dependencies:

npm run agent-host:generate-copilot-meta -- --source /path/to/copilot-host
npm run agent-host:check-copilot-meta -- --source /path/to/copilot-host

generateCopilotMetadata.ts uses the exactly pinned json-schema-to-typescript development dependency to produce checked-in copilotdMetadata.ts. The workspace marks the generated folder read-only. Both commands require an explicit local upstream checkout containing the pinned commit. git show reads the committed inputs, so the checkout's current branch and uncommitted changes do not affect generation. References resolve only through the selected schemas at that commit; filesystem and HTTP resolution are disabled. Nothing is fetched, and the upstream checkout is never modified. --check generates in memory and exits nonzero on missing or stale output or invalid inputs without writing files.

Ordinary builds and unit tests use the checked-in declarations and fixtures. They do not need an upstream checkout, network access, or generation. The full freshness check is an explicit maintenance operation, not an ordinary build prerequisite.

The generated exports describe individual metadata values, not a fixed _meta interface or runtime validators. Open additionalProperties shapes retain unknown index signatures, including nested open objects. Literal unions describe the current known enum values; readers must separately tolerate unknown raw values and fields without rejecting or discarding the enclosing metadata. Optional accessors and absence-versus-empty behavior belong to the readers, not these generated declarations.

The only retained upstream inputs are the conformance test fixtures. The node tests locate them relative to the compiled test module, and normal source-resource copying places them beside the compiled tests. The handwritten runner dispatches their selected client operations and compares results with upstream expectations; it does not generate test-source files. Authentication, root-state, handshake, and encryption fixtures are excluded.

To update the pin, change sourceCommit, update the contract list if needed, replace the retained vectors with their byte-for-byte originals from the same commit, then regenerate and run the freshness check and conformance tests. Review the reader and feature tests for any changed semantics.

The upstream schema descriptions and test vectors are Copyright GitHub, Inc., distributed under the MIT permission and warranty notice in the repository's License.txt. The generated declarations retain this attribution; there is no separately vendored license file.