fzy3232/dsh-chinese-language ↗★ 0
dsh-chinese-language
通过系统提示和轮换提醒,引导智能体持续使用简体中文思考与回答。 适合需要防止AI在长对话或恢复会话时意外切换为英文的中文用户。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:fzy3232/dsh-chinese-language说明文档
阅读完整 README ↗Configuration
Every field is optional. Unknown keys are ignored, and an unusable value falls back to that key's default instead of failing the loader entry.
| Key | Default | Meaning |
|---|---|---|
lines | the two built-in rules | Section lines, joined with newlines. Empty or non-string entries are dropped. |
text | - | Replaces lines entirely when non-empty. Wins over lines. |
order | derived, else 10300 | Section sort order. Anything above 10200 lands after the first-party sections. |
section | enabled, named user:chinese-language | Either false to skip the section channel, or a string naming it. |
sectionName | user:chinese-language | Section name. Must stay unique within the scope; a duplicate name throws. |
contextText | the three rotating reminders | Pins one reminder; setting it turns rotation off (one sentence has no variants). |
contextTexts | the three rotating reminders | A custom rotation set, cycled by ROTATION_WINDOW_MS. |
contextRotate | true | false disables rotation and writes the reminder once (0.2.x behavior). |
context | enabled, named user:chinese-language | Either false to skip the reminder, or a string naming it. |
contextName | user:chinese-language | Reminder name, unique within the scope. |
contextOrder | derived, else 100 | Reminder sort order; lower values print earlier in the snapshot. |
On harnesses that expose getSectionOrder() / getContextOrder(), the section order is derived from DEPLOYMENT_PERSONA_SUFFIX and the reminder order from WORKING_DIRECTORY (falling back to SANDBOX_POLICY), so both still track the registry if those slots move. Harnesses without the accessors use the constants.
Why the reminder rotates
dsh-agent-loop re-renders the runtime context on every preStep, but it commits a new message only when the rendered text differs from the snapshot it already retained, and that message is appended at the end of that step's request. A static reminder is therefore written once at the start of a session and never appears again — in a long session the rule drifts thousands of tokens behind the live turn, exactly where an English skill description, the Aegis routing notice, or a tool result drowns it out.
Since 0.3.0 the reminder wording rotates on a 60-second window: the same rule in different words, so the rendered text changes and the harness re-commits a fresh snapshot next to the current step. The cost is one very short message per minute in a long session; set contextRotate: false to go back to a single write.
Example, keeping both channels but tightening the wording:
- insert:
- id: dsh-chinese-language
name: dsh-chinese-language
config:
lines:
- 始终使用简体中文回答。
- 代码、命令和报错原文保留原文。
contextText: 提醒:用简体中文。
A patch replaces the targeted row's whole config, so restate every key the row needs whenever an override adds one.