Browse Source

Stack SiliconFlow role fix on DashScope

saladday 2 months ago
parent
commit
72a237c9dd

+ 1 - 1
.github/ISSUE_TEMPLATE/01-bug-report.yml

@@ -1,7 +1,7 @@
 name: Bug report
 name: Bug report
 description: Report a reproducible problem with the Desktop app, CLI, or source build.
 description: Report a reproducible problem with the Desktop app, CLI, or source build.
 title: "[Bug]: "
 title: "[Bug]: "
-labels: ["bug"]
+labels: ["bug", "needs-triage"]
 body:
 body:
   - type: markdown
   - type: markdown
     attributes:
     attributes:

+ 1 - 1
.github/ISSUE_TEMPLATE/02-feature-request.yml

@@ -1,7 +1,7 @@
 name: Feature request
 name: Feature request
 description: Suggest an improvement to the Desktop app, CLI, or source distribution.
 description: Suggest an improvement to the Desktop app, CLI, or source distribution.
 title: "[Feature]: "
 title: "[Feature]: "
-labels: ["enhancement"]
+labels: ["enhancement", "needs-triage"]
 body:
 body:
   - type: dropdown
   - type: dropdown
     id: product
     id: product

+ 9 - 7
.github/ISSUE_TEMPLATE/03-question.yml

@@ -1,12 +1,13 @@
-name: Usage question
-description: Ask about the Desktop app, CLI, or building from source.
+name: Usage or repository policy question
+description: Ask about the Desktop app, CLI, source builds, or contribution policy.
 title: "[Question]: "
 title: "[Question]: "
-labels: ["question"]
+labels: ["question", "needs-triage"]
 body:
 body:
   - type: dropdown
   - type: dropdown
     id: product
     id: product
     attributes:
     attributes:
       label: Product or interface
       label: Product or interface
+      description: Leave blank if unsure or asking about repository policy.
       options:
       options:
         - Desktop app
         - Desktop app
         - CLI - interactive TUI
         - CLI - interactive TUI
@@ -14,7 +15,7 @@ body:
         - CLI - ACP
         - CLI - ACP
         - Source build or repository tooling
         - Source build or repository tooling
     validations:
     validations:
-      required: true
+      required: false
   - type: textarea
   - type: textarea
     id: question
     id: question
     attributes:
     attributes:
@@ -25,6 +26,7 @@ body:
     id: platform
     id: platform
     attributes:
     attributes:
       label: Platform
       label: Platform
+      description: Leave blank if unknown or not applicable.
       options:
       options:
         - macOS
         - macOS
         - Windows
         - Windows
@@ -32,11 +34,11 @@ body:
         - WSL
         - WSL
         - Multiple platforms
         - Multiple platforms
     validations:
     validations:
-      required: true
+      required: false
   - type: textarea
   - type: textarea
     id: context
     id: context
     attributes:
     attributes:
-      label: Version and what you have tried
-      description: Include documentation you followed and relevant redacted output. Do not include keys or account data.
+      label: Version or policy context
+      description: For usage questions, include your version and what you tried. For policy questions, link the relevant policy. Do not include keys or account data.
     validations:
     validations:
       required: true
       required: true

+ 3 - 0
.github/ISSUE_TEMPLATE/config.yml

@@ -1,5 +1,8 @@
 blank_issues_enabled: false
 blank_issues_enabled: false
 contact_links:
 contact_links:
+  - name: Contribution policy
+    url: https://github.com/MiniMax-AI/minimax-code/blob/main/CONTRIBUTING.md
+    about: Everyone may report issues and suggest improvements. Pull requests are accepted only from repository collaborators; external PRs are not accepted.
   - name: CLI quick start and troubleshooting
   - name: CLI quick start and troubleshooting
     url: https://agent.minimax.io/docs/cli/quick-start
     url: https://agent.minimax.io/docs/cli/quick-start
     about: Installation, account regions, first tasks, and links to troubleshooting.
     about: Installation, account regions, first tasks, and links to troubleshooting.

+ 1 - 0
.github/ISSUE_TEMPLATE/docs.yml

@@ -1,6 +1,7 @@
 name: Documentation issue
 name: Documentation issue
 description: Report missing, incorrect, or unclear documentation.
 description: Report missing, incorrect, or unclear documentation.
 title: "[Docs] "
 title: "[Docs] "
+labels: ["documentation", "needs-triage"]
 body:
 body:
   - type: input
   - type: input
     id: location
     id: location

+ 2 - 0
README.md

@@ -98,6 +98,8 @@ mcode
 
 
 Supported API formats: `openai-completions`, `openai-responses`, and `anthropic-messages`. See the [model examples](docs/examples.md#2-choose-your-own-model) for environment variable setup, connection checks, and model overrides for a single run.
 Supported API formats: `openai-completions`, `openai-responses`, and `anthropic-messages`. See the [model examples](docs/examples.md#2-choose-your-own-model) for environment variable setup, connection checks, and model overrides for a single run.
 
 
+Providers added this way are stored under `custom_provider` in the active profile's `config.yaml`; this is the supported path for third-party or self-hosted endpoints, while `minimax_api` stays reserved for the official MiniMax API. Relays that require `Authorization: Bearer` on an Anthropic-compatible endpoint can set custom headers in `config.yaml`; see [Third-party relays and custom auth headers](docs/examples.md#third-party-relays-and-custom-auth-headers).
+
 </details>
 </details>
 
 
 ### 3. Run your first task
 ### 3. Run your first task

+ 2 - 0
README_ZH.md

@@ -98,6 +98,8 @@ mcode
 
 
 支持 `openai-completions`、`openai-responses` 和 `anthropic-messages`。连接测试、单次模型切换及环境变量设置见 [模型示例](docs/examples.md#2-choose-your-own-model)。
 支持 `openai-completions`、`openai-responses` 和 `anthropic-messages`。连接测试、单次模型切换及环境变量设置见 [模型示例](docs/examples.md#2-choose-your-own-model)。
 
 
+通过该命令添加的提供方保存在当前 profile `config.yaml` 的 `custom_provider` 下;第三方或自建端点一律走这条路径,`minimax_api` 保留给官方 MiniMax API。若中转端点只提供 Anthropic 兼容接口且要求 `Authorization: Bearer` 鉴权,可在 `config.yaml` 中为提供方配置自定义 headers;见[第三方中转与自定义鉴权头](docs/examples.md#third-party-relays-and-custom-auth-headers)。
+
 </details>
 </details>
 
 
 ### 3. 完成第一个任务
 ### 3. 完成第一个任务

+ 20 - 0
docs/examples.md

@@ -66,6 +66,26 @@ pnpm mcode provider list --json
 
 
 `--api-key-env` reads the current environment variable value and stores that value in the active profile's `config.yaml`; it does not save an environment-variable reference. The file still contains plaintext credentials. On POSIX systems, config writes and temporary copies use `0600`. When loading existing files, MCode removes group/other access while preserving the owner's permissions; already-private files such as `0400` or `0600` do not require a permission change. Loading fails if an unsafe main config cannot be restricted. Older migration backups are also checked, but inspection or repair failures produce a warning identifying the directory or backup that needs manual attention rather than preventing the main config from loading. Windows file modes do not provide equivalent ACL protection; restrict access to the profile directory using Windows permissions.
 `--api-key-env` reads the current environment variable value and stores that value in the active profile's `config.yaml`; it does not save an environment-variable reference. The file still contains plaintext credentials. On POSIX systems, config writes and temporary copies use `0600`. When loading existing files, MCode removes group/other access while preserving the owner's permissions; already-private files such as `0400` or `0600` do not require a permission change. Loading fails if an unsafe main config cannot be restricted. Older migration backups are also checked, but inspection or repair failures produce a warning identifying the directory or backup that needs manual attention rather than preventing the main config from loading. Windows file modes do not provide equivalent ACL protection; restrict access to the profile directory using Windows permissions.
 
 
+### Third-party relays and custom auth headers
+
+Providers created by `mcode provider add` are stored under `custom_provider` in the active profile's `config.yaml`. That tree is the supported home for any endpoint other than the official MiniMax API; `minimax_api` is reserved for the official endpoint and keeps its fixed authentication scheme.
+
+Authentication follows the API format: `openai-completions` and `openai-responses` send `Authorization: Bearer <key>`, and `anthropic-messages` sends the key as `x-api-key`. A relay that expects Bearer authentication on an OpenAI-compatible endpoint therefore needs no extra configuration. If a relay only exposes an Anthropic-compatible endpoint (`/v1/messages`) and requires Bearer authentication, add explicit headers to the provider entry in `config.yaml`:
+
+```yaml
+custom_provider:
+  my-relay:
+    options:
+      apiKey: sk-relay-key
+      baseURL: https://relay.example.com
+      headers:
+        Authorization: Bearer sk-relay-key
+    models:
+      MiniMax-M2: {}
+```
+
+`api` can be omitted and defaults to `anthropic-messages`. Configured headers are sent on both connection tests and conversation requests, and they are part of the connection-test fingerprint, so editing them retires a cached test verdict. The default `x-api-key` header is still sent alongside; the relay must tolerate rather than reject it. Header values are stored in plaintext like `apiKey` and are reported by name only in provider views. After editing the file, verify with `mcode provider list` and `mcode provider test <provider-id>`.
+
 [Live acceptance](verification.md) separately verified MiniMax Token Plan and one configured BYOK provider. This is not a guarantee for every compatible service.
 [Live acceptance](verification.md) separately verified MiniMax Token Plan and one configured BYOK provider. This is not a guarantee for every compatible service.
 
 
 ## 3. Search and image input
 ## 3. Search and image input

+ 46 - 0
docs/installation.md

@@ -60,6 +60,52 @@ To locate data safely:
 
 
 For tests, explicitly set `MINIMAX_DATA_DIR` to a temporary directory to keep normal sessions separate. Use `$env:MINIMAX_DATA_DIR = 'C:\path\to\test-profile'` in PowerShell or `export MINIMAX_DATA_DIR=/path/to/test-profile` in a POSIX shell.
 For tests, explicitly set `MINIMAX_DATA_DIR` to a temporary directory to keep normal sessions separate. Use `$env:MINIMAX_DATA_DIR = 'C:\path\to\test-profile'` in PowerShell or `export MINIMAX_DATA_DIR=/path/to/test-profile` in a POSIX shell.
 
 
+## macOS terminal shortcuts: Ghostty Option+M
+
+In the composer, `Alt+M` (`Option+M` on macOS) cycles permission modes through Ask, Auto, and Full access. Its binding ID is `composer.cycle-permission`. `Shift+Tab` toggles **Plan mode**, a separate setting. You can also use `/permission` to choose a permission mode and `/permission status` to inspect it without an Option shortcut.
+
+If `Option+M` inserts `µ` instead, the terminal is sending text rather than the expected Alt shortcut. MCode preserves literal `µ` as text; it cannot safely infer a permission change from that character. The terminal must forward the modifier, or you can choose another binding.
+
+### Configure Ghostty's Option key
+
+Ghostty's [`macos-option-as-alt`](https://ghostty.org/docs/config/reference#macos-option-as-alt) default is **keyboard-layout dependent** when unset, not always `false`. The current reference lists U.S. Standard and U.S. International as defaulting to `true`; other layouts default to `false`. Check the active macOS input source and the configuration loaded by your installed Ghostty version.
+
+Set this in your Ghostty configuration to send both Option keys as Alt:
+
+```ini
+macos-option-as-alt = true
+```
+
+Use `left` or `right` instead of `true` to reserve only that Option key for shortcuts and retain Unicode composition on the other side. Use the configured side when testing `Option+M`.
+
+Follow Ghostty's [configuration locations and precedence](https://ghostty.org/docs/config#file-location): macOS-specific files load after XDG files, and later settings can override earlier ones. Inspect the loaded setting from the same Ghostty installation, without `--default`:
+
+```bash
+ghostty +show-config | awk '/^macos-option-as-alt[[:space:]]*=/'
+```
+
+If `ghostty` is not on `PATH`, use the executable inside your installed app bundle, typically `/Applications/Ghostty.app/Contents/MacOS/ghostty`. An empty or omitted value is not proof of `false`; unset behavior depends on the layout. After editing, reload Ghostty's configuration from its menu (default `Cmd+Shift+,`) and open a new terminal. This is separate from MCode's `/reload` command.
+
+### Keep Option for text and customize MCode instead
+
+While idle, open `/hotkeys`, select `composer.cycle-permission`, press `Enter`, press `Ctrl+X`, then press `Enter` to save. `Ctrl+X` is unused by the current default MCode bindings; check any custom terminal or multiplexer bindings too. Do not choose `Ctrl+M`: terminals commonly encode it identically to `Enter`.
+
+Alternatively, merge this entry into `<data-dir>/tui/keybindings.json`, preserving any existing entries:
+
+```json
+{
+  "composer.cycle-permission": "ctrl+x"
+}
+```
+
+For the default profile this is `~/.minimax/tui/keybindings.json`; [profiles and data-directory overrides](#accounts-and-data) change the path. Create the `tui` directory if needed. After editing the file, run `/reload` while idle with no pending interaction or queued message, or restart MCode. This replaces `Alt+M`; use `["alt+m", "ctrl+x"]` as the value to retain both bindings. `/hotkeys` shows the effective binding.
+
+### Verify the result
+
+With an idle composer and no open picker or permission prompt, note `/permission status`, press the configured shortcut, and check the status again. The mode should advance without inserting text. Restore your intended permission mode through `/permission` afterward. Confirm that `Shift+Tab` still toggles Plan mode and that pasting `µ` still inserts text.
+
+If it still fails, record `mcode --version`, Ghostty's version, active keyboard layout, which Option key you pressed, the setting above, the effective `/hotkeys` entry, and whether tmux or SSH is involved. Compare with a direct Ghostty session. MCode supports both legacy ESC-prefixed Alt input and extended keyboard reports; a shell's raw-key display alone does not establish what Ghostty sends after the TUI negotiates its keyboard protocol.
+
 ## Update or remove
 ## Update or remove
 
 
 Save your changes, fetch a reviewed revision with Git, then repeat the frozen install and build. A source installation does not automatically become an official npm installation.
 Save your changes, fetch a reviewed revision with Git, then repeat the frozen install and build. A source installation does not automatically become an official npm installation.

+ 23 - 0
docs/maintainers.md

@@ -11,6 +11,29 @@
 
 
 These are repository maintenance responsibilities, not an assertion that an account owns the product's copyright. Every PR that requires approval needs a reviewer other than the author, and security reports need a working private response path. Review maintainer additions and policy changes in a PR; do not silently grant repository access.
 These are repository maintenance responsibilities, not an assertion that an account owns the product's copyright. Every PR that requires approval needs a reviewer other than the author, and security reports need a working private response path. Review maintainer additions and policy changes in a PR; do not silently grant repository access.
 
 
+## Issue triage
+
+Published source covers the standalone CLI (interactive TUI, headless and ACP). The issue tracker also collects Desktop app feedback; accepting those reports does not expand the published source scope.
+
+Everyone may report bugs, request features, ask questions, and flag documentation problems. Code and documentation PRs are accepted only from repository collaborators. Opening an issue or having a proposal accepted does not grant collaborator access or permission to submit a PR. Do not use `good first issue` or `help wanted` while external PRs are closed.
+
+Use these labels independently:
+
+| Category | Labels and meaning |
+| --- | --- |
+| Type | `bug`: reported malfunction; `enhancement`: requested improvement; `documentation`: missing or incorrect docs; `question`: usage or project-policy question |
+| Product | `desktop`: Desktop app; `cli`: standalone mcode, including TUI, headless, ACP and its source builds/tooling |
+| Triage | `needs-triage`: awaiting maintainer assessment; `needs-info`: a maintainer has asked the reporter for specific missing information |
+
+1. Start with [needs-triage](https://github.com/MiniMax-AI/minimax-code/issues?q=is%3Aissue+is%3Aopen+label%3Aneeds-triage) and [unlabelled issues](https://github.com/MiniMax-AI/minimax-code/issues?q=is%3Aissue+is%3Aopen+no%3Alabel). Templates add a type and `needs-triage`; reports created through other routes may need both added manually. A type label describes the report and does not confirm a defect or commit to implementation.
+2. Confirm one primary type and apply `desktop` or `cli` from the report. Product dropdowns stay in the body; maintainers apply product labels manually. Use both only when the report establishes that both are affected. Leave product labels unset for unclear reports or repository-policy questions. The existing `tui` label may supplement `cli` for interactive-terminal-specific issues; it does not cover headless or ACP.
+3. If information is missing, ask for the specific version, reproduction, or expected behavior, replace `needs-triage` with `needs-info`, and retain any known type/product labels. When the reporter replies, remove `needs-info` and reassess. Do not automatically close issues for inactivity.
+4. Once assessed, remove `needs-triage` and record the next step in a comment. Assign a collaborator when someone takes responsibility; classification alone does not promise a fix or release date. For duplicates, link the original issue before closing with `duplicate`. For declined requests, explain the reason before closing with `wontfix`.
+
+Route security reports through [Security](../SECURITY.md). Do not ask for secrets or unredacted logs in public issues. Label setup is a separate repository operation: ensure the labels above exist before merging template changes, since forms cannot create missing labels. The Feishu workflow sends notifications only; it does not perform triage.
+
+This small label set draws on the type and information-request handling in [VS Code's triage guide](https://github.com/microsoft/vscode/wiki/Issues-Triaging) and the `needs-triage`/`needs-info` states used by [Ruff](https://github.com/astral-sh/ruff/labels). Contribution eligibility follows this repository's policy.
+
 ## Review and merge
 ## Review and merge
 
 
 1. Repository collaborators open an issue for substantial scope or submit a focused feature-branch PR. Other users may open issues to discuss ideas and proposals. Security details follow the private reporting process.
 1. Repository collaborators open an issue for substantial scope or submit a focused feature-branch PR. Other users may open issues to discuss ideas and proposals. Security details follow the private reporting process.

+ 41 - 0
packages/local-runtime-v2/src/service/model-system/resolution/local-model-resolver.test.ts

@@ -1450,6 +1450,23 @@ describe('LocalModelResolver custom provider compat overrides', () => {
   it.each([
   it.each([
     'https://api.siliconflow.cn/v1',
     'https://api.siliconflow.cn/v1',
     'https://api.siliconflow.com/v1',
     'https://api.siliconflow.com/v1',
+    'https://dashscope.aliyuncs.com/compatible-mode/v1',
+    'https://dashscope-intl.aliyuncs.com/compatible-mode/v1',
+    'https://dashscope-us.aliyuncs.com/compatible-mode/v1',
+    'https://cn-hongkong.dashscope.aliyuncs.com/compatible-mode/v1',
+    'https://coding.dashscope.aliyuncs.com/v1',
+    'https://coding-intl.dashscope.aliyuncs.com/v1',
+    'https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',
+    'https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1',
+    'https://trial.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',
+    'https://example-workspace.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',
+    'https://example-workspace.cn-hongkong.maas.aliyuncs.com/compatible-mode/v1',
+    'https://example-workspace.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1',
+    'https://example-workspace.ap-northeast-1.maas.aliyuncs.com/compatible-mode/v1',
+    'https://example-workspace.eu-central-1.maas.aliyuncs.com/compatible-mode/v1',
+    'https://example-workspace.us-east-1.maas.aliyuncs.com/compatible-mode/v1',
+    'https://api.kimi.com/coding/v1',
+    'https://api.kimi.ai/coding/v1',
   ])('keeps the system role for a thinking model at %s', async (baseURL) => {
   ])('keeps the system role for a thinking model at %s', async (baseURL) => {
     expect(await systemPromptRoleFor(undefined, baseURL)).toBe('system');
     expect(await systemPromptRoleFor(undefined, baseURL)).toBe('system');
   });
   });
@@ -1461,6 +1478,17 @@ describe('LocalModelResolver custom provider compat overrides', () => {
     ['https://gateway.example/api.siliconflow.cn/v1', 'developer'],
     ['https://gateway.example/api.siliconflow.cn/v1', 'developer'],
     ['https://api.siliconflow.com.example/v1', 'developer'],
     ['https://api.siliconflow.com.example/v1', 'developer'],
     ['https://gateway.example/api.siliconflow.com/v1', 'developer'],
     ['https://gateway.example/api.siliconflow.com/v1', 'developer'],
+    ['https://api.moonshot.cn/v1', 'system'],
+    ['https://api.moonshot.ai/v1', 'system'],
+    ['https://dashscope.aliyuncs.com.example/v1', 'developer'],
+    ['https://gateway.example/dashscope.aliyuncs.com/v1', 'developer'],
+    ['https://coding.dashscope.aliyuncs.com.example/v1', 'developer'],
+    ['https://token-plan.cn-beijing.maas.aliyuncs.com.example/v1', 'developer'],
+    ['https://gateway.example/token-plan.cn-beijing.maas.aliyuncs.com/v1', 'developer'],
+    ['https://example-workspace.unknown-region.maas.aliyuncs.com/v1', 'developer'],
+    ['https://example-workspace.cn-beijing.aliyuncs.com/v1', 'developer'],
+    ['https://api.kimi.com.example/v1', 'developer'],
+    ['https://gateway.example/api.kimi.com/coding/v1', 'developer'],
   ])('preserves the system prompt role for %s', async (baseURL, role) => {
   ])('preserves the system prompt role for %s', async (baseURL, role) => {
     expect(await systemPromptRoleFor(undefined, baseURL)).toBe(role);
     expect(await systemPromptRoleFor(undefined, baseURL)).toBe(role);
   });
   });
@@ -1468,6 +1496,10 @@ describe('LocalModelResolver custom provider compat overrides', () => {
   it.each([
   it.each([
     'https://api.siliconflow.cn/v1',
     'https://api.siliconflow.cn/v1',
     'https://api.siliconflow.com/v1',
     'https://api.siliconflow.com/v1',
+    'https://dashscope.aliyuncs.com/compatible-mode/v1',
+    'https://coding.dashscope.aliyuncs.com/v1',
+    'https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',
+    'https://example-workspace.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1',
   ])('honors an explicit developer-role override on %s', async (baseURL) => {
   ])('honors an explicit developer-role override on %s', async (baseURL) => {
     expect(
     expect(
       await systemPromptRoleFor(
       await systemPromptRoleFor(
@@ -1476,4 +1508,13 @@ describe('LocalModelResolver custom provider compat overrides', () => {
       ),
       ),
     ).toBe('developer');
     ).toBe('developer');
   });
   });
+
+  it('honors an explicit developer-role override on a Kimi Coding endpoint', async () => {
+    expect(
+      await systemPromptRoleFor(
+        { supportsDeveloperRole: true },
+        'https://api.kimi.com/coding/v1',
+      ),
+    ).toBe('developer');
+  });
 });
 });

+ 19 - 1
test/source-sync.test.mjs

@@ -426,7 +426,7 @@ test('public support forms preserve destination URLs and separate Desktop from C
   for (const name of forms) {
   for (const name of forms) {
     const form = parseYaml(readFileSync(new URL(`../.github/ISSUE_TEMPLATE/${name}`, import.meta.url), 'utf8'));
     const form = parseYaml(readFileSync(new URL(`../.github/ISSUE_TEMPLATE/${name}`, import.meta.url), 'utf8'));
     const product = form.body.find(field => field.id === 'product');
     const product = form.body.find(field => field.id === 'product');
-    assert.equal(product.validations.required, true);
+    assert.equal(product.validations.required, name !== '03-question.yml');
     assert.ok(product.attributes.options.includes('Desktop app'));
     assert.ok(product.attributes.options.includes('Desktop app'));
     assert.ok(product.attributes.options.includes('CLI - ACP'));
     assert.ok(product.attributes.options.includes('CLI - ACP'));
     assert.ok(product.attributes.options.includes('CLI - headless'));
     assert.ok(product.attributes.options.includes('CLI - headless'));
@@ -440,6 +440,24 @@ test('public support forms preserve destination URLs and separate Desktop from C
   assert.equal(classifyChanges(['README_ZH.md', 'README.md']).docsOnly, true);
   assert.equal(classifyChanges(['README_ZH.md', 'README.md']).docsOnly, true);
 });
 });
 
 
+test('issue forms label incoming reports for triage and retain collaborator-only PR guidance', () => {
+  for (const [name, type] of [
+    ['01-bug-report.yml', 'bug'], ['02-feature-request.yml', 'enhancement'],
+    ['03-question.yml', 'question'], ['docs.yml', 'documentation'],
+  ]) {
+    const form = parseYaml(readFileSync(new URL(`../.github/ISSUE_TEMPLATE/${name}`, import.meta.url), 'utf8'));
+    assert.deepEqual(form.labels, [type, 'needs-triage']);
+  }
+  const config = parseYaml(readFileSync(new URL('../.github/ISSUE_TEMPLATE/config.yml', import.meta.url), 'utf8'));
+  assert.equal(config.blank_issues_enabled, false);
+  const policy = config.contact_links.find(link => link.url.endsWith('/CONTRIBUTING.md'));
+  assert.match(policy.about, /only from repository collaborators/);
+  assert.match(policy.about, /external PRs are not accepted/);
+  const question = parseYaml(readFileSync(new URL('../.github/ISSUE_TEMPLATE/03-question.yml', import.meta.url), 'utf8'));
+  assert.equal(question.body.find(field => field.id === 'platform').validations.required, false);
+  assert.equal(question.body.find(field => field.id === 'question').validations.required, true);
+});
+
 test('issue notification is restricted to public destination events and builds payloads offline', t => {
 test('issue notification is restricted to public destination events and builds payloads offline', t => {
   const workflow = parseYaml(readFileSync(new URL('../.github/workflows/sync-issue-to-feishu.yml', import.meta.url), 'utf8'));
   const workflow = parseYaml(readFileSync(new URL('../.github/workflows/sync-issue-to-feishu.yml', import.meta.url), 'utf8'));
   assert.deepEqual(workflow.on, { issues: { types: ['opened'] } });
   assert.deepEqual(workflow.on, { issues: { types: ['opened'] } });

+ 17 - 0
third_party/pi-mono/MINIMAX_CHANGES.md

@@ -22,6 +22,23 @@ No upstream source files are changed in the baseline import.
 - Upstream PR: not opened.
 - Upstream PR: not opened.
 - Validation: outgoing-payload regressions in `packages/local-runtime-v2/src/service/model-system/resolution/local-model-resolver.test.ts`, including both official hosts, unrelated hosts, and explicit compatibility overrides.
 - Validation: outgoing-payload regressions in `packages/local-runtime-v2/src/service/model-system/resolution/local-model-resolver.test.ts`, including both official hosts, unrelated hosts, and explicit compatibility overrides.
 
 
+### 2026-09-19 — preserve the system role for DashScope
+
+- Reason: DashScope endpoints were treated as supporting the `developer` role, causing thinking-enabled OpenAI-compatible conversations to send an unsupported system-prompt role.
+- Affected package: `packages/ai` (`@earendil-works/pi-ai`), OpenAI Completions compatibility detection.
+- Change: default to the `system` role for official DashScope regional and Coding Plan hosts, plus workspace, trial, and Token Plan hosts under the documented regional `maas.aliyuncs.com` domains. Preserve thinking, other request options, explicit compatibility overrides, and other providers.
+- References: [official endpoint list](https://help.aliyun.com/en/model-studio/base-url), [Coding Plan role rejection](https://github.com/openclaw/openclaw/issues/23575), [Token Plan role rejection](https://github.com/earendil-works/pi/issues/7723), and [merged OpenClaw DashScope fix](https://github.com/openclaw/openclaw/pull/24675).
+- Upstream PR: not opened.
+- Validation: request-payload regressions in `packages/local-runtime-v2/src/service/model-system/resolution/local-model-resolver.test.ts`, including official endpoints, unrelated hosts, and explicit compatibility overrides.
+
+### 2026-09-19 — preserve the system role for Kimi Coding
+
+- Reason: Kimi Coding endpoints were treated as supporting the `developer` role, causing thinking-enabled OpenAI-compatible conversations to send an unsupported system-prompt role.
+- Affected package: `packages/ai` (`@earendil-works/pi-ai`), OpenAI Completions compatibility detection.
+- Change: default to the `system` role for `api.kimi.com` and `api.kimi.ai`. Preserve thinking, other request options, explicit compatibility overrides, and other providers.
+- Upstream PR: not opened.
+- Validation: offline request-payload regressions in `packages/local-runtime-v2/src/service/model-system/resolution/local-model-resolver.test.ts`. Live Kimi Coding validation requires a Coding Plan key and remains untested.
+
 ### 2026-08-31 — Windows PowerShell ConstrainedLanguage compatibility
 ### 2026-08-31 — Windows PowerShell ConstrainedLanguage compatibility
 
 
 - Reason: the Windows PowerShell 5.1 stdin wrapper called `Parser.ParseInput`, `ScriptBlock.Create`, and other restricted .NET APIs before user commands. Under enterprise App Control / AppLocker `ConstrainedLanguage`, the wrapper therefore failed before commands such as Python could run.
 - Reason: the Windows PowerShell 5.1 stdin wrapper called `Parser.ParseInput`, `ScriptBlock.Create`, and other restricted .NET APIs before user commands. Under enterprise App Control / AppLocker `ConstrainedLanguage`, the wrapper therefore failed before commands such as Python could run.

+ 5 - 1
third_party/pi-mono/packages/ai/src/providers/openai-completions.ts

@@ -1090,6 +1090,10 @@ function detectCompat(model: Model<"openai-completions">): ResolvedOpenAIComplet
 	const isTogether =
 	const isTogether =
 		provider === "together" || baseUrl.includes("api.together.ai") || baseUrl.includes("api.together.xyz");
 		provider === "together" || baseUrl.includes("api.together.ai") || baseUrl.includes("api.together.xyz");
 	const isMoonshot = provider === "moonshotai" || provider === "moonshotai-cn" || baseUrl.includes("api.moonshot.");
 	const isMoonshot = provider === "moonshotai" || provider === "moonshotai-cn" || baseUrl.includes("api.moonshot.");
+	const isKimiCoding = /^https?:\/\/api\.kimi\.(?:com|ai)(?::\d+)?(?:\/|$)/i.test(baseUrl);
+	const isDashScope =
+		/^https?:\/\/(?:dashscope(?:-intl|-us)?|(?:coding(?:-intl)?|cn-hongkong)\.dashscope)\.aliyuncs\.com(?::\d+)?(?:\/|$)/i.test(baseUrl) ||
+		/^https?:\/\/[a-z0-9-]+\.(?:cn-beijing|cn-hongkong|ap-southeast-1|ap-northeast-1|eu-central-1|us-east-1)\.maas\.aliyuncs\.com(?::\d+)?(?:\/|$)/i.test(baseUrl);
 	const isSiliconFlow = /^https?:\/\/api\.siliconflow\.(?:cn|com)(?::\d+)?(?:\/|$)/i.test(baseUrl);
 	const isSiliconFlow = /^https?:\/\/api\.siliconflow\.(?:cn|com)(?::\d+)?(?:\/|$)/i.test(baseUrl);
 	const isOpenRouter = provider === "openrouter" || baseUrl.includes("openrouter.ai");
 	const isOpenRouter = provider === "openrouter" || baseUrl.includes("openrouter.ai");
 	const isCloudflareWorkersAI = provider === "cloudflare-workers-ai" || baseUrl.includes("api.cloudflare.com");
 	const isCloudflareWorkersAI = provider === "cloudflare-workers-ai" || baseUrl.includes("api.cloudflare.com");
@@ -1126,7 +1130,7 @@ function detectCompat(model: Model<"openai-completions">): ResolvedOpenAIComplet
 	return {
 	return {
 		supportsStore: !isNonStandard,
 		supportsStore: !isNonStandard,
 		supportsDeveloperRole:
 		supportsDeveloperRole:
-			!isSiliconFlow && (isOpenRouterDeveloperRoleModel || (!isNonStandard && !isOpenRouter)),
+			!isKimiCoding && !isDashScope && !isSiliconFlow && (isOpenRouterDeveloperRoleModel || (!isNonStandard && !isOpenRouter)),
 		supportsReasoningEffort:
 		supportsReasoningEffort:
 			!isGrok && !isZai && !isMoonshot && !isTogether && !isCloudflareAiGateway && !isNvidia && !isAntLing,
 			!isGrok && !isZai && !isMoonshot && !isTogether && !isCloudflareAiGateway && !isNvidia && !isAntLing,
 		supportsUsageInStreaming: true,
 		supportsUsageInStreaming: true,