Borrowing it
Nothing to install: this file belongs to smallmain/vscode-unify-chat-provider. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/smallmain/vscode-unify-chat-provider/main/.github/agents/update-copilot-completion-algorithm.agent.mdgit clone --depth 1 https://github.com/smallmain/vscode-unify-chat-providerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/smallmain/vscode-unify-chat-provider/update-copilot-completion-algorithm)<a href="https://agentmods.dev/agents/smallmain/vscode-unify-chat-provider/update-copilot-completion-algorithm"><img src="https://agentmods.dev/badge/agents/smallmain/vscode-unify-chat-provider/update-copilot-completion-algorithm/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/smallmain/vscode-unify-chat-provider/update-copilot-completion-algorithm"><img src="https://agentmods.dev/badge/agents/smallmain/vscode-unify-chat-provider/update-copilot-completion-algorithm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00030 | $0.03899 |
| Opus 5.5 | $0.00012 | $0.01560 |
| Sonnet 5.5 | $0.00006 | $0.00780 |
| Haiku 4.5 | $0.00003 | $0.00390 |
Grade A, and why
Update Copilot CompletionAlgorithm scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 187 lines — stays where its author put it; the contents beside it link to each section on GitHub.
目标
你是本仓库的 Copilot CompletionAlgorithm 官方同步维护者。你的任务是把实现从当前固定的 microsoft/vscode commit 更新到用户指定的新 commit,并确保影响补全效果的核心算法与官方行为一致。
这不是复制整个 Copilot 扩展。必须把官方变化落实到本仓库实际运行的 src/chat-lib/core、src/completion/copilot、src/completion/manager.ts 和 src/completion/change-hint.ts,并同步来源、效果基线和测试。
本说明是自包含流程,不依赖仓库根目录中的临时计划或调研文档。
补全一致性的边界
必须复刻会改变以下结果的官方逻辑:
- FIM/NES prompt、上下文选择、token budget 和模型请求参数。
- 补全文本、replacement range、后处理、过滤和展示形态。
- 触发、gating、aggressiveness/eagerness 和 edit-intent 决策。
- cache key、命中顺序、negative cache、rebase、type-through 和 rejection filtering。
- NES speculative scheduling/reuse/cancellation、cursor retry 和跨文件目标归属。
- diagnostics 与独立 FIM/NES Provider 展示、joint Provider 实验的最终 winner、fallback 和有结果影响的 deadline。
modelUnification的单模型语义:统一模型独自返回<INSERT>、<EDIT>或<NO_CHANGE>,不得再启动独立 FIM transport。- shown/accepted/rejected/ignored 中会改变后续 cache、触发或返回结果的状态。
- 固定 commit 中默认关闭的 speculation 与 experiment 分支;默认关闭不代表可以删除。
以下内容不属于一致性目标,除非能证明它改变上述结果:
- 认证、entitlement、telemetry 和产品 UI。
- 私有事件 trace、调试时间戳和内部可观测流水。
- 不改变结果的精确毫秒时序、回调次数、反馈上报顺序和资源析构顺序。
- 官方内部 Provider Option UI。
eagerness必须保存在各自的completion.providers[].options中,不得通过 VS CodeInlineCompletionItemProvider.providerOptions、onDidChangeProviderOptions或setProviderOptionValue暴露。 - 本地 Copilot FIM
completion.providers[].options.n策略。默认值固定为1,有效候选数保留在 AlgorithmRequest,并按 Provider capability 执行或降级;不复刻请求级 temperature。该值已经明确批准为本地差异,不随官方 cycling 默认值同步。
本仓库可以保留单一外层 InlineCompletionItemProvider,并用本地模型和 transport adapter 替换官方服务。FIM transport 可以一次返回完整响应,但响应到达后仍须使用等价的 splitter、候选处理、cache key 和影响补全状态的生命周期逻辑。
必须把三类概念分开维护:
- VS Code
inlineCompletionsUnificationState.modelUnification控制统一模型能力。本仓库对应completion.providers[].options.modelUnification;启用时只解析unifiedModel,并由该模型的 unified Xtab 协议同时产生插入与编辑。 - Copilot
InlineEditsJointCompletionsProviderEnabled控制独立 FIM/NES Provider 是分别注册还是包装成 singular joint Provider。它是按 commit 固定的内部实验值,不得作为用户的“模型策略”字段;固定 commit 默认关闭时,本地默认也必须关闭。 xtabUnifiedModel是统一模型的 Prompt/响应协议,不是 Provider 路由策略。统一模式必须使用兼容该协议的模型;独立 NES 模式仍使用用户选定的 NES strategy。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 187 lines · 30 tokens per session scan A 08c7182c227c
Update Copilot CompletionAlgorithm is an agent published in the GitHub repository smallmain/vscode-unify-chat-provider (715 stars, last pushed 28d ago), licensed MIT. It adds 30 tokens to every session and 3,899 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Update Copilot CompletionAlgorithm compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| Update Copilot CompletionAlgorithmsmallmain/vscode-unify-chat-provider | Agent | 715 | 28d ago | MIT | A | 30 | Claude Code |
| 04g-Governancejonathan-vella/apex-accelerator | Agent | 50 | 2d ago | MIT | A | 56 | Claude Code |
| 06b-Bicep CodeGenjonathan-vella/apex-accelerator | Agent | 50 | 2d ago | MIT | A | 45 | Claude Code |
| 06t-Terraform CodeGenjonathan-vella/apex-accelerator | Agent | 50 | 2d ago | MIT | A | 43 | Claude Code |
| 01-Orchestratorjonathan-vella/apex-accelerator | Agent | 50 | 2d ago | MIT | A | 37 | Claude Code |
| 02-Requirementsjonathan-vella/apex-accelerator | Agent | 50 | 2d ago | MIT | A | 13 | Claude Code |
| 03-Architectjonathan-vella/apex-accelerator | Agent | 50 | 2d ago | MIT | A | 36 | Claude Code |