chore: scrub internal identifiers from public text (#340)

This commit is contained in:
qer 2026-06-02 21:54:42 +08:00 committed by GitHub
parent 7284f30479
commit 3502d870fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 33 additions and 23 deletions

View file

@ -60,6 +60,7 @@ If you believe a change qualifies as major, stop first, explain why, and ask the
- User-facing CLI wording should only be used when CLI users can perceive the change.
- Internal changes that do not affect CLI users can still share a changeset with the CLI, but the wording must describe the real change honestly and must not present it as a user-facing feature.
- Do not mention file names, class names, function names, PR numbers, or commit hashes.
- Do not include real internal endpoints, key names, account names, or service names. If an example is needed, use neutral placeholders such as `example.com`, `example.test`, or `YOUR_API_KEY`.
- Avoid vague words such as `refactor`, `optimize`, and `improve`. Describe the actual change, or use more specific wording.
## Common Examples
@ -104,3 +105,4 @@ Clarify session status typing for internal SDK callers.
- The changelog entry is in Chinese.
- The wording claims more than the diff actually did.
- The CLI wording mentions internal package names, class names, or PR numbers.
- The entry includes real internal identifiers instead of neutral placeholders.

View file

@ -75,6 +75,7 @@ This skill depends on the following being in place. If any are missing, stop and
- **Locale sync**: Non-changelog pages stay mirrored between `docs/en/` and `docs/zh/`. Changelog flows English → Chinese.
- **Terminology**: Use the term table in `docs/AGENTS.md` exactly. Do not invent new translations or use synonyms.
- **Scope discipline**: Only update sections affected by the recent changes. Do not opportunistically rewrite unrelated docs.
- **Public examples**: Never write real internal endpoints, key names, account names, or service names into docs. Use neutral placeholders such as `https://api.example.com/v1`, `https://registry.example.com/v1/models/api.json`, `example.test`, and `YOUR_API_KEY`.
- **Breaking changes**: If any change is breaking, also update `docs/en/release-notes/breaking-changes.md` (under `## Unreleased`) with `**Affected**` + `**Migration**` subsections, and mirror it in `docs/zh/release-notes/breaking-changes.md`.
- **Do not edit auto-synced files**: `docs/en/release-notes/changelog.md` is regenerated by the sync script; any manual edit will be overwritten.
@ -85,3 +86,4 @@ This skill depends on the following being in place. If any are missing, stop and
- Updating only one locale and leaving its mirror stale.
- Editing only the mirror to fix wording that should be corrected in the locale you changed first.
- Inventing new terminology that drifts from the `docs/AGENTS.md` term table.
- Using real internal values in examples instead of neutral `example` placeholders.

View file

@ -90,6 +90,8 @@ After stripping, each entry should be only:
Upstream language rule: `gen-changesets` requires changelog entries to be English. If the upstream CLI changelog contains a non-English entry, stop and report it to the user. Do not silently rewrite it while syncing docs.
Public-text rule: do not copy real internal endpoints, key names, account names, or service names into docs changelogs. Replace examples with neutral placeholders such as `example.com`, `example.test`, or `YOUR_API_KEY` while preserving the user-visible meaning.
### 3. Classify Entries
The docs changelog uses five section types:
@ -204,6 +206,7 @@ Check:
- Each section has the same number of entries on both pages.
- Within each section, the most valuable, obvious, and larger entries appear before smaller or narrower entries.
- PR links and commit hashes were stripped.
- Real internal identifiers were replaced with neutral placeholders.
- There are no empty sections.
- Markdown indentation and blank lines are intact.

View file

@ -55,6 +55,7 @@ When non-changelog pages change in either locale, sync the mirror before release
- **Do not one-sided fixes**: if the changed locale has an unclear or incorrect statement, fix it there first; do not patch only the mirror.
- **Match style, not just words**: Chinese docs use a narrative tone (see `docs/AGENTS.md` writing-style examples); preserve that tone in Chinese; preserve sentence-case headings and concise English style in English.
- **Code blocks and identifiers stay as-is**: do not translate code, command names, flag names, or file paths.
- **Public examples**: Do not introduce real internal endpoints, key names, account names, or service names while translating. Keep or replace them with neutral placeholders such as `example.com`, `example.test`, and `YOUR_API_KEY` in both locales.
## Common mistakes
@ -63,3 +64,4 @@ When non-changelog pages change in either locale, sync the mirror before release
- Forgetting to add spaces between Chinese characters and inline code or English words.
- Translating proper nouns listed in the term table (`Wire`, `MCP`, `ACP`, `JSON`, `OAuth`, `macOS`, `uv`, etc.).
- Updating only one direction and leaving the other locale stale — always finish all pages flagged by the diff.
- Copying real internal values into the mirror instead of using neutral `example` placeholders.

View file

@ -65,6 +65,7 @@ This is a TypeScript monorepo built for agent-assisted development. Keep the roo
- Prefer `rg` / `rg --files` when reading code.
- When designing changes, follow existing boundaries and local patterns first.
- In public text and test data, replace real internal identifiers with neutral placeholders such as `example.com`, `example.test`, and `YOUR_API_KEY`. Before opening a PR, ask a read-only agent to audit the diff for context-specific internal identifiers.
- When creating a PR, the PR title must follow Conventional Commit style, e.g. `chore: remove legacy format commands`.
- When an AI agent opens or updates a PR, fill in `.github/pull_request_template.md` — link the related issue or explain the problem, then describe what changed. Do not leave placeholder text or submit a generic summary of the diff.
- Do not submit vague AI-generated PR text. The human author must understand the change well enough to explain the code, edge cases, and why the approach fits this repository.

View file

@ -4,7 +4,7 @@
### Minor Changes
- [#232](https://github.com/MoonshotAI/kimi-code/pull/232) [`a24bfb1`](https://github.com/MoonshotAI/kimi-code/commit/a24bfb1df38e58120827a1d8ed881724af2e7b23) - Add `KIMI_MODEL_ADAPTIVE_THINKING` (and a matching `adaptive_thinking` model-alias field) to force adaptive thinking (`thinking: { type: 'adaptive' }`) on or off, overriding the Anthropic model-name version inference. This lets custom-named staff endpoints that back an adaptive-capable model opt in even when the model name does not encode a parseable Claude version.
- [#232](https://github.com/MoonshotAI/kimi-code/pull/232) [`a24bfb1`](https://github.com/MoonshotAI/kimi-code/commit/a24bfb1df38e58120827a1d8ed881724af2e7b23) - Add `KIMI_MODEL_ADAPTIVE_THINKING` (and a matching `adaptive_thinking` model-alias field) to force adaptive thinking (`thinking: { type: 'adaptive' }`) on or off, overriding the Anthropic model-name version inference. This lets custom-named compatible endpoints that back an adaptive-capable model opt in even when the model name does not encode a parseable Claude version.
- [#264](https://github.com/MoonshotAI/kimi-code/pull/264) [`42bb914`](https://github.com/MoonshotAI/kimi-code/commit/42bb9141d8ee7023639f943dd4c6a0f6c8fa8945) - Add `/provider` command for managing AI providers, support custom registry imports, and introduce a tabbed model selector.

View file

@ -136,12 +136,12 @@ async function tryRun<T>(fn: () => Promise<T>): Promise<T | undefined> {
}
}
const REGISTRY_URL = 'https://free-tokens.example.test/v1/models/api.json';
const REGISTRY_URL = 'https://registry.example.test/v1/models/api.json';
const REGISTRY_BODY = {
kohub: {
id: 'kohub',
name: 'KoHub Anthropic',
api: 'https://free-tokens.example.test',
api: 'https://registry.example.test',
type: 'anthropic',
models: {
'claude-opus-4-7': { id: 'claude-opus-4-7', name: 'Claude Opus 4-7', tool_call: true },
@ -150,7 +150,7 @@ const REGISTRY_BODY = {
'kohub-responses': {
id: 'kohub-responses',
name: 'KoHub Responses',
api: 'https://free-tokens.example.test/v1',
api: 'https://registry.example.test/v1',
type: 'openai_responses',
models: {
'gpt-5.5': { id: 'gpt-5.5', name: 'GPT 5.5', reasoning: true },
@ -248,7 +248,7 @@ describe('kimi provider add', () => {
expect(Object.keys(finalConfig.providers).toSorted()).toEqual(['kohub', 'kohub-responses']);
const kohub = finalConfig.providers['kohub']!;
expect(kohub.type).toBe('anthropic');
expect(kohub.baseUrl).toBe('https://free-tokens.example.test');
expect(kohub.baseUrl).toBe('https://registry.example.test');
expect(kohub.apiKey).toBe('sk-test-token');
expect(kohub.source).toEqual({
kind: 'apiJson',

View file

@ -93,8 +93,8 @@ Set `KIMI_MODEL_ADAPTIVE_THINKING=true` when a custom-named Anthropic-compatible
```sh
export KIMI_MODEL_NAME="kimi-for-coding"
export KIMI_MODEL_BASE_URL="https://api-staff.msh.team/v1"
export KIMI_MODEL_API_KEY="$MOONSHOT_STAFF_KEY"
export KIMI_MODEL_BASE_URL="https://api.example.com/v1"
export KIMI_MODEL_API_KEY="YOUR_API_KEY"
export KIMI_MODEL_MAX_CONTEXT_SIZE="262144"
export KIMI_MODEL_CAPABILITIES="image_in,thinking"
kimi

View file

@ -188,15 +188,15 @@ Import every provider listed in a custom registry (an `api.json` document). The
| Argument / Option | Description |
| --- | --- |
| `<url>` | Registry URL, e.g. `https://free-tokens.msh.team/v1/models/api.json`. |
| `<url>` | Registry URL, e.g. `https://registry.example.com/v1/models/api.json`. |
| `--api-key <key>` | Bearer token sent with the registry fetch. Falls back to the `KIMI_REGISTRY_API_KEY` environment variable when omitted. Required. |
```sh
# One-line import — every provider and model in the registry lands in ~/.kimi-code/config.toml
kimi provider add https://free-tokens.msh.team/v1/models/api.json --api-key YOUR_KEY
kimi provider add https://registry.example.com/v1/models/api.json --api-key YOUR_KEY
# Or via environment variable, for CI / .envrc-style workflows
KIMI_REGISTRY_API_KEY=YOUR_KEY kimi provider add https://free-tokens.msh.team/v1/models/api.json
KIMI_REGISTRY_API_KEY=YOUR_KEY kimi provider add https://registry.example.com/v1/models/api.json
```
If a provider id already exists, it is replaced (its stale model aliases are removed first, mirroring the TUI flow). No default model is selected — pick one later via `-m` or `/model` inside the TUI.

View file

@ -8,7 +8,7 @@ This page documents the changes in each Kimi Code CLI release.
- Add `/provider` command for managing AI providers, support custom registry imports, and introduce a tabbed model selector. It replaces the deprecated `/connect` command — use `/provider` instead.
- Render scheduled reminders distinctly in the TUI, expose cron fired events to SDK clients, and report cron fire times with local timezone offsets.
- Add `KIMI_MODEL_ADAPTIVE_THINKING` (and a matching `adaptive_thinking` model-alias field) to force adaptive thinking (`thinking: { type: 'adaptive' }`) on or off, overriding the Anthropic model-name version inference. This lets custom-named staff endpoints that back an adaptive-capable model opt in even when the model name does not encode a parseable Claude version.
- Add `KIMI_MODEL_ADAPTIVE_THINKING` (and a matching `adaptive_thinking` model-alias field) to force adaptive thinking (`thinking: { type: 'adaptive' }`) on or off, overriding the Anthropic model-name version inference. This lets custom-named compatible endpoints that back an adaptive-capable model opt in even when the model name does not encode a parseable Claude version.
### Bug Fixes

View file

@ -93,8 +93,8 @@ OAuth 流程默认连接 Kimi 官方的认证与托管端点,下列变量可
```sh
export KIMI_MODEL_NAME="kimi-for-coding"
export KIMI_MODEL_BASE_URL="https://api-staff.msh.team/v1"
export KIMI_MODEL_API_KEY="$MOONSHOT_STAFF_KEY"
export KIMI_MODEL_BASE_URL="https://api.example.com/v1"
export KIMI_MODEL_API_KEY="YOUR_API_KEY"
export KIMI_MODEL_MAX_CONTEXT_SIZE="262144"
export KIMI_MODEL_CAPABILITIES="image_in,thinking"
kimi

View file

@ -188,15 +188,15 @@ kimi provider <action> [options]
| 参数 / 选项 | 说明 |
| --- | --- |
| `<url>` | Registry 地址,例如 `https://free-tokens.msh.team/v1/models/api.json`。 |
| `<url>` | Registry 地址,例如 `https://registry.example.com/v1/models/api.json`。 |
| `--api-key <key>` | 访问 registry 时携带的 Bearer token。未传时回退到环境变量 `KIMI_REGISTRY_API_KEY`。必填。 |
```sh
# 一行导入registry 中的所有 provider 与 model 全部写入 ~/.kimi-code/config.toml
kimi provider add https://free-tokens.msh.team/v1/models/api.json --api-key YOUR_KEY
kimi provider add https://registry.example.com/v1/models/api.json --api-key YOUR_KEY
# 或通过环境变量,便于 CI / .envrc 等场景
KIMI_REGISTRY_API_KEY=YOUR_KEY kimi provider add https://free-tokens.msh.team/v1/models/api.json
KIMI_REGISTRY_API_KEY=YOUR_KEY kimi provider add https://registry.example.com/v1/models/api.json
```
如果某个 provider id 已存在,会先删除(包括其残留的模型 alias再按 registry 重新写入,与 TUI 的行为一致。不会自动设置默认模型 —— 后续可以用 `-m` 或 TUI 内的 `/model` 选择。

View file

@ -8,7 +8,7 @@
- 新增用于管理 AI 供应商的 `/provider` 命令,支持自定义 registry 导入,并引入标签页式模型选择器。该命令替代了已废弃的 `/connect`,请改用 `/provider`
- 在终端界面中以独立样式渲染定时提醒,向 SDK 客户端暴露 cron 触发事件,并在报告 cron 触发时间时附带本地时区偏移。
- 新增 `KIMI_MODEL_ADAPTIVE_THINKING`(以及对应的 `adaptive_thinking` 模型别名字段),用于强制开启或关闭自适应 thinking`thinking: { type: 'adaptive' }`),覆盖基于 Anthropic 模型名的版本推断。这样一来,背后由支持自适应能力的模型驱动、且使用自定义名称的 staff 端点,即使模型名没有编码出可解析的 Claude 版本,也能选择启用该能力。
- 新增 `KIMI_MODEL_ADAPTIVE_THINKING`(以及对应的 `adaptive_thinking` 模型别名字段),用于强制开启或关闭自适应 thinking`thinking: { type: 'adaptive' }`),覆盖基于 Anthropic 模型名的版本推断。这样一来,背后由支持自适应能力的模型驱动、且使用自定义名称的兼容端点,即使模型名没有编码出可解析的 Claude 版本,也能选择启用该能力。
### 修复

View file

@ -4,7 +4,7 @@
### Minor Changes
- [#232](https://github.com/MoonshotAI/kimi-code/pull/232) [`a24bfb1`](https://github.com/MoonshotAI/kimi-code/commit/a24bfb1df38e58120827a1d8ed881724af2e7b23) - Add `KIMI_MODEL_ADAPTIVE_THINKING` (and a matching `adaptive_thinking` model-alias field) to force adaptive thinking (`thinking: { type: 'adaptive' }`) on or off, overriding the Anthropic model-name version inference. This lets custom-named staff endpoints that back an adaptive-capable model opt in even when the model name does not encode a parseable Claude version.
- [#232](https://github.com/MoonshotAI/kimi-code/pull/232) [`a24bfb1`](https://github.com/MoonshotAI/kimi-code/commit/a24bfb1df38e58120827a1d8ed881724af2e7b23) - Add `KIMI_MODEL_ADAPTIVE_THINKING` (and a matching `adaptive_thinking` model-alias field) to force adaptive thinking (`thinking: { type: 'adaptive' }`) on or off, overriding the Anthropic model-name version inference. This lets custom-named compatible endpoints that back an adaptive-capable model opt in even when the model name does not encode a parseable Claude version.
- [#204](https://github.com/MoonshotAI/kimi-code/pull/204) [`ee69d0a`](https://github.com/MoonshotAI/kimi-code/commit/ee69d0ac29f56bde4957c14767d7ca436697d9cf) - Render scheduled reminders distinctly in the TUI, expose cron fired events to SDK clients, and report cron fire times with local timezone offsets.

View file

@ -96,9 +96,9 @@ describe('applyEnvModelConfig', () => {
it('lets an explicit base url override the default', () => {
expect(
apply({ ...MIN, KIMI_MODEL_BASE_URL: 'https://api-staff.msh.team/v1' })
apply({ ...MIN, KIMI_MODEL_BASE_URL: 'https://api.example.com/v1' })
.providers[ENV_MODEL_PROVIDER_KEY]?.baseUrl,
).toBe('https://api-staff.msh.team/v1');
).toBe('https://api.example.com/v1');
});
it('parses comma-separated capabilities (trimmed, lowercased)', () => {
@ -113,9 +113,9 @@ describe('applyEnvModelConfig', () => {
expect(withoutName).toBeDefined();
expect(withoutName?.displayName).toBeUndefined();
expect(
apply({ ...MIN, KIMI_MODEL_DISPLAY_NAME: 'Staff Model' })
apply({ ...MIN, KIMI_MODEL_DISPLAY_NAME: 'Custom Model' })
.models?.[ENV_MODEL_ALIAS_KEY]?.displayName,
).toBe('Staff Model');
).toBe('Custom Model');
});
it('writes type-specific fields and validates max_output_size', () => {

View file

@ -4,7 +4,7 @@
### Minor Changes
- [#232](https://github.com/MoonshotAI/kimi-code/pull/232) [`a24bfb1`](https://github.com/MoonshotAI/kimi-code/commit/a24bfb1df38e58120827a1d8ed881724af2e7b23) - Add `KIMI_MODEL_ADAPTIVE_THINKING` (and a matching `adaptive_thinking` model-alias field) to force adaptive thinking (`thinking: { type: 'adaptive' }`) on or off, overriding the Anthropic model-name version inference. This lets custom-named staff endpoints that back an adaptive-capable model opt in even when the model name does not encode a parseable Claude version.
- [#232](https://github.com/MoonshotAI/kimi-code/pull/232) [`a24bfb1`](https://github.com/MoonshotAI/kimi-code/commit/a24bfb1df38e58120827a1d8ed881724af2e7b23) - Add `KIMI_MODEL_ADAPTIVE_THINKING` (and a matching `adaptive_thinking` model-alias field) to force adaptive thinking (`thinking: { type: 'adaptive' }`) on or off, overriding the Anthropic model-name version inference. This lets custom-named compatible endpoints that back an adaptive-capable model opt in even when the model name does not encode a parseable Claude version.
### Patch Changes