Skip to content

Comments

Fix: Honor deprecated infer: false in custom agent visibility#297003

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-custom-agent-invocation
Draft

Fix: Honor deprecated infer: false in custom agent visibility#297003
Copilot wants to merge 2 commits intomainfrom
copilot/fix-custom-agent-invocation

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Custom agents with infer: false in their frontmatter were still being invocable by the model. The deprecated infer attribute (superseded by user-invocable/disable-model-invocation) was not correctly taken into account when computing agentInvocable.

Root Cause

// Before — infer:false with no disableModelInvocation set → false || true → true (bug)
agentInvocable: ast.header.infer === true || ast.header.disableModelInvocation !== true,

// After — check infer first; fall back to disableModelInvocation only when infer is absent
agentInvocable: ast.header.infer !== undefined ? ast.header.infer === true : ast.header.disableModelInvocation !== true,

Changes

  • promptsServiceImpl.ts: Fix agentInvocable calculation to give infer precedence over disableModelInvocation when explicitly set.
  • promptsService.test.ts: Add getCustomAgents test covering infer: falseagentInvocable: false, infer: trueagentInvocable: true, and missing infer → defaults to true.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --enable-crash-reporter=c9f7a3bd-4b22-4038-b438-f01468dc4c67,no_channel --user-data-dir=/tmp/vscode-tests-1771860075298 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8710832619931435156,5229929586332296513,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /home/REDACTED/work/vscode/vscode/.build/electron/code-oss /home/REDACTED/work/vscode/vscode/.build/electron/code-oss --no-sandbox /home/REDACTED/work/vscode/vscode/test/unit/electron/index.js --run src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts --grep infer: false (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --enable-crash-reporter=25a6f598-a8b1-44e8-b554-b108c7c3b754,no_channel --user-data-dir=/tmp/vscode-tests-1771860267998 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,10874546582333780572,11522497578564019318,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 --project bin/sh ces false ode-gyp-bin/sh node (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Custom agent with infer: false is still invoked as the deprecated setting isn't honored</issue_title>
<issue_description>1. Have a custom agent with infer: false
2. Ask agent to invoke it
3. 🐛 Agent will invoke the custom agent

Since infer shipped during GH Universe, I'd expect that it still works even when deprecated.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: aeschli <6461412+aeschli@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix custom agent invocation with infer setting Fix: Honor deprecated infer: false in custom agent visibility Feb 23, 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.

Custom agent with infer: false is still invoked as the deprecated setting isn't honored

2 participants