Skip to content

feat(copilot): add --no-model-invocation integration option - #5118

Merged
mnriem merged 5 commits into
github:mainfrom
echarrod:feat/2654-copilot-no-model-invocation
Nov 2, 2026
Merged

mnriem merged 5 commits into
github:mainfrom
echarrod:feat/2654-copilot-no-model-invocation

Conversation

@echarrod

@echarrod echarrod commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Refs #2654. Follow-up to #4919 (Claude) and #5116 (Droid).

Adds a Copilot-only integration option:

specify init my-project --integration copilot --integration-options="--no-model-invocation"
  • In the default skills layout it writes disable-model-invocation: true on the core speckit-* command skills, including preset overrides of them. VS Code's agent skills docs say this requires manual invocation through the / slash command only. The default is unchanged (the key is omitted, which VS Code treats as false).
  • Extension skills stay model-invocable, because mandatory hooks such as git's speckit.git.feature need the model to invoke them.
  • The option persists through integration.json, so specify integration upgrade copilot reapplies it.

Differences from Droid:

  • Copilot has two layouts. Under --commands the files are .agent.md and .prompt.md, not skills, so the option is ignored and no flag is written.
  • Only the VS Code docs list the field; GitHub's Copilot CLI skills docs do not. In a manual check with Copilot CLI 1.0.70 the model called its skill tool for speckit-specify without the flag and did not with it, and an explicit /speckit-specify still ran. With the flag the model could still read the skill's SKILL.md as a plain file, so it is not a hard block. Neither source says whether a flagged skill keeps its description out of the model's context, so the context-budget benefit from Allow opting out of model invocation for installed skills (large monorepo skill-budget pain) #2654 is unverified.
  • Copilot is not multi_install_safe; the existing multi-install note is unchanged.
  • The frontmatter injection preserves CRLF line endings, as Claude's does.
  • Copilot already has other options, so the docs add a section rather than editing a "no options" line.

Only the Copilot package, its tests and docs/integrations/copilot.md change; no shared base.py change.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (fill in the disclosure below)

AI disclosure: Written for @echarrod by Claude Code (claude-sonnet-5-5) running autonomously. It wrote the code, tests and docs, ran the test suite and an automated /code-review medium. @echarrod reviewed it before marking it ready.

`specify init --integration copilot --integration-options="--no-model-invocation"`
writes `disable-model-invocation: true` on the core command skills in the
skills layout (github#2654). VS Code documents the field as requiring manual `/`
invocation; Copilot CLI docs do not list it. The default is unchanged, the
option persists through integration.json so `integration upgrade` reapplies
it, extension skills stay model-invocable, and `--commands` ignores it.

Confined to the Copilot integration, its tests and docs.

Assisted-by: Claude Code (claude-sonnet-5-5)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XhaPZg7kBwheHtH9wf2AZv
@echarrod
echarrod requested a review from mnriem as a code owner October 25, 2026 18:41
Assisted-by: Claude Code (claude-sonnet-5-5)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XhaPZg7kBwheHtH9wf2AZv
@mnriem mnriem added the triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review label Oct 25, 2026
@mnriem
mnriem requested a max review from Copilot October 27, 2026 17:41

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.

🔵 Needs a closer look

Headless Copilot CLI behavior remains unverified, and setup failure-state cleanup still needs correction.

1 open issue
What changed in this PR

Adds a Copilot-only option to make core Spec Kit command skills manually invocable, extending the existing Claude and Droid support without changing shared integration code.

Changes:

  • Adds --no-model-invocation for core skills while preserving extension invocation and commands layouts.
  • Persists the option across upgrades and adds coverage for defaults, lifecycle behavior, and extension hooks.
  • Documents platform behavior and preset-related limitations.

AI-generated review for the requester by GitHub Copilot (model: unknown; autonomous mode).

File Description
tests/​integrations/​test_integration_copilot.py Tests option handling, generated skills, upgrades, and failure paths.
src/​specify_cli/​integrations/​copilot/​__init__.py Declares the option and injects core-skill frontmatter based on setup state.
docs/​integrations/​copilot.md Explains usage, supported layouts, and lifecycle caveats.

Review effort: Max

@mnriem

mnriem commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

@mnriem mnriem added the author-awaiting Waiting on author response label Oct 27, 2026
Move emit_events() inside the protected block in setup() so a failure
while installing native hooks no longer leaves _disable_model_invocation
set for later core-skill rendering in the same process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015w5WirGUspLsYEpCkaHWxV
@echarrod

echarrod commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

@mnriem Addressed the Copilot feedback in 7382585: setup() now resets the --no-model-invocation state if native-hook emission fails as well as if skill installation fails, and test_failed_setup_does_not_leave_option_set covers both cases. Tests: Copilot integration tests 79 passed; full suite 12817 passed, 434 skipped, 0 failed.

Headless Copilot CLI dispatch (copilot -p "/speckit-<cmd> ...") with the flag set has still not been checked; the docs only record a manual interactive check with Copilot CLI 1.0.70.

Disclosure: posted on behalf of @echarrod by Claude Code (model: claude-opus-5-5, autonomous mode). The agent made the change, ran the tests and wrote this comment. Commit 7382585 is agent-authored but is missing its Assisted-by: trailer; this comment serves as its disclosure.

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

The documentation omits that the option is ignored for inherited commands layouts without an explicit --commands flag, potentially misleading users into thinking a successful upgrade applied the setting.

1 open issue
1 resolved since last review

Review effort: Max

Comment thread docs/integrations/copilot.md Resolved
@mnriem

mnriem commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

Clarify the effect of the option in commands layout.

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

Copy link
Copy Markdown
Contributor Author

@mnriem The latest Copilot item is addressed in 8b97d96. docs/integrations/copilot.md now says that --no-model-invocation has no effect in the commands layout, whether the layout was picked with --commands or kept from an existing installation when no layout flag is passed. This matches CopilotIntegration.setup(), which only applies the flag when _skills_mode is true. The change is to documentation only, and behaviour is the same as before. No other review threads are open.

Disclosure: posted for @echarrod by Claude Code (model: claude-opus-5-5, autonomous mode). Ed made the docs change himself. The agent checked the wording against the code and wrote this summary.

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.

🔵 Needs a closer look

Human judgment is needed to assess the documented migration’s potential to drop a stored --no-model-invocation option and make skills model-invocable.

No open issues 🎉

1 resolved since last review

Review effort: Max

The documented commands-to-skills migration passes --integration-options,
which replaces all stored options. A stored --no-model-invocation is
dropped without warning and the skills become model-invocable, so say so
where the migration command is documented.

Assisted-by: Claude Code (model: claude-opus-5-5, autonomous)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015w5WiqwEFQkgenh2YdQLV8
@echarrod

echarrod commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the latest review summary in a86445f: the commands-to-skills migration in docs/integrations/copilot.md now warns that --integration-options="--skills" replaces all stored options, so --no-model-invocation has to be included to keep it. This is docs only; upgrade behaviour is unchanged.

I reproduced the drop on 8b97d96 with --skills: the stored options became --skills and speckit-specify had no flag. With --skills --no-model-invocation, the option stayed stored and the flag was written. tests/integrations/test_integration_copilot.py passes (79 passed), and markdownlint is clean on the file.

Posted on behalf of @echarrod by Claude Code (model: claude-opus-5-5, autonomous mode), which diagnosed the issue, wrote the change and ran these checks.

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.

🟢 Approval recommended

No active review issues are reported for the Copilot-only --no-model-invocation change.

No open issues 🎉

Review effort: Balanced (auto)

@mnriem
mnriem merged commit 39cf3a7 into github:main Nov 2, 2026
16 checks passed
@mnriem

mnriem commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author-awaiting Waiting on author response triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants