Use harness model catalogues in agent files by aeschli · Pull Request #343060 · microsoft/vscode · GitHub
Skip to content

Use harness model catalogues in agent files - #343060

Draft
Martin Aeschlimann (aeschli) wants to merge 7 commits into
mainfrom
aeschli/agent-file-copilot-models
Draft

Martin Aeschlimann (aeschli) wants to merge 7 commits into
mainfrom
aeschli/agent-file-copilot-models

Conversation

@aeschli

Copy link
Copy Markdown
Contributor

Summary

Adds provider-backed Copilot model editing for *.agent.md files on top of #343021.

  • Resolves model catalogues from ILanguageModelsService using harness descriptors and targetChatSessionType.
  • Uses only the active matching harness during normal editing.
  • Combines all available Copilot-target harnesses for an explicit target: github-copilot override when the active harness differs.
  • Completes canonical runtime model IDs, including exact provider-qualified BYOK IDs.
  • Completes model-specific reasoning-effort values from the selected model's configuration schema.
  • Adds live model and reasoning-effort hovers.
  • Marks unavailable models and unsupported reasoning efforts unused only after every selected harness catalogue has resolved.
  • Avoids false diagnostics while model discovery is pending.
  • Mirrors Copilot runtime model resolution for authored values:
    • canonical IDs;
    • non-BYOK display-name aliases;
    • (copilot) and (auto) aliases;
    • embedded model options;
    • exact-ID-only BYOK resolution.
  • Deliberately does not accept VS Code's Name (agent-host-copilotcli) qualification, which the runtime rejects.

This draft PR is stacked on #343021 and addresses the model portion of #342881 / #342854.

Testing

  • npm run build-fast -- --client-only — passed
  • npm run typecheck-client — passed
  • Targeted ESLint for the model resolver, language providers, and tests — passed
  • .\scripts\test.bat --run src/vs/workbench/contrib/chat/test/browser/promptSyntax/languageProviders/promptHeaderAutocompletion.test.ts --run src/vs/workbench/contrib/chat/test/browser/promptSyntax/languageProviders/promptHovers.test.ts --run src/vs/workbench/contrib/chat/test/browser/promptSyntax/languageProviders/promptValidator.test.ts — passed, 292 tests

@aeschli
Martin Aeschlimann (aeschli) added this pull request to stack #342888 October 20, 2026 22:19
Complete, highlight, hover, and validate Copilot body placeholders while suppressing unsupported Local file and tool reference syntax.

Refs #342854

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep placeholder suggestions visible through Monaco filtering and replace existing identifier and closing-brace suffixes without duplication.

Refs #342854

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Complete, hover, and validate Copilot agent models and model-specific reasoning effort using resolved harness model catalogues.

Refs #342854
Refs #342881

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aeschli
Martin Aeschlimann (aeschli) force-pushed the aeschli/agent-file-copilot-models branch from 33a169f to cd0f5da Compare October 20, 2026 22:24
Copilot AI balanced review requested due to automatic review settings October 20, 2026 22:24

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.

🟡 Changes recommended

Catalogue readiness, identifier handling, and cross-harness capability merging can produce incorrect editing feedback.

4 open issues
What changed in this PR

Adds harness-backed model editing for Copilot agent files, extending the existing harness-aware language features.

Changes:

  • Resolves model catalogues and runtime identifiers for matching harnesses.
  • Adds model-specific completions, hovers, and diagnostics.
  • Tests catalogue selection, aliases, pending discovery, and reasoning effort.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​promptSyntax/​languageProviders/​promptValidator.test.ts Tests model and reasoning-effort validation.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​promptSyntax/​languageProviders/​promptHovers.test.ts Tests catalogue-backed hovers.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​promptSyntax/​languageProviders/​promptHeaderAutocompletion.test.ts Tests harness-specific completions.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​languageProviders/​promptValidator.ts Adds catalogue-based value diagnostics.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​languageProviders/​promptModelResolver.ts Introduces shared catalogue and identifier resolution.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​languageProviders/​promptHovers.ts Adds model and reasoning-effort details.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​languageProviders/​promptHeaderAutocompletion.ts Completes runtime IDs and reasoning efforts.

Review effort: Balanced

Preserve per-harness capabilities, use provider-owned readiness, recognize agent-host BYOK copies, and retain mixed-case canonical model IDs.

Refs #342881

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Base automatically changed from aeschli/agent-file-copilot-body to main October 21, 2026 08:32
Refresh BYOK model rows only when their enablement changes or the bridge reports new models, preventing readiness metadata updates from republishing unchanged catalogues.

Refs #342881

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Select the first available model from custom agent model arrays before handing configuration to the Copilot SDK, which currently accepts only a scalar model. Preserve fail-open behavior when no catalogue is available.

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

This branch has not been deployed

No deployments
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