Repository navigation
Conversation
498953584
added a commit
to 498953584/M365-Copilot2API
that referenced
this pull request
Oct 16, 2026
Owner
|
感谢提交。先澄清验证范围:本 PR 增加的是公开模型 ID 到 M365 上游 tone 的映射与动态发现,映射名本身不能证明底层模型身份。PR 中返回“OK”的实测说明请求成功,但尚不能排除上游忽略未知 tone 或回退到默认模型。请补充脱敏的认证模型列表、对应显示名、实际请求 tone/scenario,以及未知 tone 对照测试;“每个账号都可用”和 Claude 具体版本也需要分别提供依据。 此外,当前变更包含工具解析、会话恢复、router 预检移除和流式处理,已经超出模型目录更新。建议拆分模型发现/映射与工具链路改动,分别验证。当前没有 GitHub CI 检查结果,作者报告的本地检查尚未由维护方独立复核;Codex、Claude Code、opencode 的多轮本地工具执行与正文输出也需要回归后再决定合并。 |
…io routing
Register the new tones Microsoft deployed on M365 Copilot (GPT-6 Sol,
GPT-6.1 Sol, GPT-6 Astra, GPT-6 Reasoning, GPT-5.6, Claude Sonnet 5,
Claude Opus, Claude Fable, Grok 4.5, Grok Reasoning) with automatic
discovery and adaptive scenario routing.
Summary of changes:
1. codex_catalog.go / server.go:
- Add new public model IDs mapping directly to upstream tones:
gpt-6-sol -> Gpt_6_Sol_Reasoning, gpt-6.1-sol -> Gpt_61_Sol_Reasoning,
gpt-6-astra -> Gpt_6_Astra, gpt-6-reasoning -> Gpt_6_Reasoning,
gpt-5.6 -> Gpt_5_6_Chat, gpt-5.6-reasoning -> Gpt_5_6_Reasoning,
claude-sonnet-5 -> Claude_Sonnet_5, claude-opus -> Claude_Opus,
claude-fable -> Claude_Fable, grok-4.5 -> Grok_4_5, grok-reasoning -> Grok_Reasoning.
- Remove speculative sub-version aliases (sonnet-4.6, opus-4.8) so
model IDs strictly reflect upstream tone naming.
- effectiveScenarioAndLicense: automatically upgrade scenario to
OfficeWebPaidCopilot with Premium license when the requested model
or tone is gated on the paid seat (Gpt_6_Reasoning, Claude_Sonnet_5),
while ungated tones (gpt-6-sol, gpt-6.1-sol, gpt-6-astra, claude-opus)
stay on the default Included scenario.
2. m365cloud.go:
- DiscoverTones: query authenticated RefreshNavPane store metadata
(availableModelSelectionOptions) and /chat bundles to automatically
discover newly deployed upstream tones.
- toneToPublicModelSpec / dynamicToneForModel: dynamically convert
new upstream tones into public model specs and route them.
3. settings.go / Accounts.tsx / Settings.tsx:
- Allow OfficeWebPaidCopilot in the scenario configuration enum.
- Tolerate pasted PKCE nativeclient callback URLs without https:// scheme.
- Expose discovered upstream tones in the console mapping dropdown.
Refs HEXUXIU#104
Glaroday
force-pushed
the
feat/new-m365-tones
branch
from
October 16, 2026 13:48
217e3c6 to
833d426
Compare
Author
|
@HEXUXIU 收到,感谢指导。 你说得对,之前把工具链改动混进来确实太杂了。我已经把所有工具解析、会话切片和流式重构的代码全部拆出去了,后续工具链单独开 PR。当前 PR 压缩成了 1 个提交,只动了 12 个与模型映射和动态发现相关的文件,保持干净。 针对你提到的几个具体问题,我在本地用真实账号抓包测了一下,结果如下:
本地 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #104.
Registers the tones Microsoft shipped on M365 Copilot since late September 2026 so they can be selected from the console and called through
/v1/*, and adds automatic discovery + public model ID conversion so future upstream tones work without waiting for a hardcoded catalog update.Models added
gpt-6.1-solGpt_61_Sol_Reasoninggpt-6-solGpt_6_Sol_Reasoninggpt-6-reasoningGpt_6_Reasoninggpt-6-astraGpt_6_Astragpt-5.6Gpt_5_6_Chat*_Chattone that replaced the retired*_Quickclaude-sonnet-5Claude_Sonnet_5claude-sonnet-5.5Claude_Sonnetclaude-sonnet; the scenario picks Sonnet 5.5 vs 4.6claude-opus/claude-opus-4.8Claude_Opusclaude-opus-5.5Claude_Opusgrok-4.5/grok-reasoningGrok_4_5/Grok_ReasoningAutomatic discovery & conversion for future M365 models
M365CloudClient.DiscoverTones): queries the authenticatedRefreshNavPanestore (availableModelSelectionOptions[].id) and the authenticated/chatHTML + CDN JS bundles, so newly rolled-out tones are discovered even when the unauthenticated root page redirects to login.toneToPublicModelSpec): any newly discovered upstream tone outside the baseline is deterministically converted into an OpenAI-style public model ID (e.g.Gpt_62_Sol_Reasoning→gpt-6.2-sol,Gpt_7_Chat→gpt-7,Claude_Sonnet_6→claude-sonnet-6) and appended to/v1/modelsand the console model picker.dynamicToneForModel): routes both auto-generated public model IDs and direct upstream tone names (includingtone:<ToneName>passthrough) back to their upstream tone, and automatically switches*_Chatto*_Reasoningon higherreasoning_effortwhen the sibling reasoning tone exists.Why the current build could not use them
knownUpstreamTones()was a fixed list that stopped atGpt_5_6_Reasoning, so a console mapping to any newer tone failed validation with上游 tone "..." 不受支持and could not even be saved.fetchUpstreamTones()never returned anything in practice (the unauthenticated CDN page now redirects to login), and its regex was pinned to a single-digit version —Gpt_61_Sol_Reasoningand the uppercase spellings could never match.magicorGpt_5_5_Reasoning, so a client asking for a new model quietly got an old one.OfficeWebPaidCopilotwas missing from the scenario enum, so the tones that only serve under it (GPT-6, Sonnet 5/5.5, Opus 5.5) could never be reached.Verification
Live on a work/education (Entra) account through
/api/admin/models/test:gofmt -w,go vet ./...,go test ./...andgo build ./...all pass; the React console was rebuilt (tsc --noEmit && vite build). Unit tests cover the schemeless callback URL, the new model→tone mappings, the paid-scenario upgrade, andTestAutoDiscoveredTonesConvertToPublicModelsAndRoute.