fzy3232/dsh-chinese-language ↗★ 0

dsh-chinese-language

DeepSeek Harness plugin: keep agents reasoning and answering in Simplified Chinese with a token-lean system-prompt section plus a rotating runtime-context reminder that keeps landing next to the live turn in long or resumed sessions. 适合需要防止AI在长对话或恢复会话时意外切换为英文的中文用户。

패키지
dsh-chinese-language
호환성
미검증
버전
0.3.0
라이선스
MIT
최근 업데이트
2026. 10. 20.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:fzy3232/dsh-chinese-language

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.

KeyDefaultMeaning
linesthe two built-in rulesSection lines, joined with newlines. Empty or non-string entries are dropped.
text-Replaces lines entirely when non-empty. Wins over lines.
orderderived, else 10300Section sort order. Anything above 10200 lands after the first-party sections.
sectionenabled, named user:chinese-languageEither false to skip the section channel, or a string naming it.
sectionNameuser:chinese-languageSection name. Must stay unique within the scope; a duplicate name throws.
contextTextthe three rotating remindersPins one reminder; setting it turns rotation off (one sentence has no variants).
contextTextsthe three rotating remindersA custom rotation set, cycled by ROTATION_WINDOW_MS.
contextRotatetruefalse disables rotation and writes the reminder once (0.2.x behavior).
contextenabled, named user:chinese-languageEither false to skip the reminder, or a string naming it.
contextNameuser:chinese-languageReminder name, unique within the scope.
contextOrderderived, else 100Reminder 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.