Skip to content

Add local-coding plugin: on-device offload to MAI Code 1.1 Flash for Copilot CLI 🤖 - #6388

Merged
aaronpowell merged 1 commit into
github:mainfrom
chrisdMSFT:local-coding-plugin-0.3.2
Nov 13, 2026
Merged

aaronpowell merged 1 commit into
github:mainfrom
chrisdMSFT:local-coding-plugin-0.3.2

Conversation

@chrisdMSFT

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services.
  • My contribution adds a new instruction, prompt, agent, skill, workflow, or canvas extension file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, skill, workflow, or canvas extension with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.
  • I am targeting the main branch for this pull request.

Description

Adds local-coding 0.3.2, an experimental plugin for GitHub Copilot CLI on Windows that lets a
cloud main session hand large, mechanical sub-tasks (big reads, log and test triage, and the same
edit across many files) to MAI Code 1.1 Flash installed locally from /model. Those tokens stay
out of the main context and do not use GitHub AI Credits.

  • On-Device Offload agent (local-coding:on-device-offload): owns a whole read-heavy or
    mechanical task on the local model and replies DONE or UNABLE. Before the main session
    accepts DONE, it checks each reported fact against the source with one targeted search or a
    small view (the DONE double-check). On anything else it undoes the worker's files and does the
    task itself.
  • on-device-delegate skill: briefs one bounded sub-task (GOAL, INPUTS, RULES, OUTPUT, and
    ANSWER) to the On-Device Worker agent and checks the result once.
  • On-Device Worker agent (local-coding:on-device-worker): the skill's bounded worker.
  • Two setup scripts bundled in the skill's scripts/ folder: Set-LocalOutputCap.ps1 caps the
    local model's output tokens in the user's providers.json (with a backup and -Restore), and
    Update-LocalCodingPlugin.ps1 installs or updates the plugin from this marketplace and then runs
    the cap.

Uplift over a plain local-model custom agent (as in the docs' "Delegating focused tasks to a
specific model"): a size gate for when to offload (and what never to offload), a worker prompt
tuned for a small local model (tool-call budget, scripts instead of reading whole files, every
count or extraction computed two independent ways, in-place edits with a diff check, and an
explicit loop stop), a cheap check of every DONE before the main session accepts it, and a brief
format that keeps the big input out of the main context. Both agents use strict-tools-list
without the task tool. The main session passes the model on the task call (a frontmatter model pin
is rejected on Copilot CLI 1.0.105). Copilot Fusion (Fusion Standard) is the automatic
alternative. This plugin is the explicit, per-task one.

How it was tested: dogfooded on one Windows test PC (RTX, 66 GB) with Copilot CLI 1.0.108 and MAI
Code 1.1 Flash (CLI-managed, 8,192 output cap), on a 12-task offload set (log triage,
long-document extraction, and multi-file edits), 3 runs per task: 33/36 under Claude Sonnet 5.5
and 35/36 under GPT-6.1 Sol as the main model (pure cloud 36/36 each), about 10x to 11x slower
than pure cloud, and with no measurable cost saving (Sonnet 29.4% dearer per success, Sol 4.4%
cheaper with an interval that spans zero). The README reports the cost per success and frames
these as dogfooding numbers. The plugin installs cleanly
on Copilot CLI 1.0.105 from the materialized layout (copilot plugin install, temp
COPILOT_HOME): copilot plugin list shows local-coding (v0.3.2), copilot skill list shows
on-device-delegate, and both agents load as local-coding:on-device-offload and
local-coding:on-device-worker. Update-LocalCodingPlugin.ps1 and Set-LocalOutputCap.ps1 ran
end to end against a temp Copilot home. npm run skill:validate, npm run plugin:validate,
npm run build, and vally lint on the skill pass.


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • New agentic workflow.
  • New canvas extension.
  • Update to existing instruction, prompt, agent, plugin, skill, workflow, or canvas extension.
  • Other (please specify):

Additional Notes

Experimental and Windows-only, like the local model itself (public preview, --experimental).
The README lists the public prerequisites and the limits: the output cap is opt-in, the first
offload waits for the model to load, and the local model can return a confident but wrong DONE
that the double-check does not always catch, so results should be reviewed.

This listing ships no hooks. This repository materializes a plugin's hooks to
com.github.copilot/hooks/<name>/hooks.json, and Copilot CLI 1.0.105 reads a spec plugin's hooks
only from com.github.copilot/hooks/hooks.json, so they would not run. The agent text covers the
no-hooks case (the user types a one-line routing hint, and the main session undoes a failed
offload's files with git status).


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Offload agent v12 with the DONE double-check, the on-device-delegate skill and its worker agent, plus Set-LocalOutputCap.ps1 and Update-LocalCodingPlugin.ps1 bundled under the skill's scripts folder.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@chrisdMSFT
chrisdMSFT requested review from a team as code owners November 12, 2026 19:57
Copilot AI dynamic review requested due to automatic review settings November 12, 2026 19:57
@github-actions github-actions Bot added agent PR touches agents new-submission PR adds at least one new contribution plugin PR touches plugins skills PR touches skills awaiting-automation merge-risk:high labels Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🚦 Submission status: 👀 Ready for review

Risk tier: merge-risk:high — Privileged execution, automation, or review-policy change
Required to merge: passing submission-gate checks plus 1 approval from reviewers with write access, including a maintainer with admin or maintain permission.

Why this tier
  • skills/on-device-delegate/scripts/Set-LocalOutputCap.ps1 is a high-risk path (automation, scripts, MCP config, hooks, or review policy)
  • skills/on-device-delegate/scripts/Update-LocalCodingPlugin.ps1 is a high-risk path (automation, scripts, MCP config, hooks, or review policy)

Automated checks

Check Status Details
Line endings ✅ Passed Passed · logs
Spelling ✅ Passed Passed · logs
Generated README consistency ✅ Passed Passed · logs
Plugin and extension validation ✅ Passed Passed · logs
Plugin structure ✅ Passed Passed · logs
Skill validation ✅ Passed Passed · logs
Skill lint (vally) ✅ Passed Passed · logs
Risk scan ✅ Passed Passed · logs
Contributor reputation ✅ Passed Passed · logs
Duplicate resource scan ✅ Passed Passed · logs
PR quality signal ⏭️ Skipped Skipped by its workflow · logs
Canvas/plugin smoke test ✅ Passed Passed · logs

Review

  • Approvals: 0/1
  • Assigned reviewer: not assigned yet — comment /request-review to ask for one
  • Review target date: not set
  • Still needed: 1 more approval(s); an approval from a maintainer with admin or maintain permission
  • The core-maintainers pool is not staffed yet; an approver with admin or maintain permission is required instead.

Commands

Command Who What it does
/rerun-checks PR author, maintainers Re-runs failed or incomplete checks and re-evaluates this gate
/request-review PR author, maintainers Asks the review rotation to assign a reviewer (adds needs-reviewer)

Updated for aa6878b · gate run · This comment is maintained automatically — see submission gate docs.

@github-actions

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 8 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 0
ℹ️ Info 2
Severity Rule File Line Match
ℹ️ skill-script-touched skills/on-device-delegate/scripts/Set-LocalOutputCap.ps1 1 skills/on-device-delegate/scripts/Set-LocalOutputCap.ps1
ℹ️ skill-script-touched skills/on-device-delegate/scripts/Update-LocalCodingPlugin.ps1 1 skills/on-device-delegate/scripts/Update-LocalCodingPlugin.ps1

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Vally Lint Results

⚠️ Warnings or advisories found

Scope Checked
Skills 1
Agents 2
Total 3
Severity Count
❌ Errors 0
⚠️ Warnings 0
ℹ️ Advisories 1

Summary

Level Finding
ℹ️ Vally currently lints SKILL.md content. Agent files were detected but skipped:
Full linter output
### Linting skills/on-device-delegate
✅ on-device-delegate (2/2 checks passed)
    ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
        ✓ spec-compliance: All spec checks passed.
    ✓ [valid-refs] All file references across 1 skill(s) are valid.
        ✓ valid-refs: All file references resolve to existing files within the skill directory.

1 skill(s) linted, 1 passed

### Agent files detected (not linted by vally)
ℹ️ Vally currently lints SKILL.md content. Agent files were detected but skipped:
agents/on-device-offload.agent.md
agents/on-device-worker.agent.md

@chrisdMSFT chrisdMSFT changed the title Add local-coding plugin: on-device offload to MAI Code 1.1 Flash for Copilot CLI 🤖🤖🤖 Add local-coding plugin: on-device offload to MAI Code 1.1 Flash for Copilot CLI 🤖 Nov 12, 2026
@github-actions github-actions Bot added ready-for-review Submission passed intake validation and is ready for maintainer review and removed awaiting-automation labels Nov 12, 2026

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

Unresolved critical flaws can discard user edits, execute scripts from unrelated plugins, and expose provider configuration through unsafe file handling.

8 open issues
What changed in this PR

Adds the experimental local-coding plugin for Windows Copilot CLI, enabling a cloud session to delegate large reads and mechanical edits to the on-device MAI Code 1.1 Flash model.

Changes:

  • Adds two agents and a delegation skill with task limits, result checks, and fallback instructions.
  • Bundles PowerShell scripts for plugin setup and reversible output-token capping.
  • Documents prerequisites, usage, limitations, and dogfooding results, and registers the resources in the catalogs.
File Description
skills/​on-device-delegate/​SKILL.md Defines bounded delegation and result checking.
skills/​on-device-delegate/​scripts/​Update-LocalCodingPlugin.ps1 Installs or updates the plugin and applies the output cap.
skills/​on-device-delegate/​scripts/​Set-LocalOutputCap.ps1 Changes and restores local-model output limits.
plugins/​local-coding/​README.md Documents setup, usage, results, and limitations.
plugins/​local-coding/​plugin.json Declares plugin metadata and resource composition.
docs/​README.skills.md Lists the delegation skill and bundled scripts.
docs/​README.plugins.md Adds the plugin to the catalog.
docs/​README.agents.md Lists both on-device agents.
agents/​on-device-worker.agent.md Defines the bounded worker’s instructions.
agents/​on-device-offload.agent.md Defines whole-task offloading and recovery instructions.
.github/​plugin/​marketplace.json Registers plugin version 0.3.2 for discovery.

Review effort: Balanced (auto)

@@ -0,0 +1,58 @@
---
name: On-Device Offload
description: 'Experimental. Worker on the local MAI Code 1.1 Flash model. Its tokens do not use GitHub AI Credits. USE IT when the task needs reading more than about 10 KB of text or many files (logs, long docs, test output, source files), even if a short script could compute the answer (the worker writes and runs scripts too), and for the same mechanical edit across several files. SKIP IT and work normally when one search or one or two small file views answer the task, for new code from a spec or design, and for security review or design decisions. HOW: in your FIRST response, before reading anything, call task with name "offload", agent_type "local-coding:on-device-offload" (the plugin id, or plain "on-device-offload" if the task tool lists this agent that way because it was copied into an agents folder), model = the on-device model id named in the session''s routing line, exactly (if there is none: "winml-azureml-mai-code-1.1-flash-on-device/MAI-Code-1.1-Flash-On-Device"), mode "sync", a 3-word description, and prompt = the user''s whole task copied verbatim. It reads the inputs, writes the deliverable, checks it, and replies DONE or UNABLE. Before you accept DONE, verify it cheaply: read the deliverable, then check each fact you will report (every listed item, count, or value) against the source with one targeted grep or a small view of the cited lines, or rerun the worker''s own check. Never re-read the whole input or redo the task. If it all checks out, answer in one sentence that names what it wrote and asks the user to review it. If any fact is wrong or missing, treat the reply as UNABLE. Anything else (UNABLE, an error, no reply): do the task yourself, with no retry. Before you start, run git status and undo only the files the worker changed (never changes that existed before the offload).'
Comment on lines +77 to +78
$tmp = "$ProvidersJson.tmp"
[IO.File]::WriteAllText($tmp, ($doc | ConvertTo-Json -Depth 32), (New-Object System.Text.UTF8Encoding($false)))
Comment on lines +77 to +80
$tmp = "$ProvidersJson.tmp"
[IO.File]::WriteAllText($tmp, ($doc | ConvertTo-Json -Depth 32), (New-Object System.Text.UTF8Encoding($false)))
$null = [IO.File]::ReadAllText($tmp) | ConvertFrom-Json
Move-Item -LiteralPath $tmp -Destination $ProvidersJson -Force
Comment on lines +253 to +255
$cap = Get-ChildItem -LiteralPath $root -Recurse -Filter 'Set-LocalOutputCap.ps1' -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -match "[\\/]$([regex]::Escape($PluginName))[\\/]skills[\\/]" } |
Sort-Object LastWriteTime -Descending | Select-Object -First 1
Comment on lines +16 to +18
- For counting or extracting across many lines or files, write a short
script with the create tool and run it. The shell is PowerShell: no
heredocs and no multi-line `python -c`.
$ErrorActionPreference = 'Stop'
if (-not $ProvidersJson) {
$homeDir = if ($env:COPILOT_HOME) { $env:COPILOT_HOME } else { Join-Path $HOME '.copilot' }
$ProvidersJson = Join-Path $homeDir 'providers.json'
Comment on lines +201 to +212
} else {
$installedFrom = 'Marketplace'
}
}
if (-not $installedFrom -and $Source -ne 'Marketplace' -and $PluginPath) {
if ($PSCmdlet.ShouldProcess($PluginPath, "install $PluginName from the local folder")) {
$r = Invoke-Copilot @('plugin', 'install', $PluginPath)
$r.Output | Where-Object { $_ -and $_ -notmatch 'deprecated' } | ForEach-Object { Write-Note $_ }
if ($r.Code -eq 0) { $installedFrom = 'Local' }
} else {
$installedFrom = 'Local'
}
Write-Note "Using $capPath"
$capArgs = @{ ProvidersJson = $providers; Model = $Model; MaxOutputTokens = $MaxOutputTokens }
if ($Restore) { $capArgs.Restore = $true }
try { & $capPath @capArgs -WhatIf:$WhatIfPreference } catch { Write-Note "Set-LocalOutputCap.ps1: $($_.Exception.Message)" }
@aaronpowell
aaronpowell merged commit acbd759 into github:main Nov 13, 2026
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent PR touches agents merge-risk:high new-submission PR adds at least one new contribution plugin PR touches plugins ready-for-review Submission passed intake validation and is ready for maintainer review skills PR touches skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants