d86e/dsh-doctor1

@d86e/dsh-doctor

dsh-doctor: self-healing watchdog for the DeepSeek Harness web profile. Recovers from plugin-induced boot failures within 60s, runs an unbounded CLI doctor, captures every tool error, and watches all live sessions for stuck turns.

包名
@d86e/dsh-doctor
版本
0.2.4
许可证
MIT
最近更新
2026年8月27日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:d86e/dsh-doctor

Usage

After install, you can ask the agent:

> dsh_doctor_status
> dsh_doctor_diagnose
> dsh_doctor_watch_list
> dsh_doctor_safe_mode_enter
> dsh_doctor_drain_deferred

From a shell:

dsh doctor                  # unbounded CLI doctor (foreground)
dsh doctor --dry-run        # triage only, no writes

To uninstall:

> dsh_doctor_uninstall

Configuration

All knobs can be set either in cordis.patch.yml (under config:) or via DSH_DOCTOR_* environment variables.

FieldEnv varDefaultDescription
healthIntervalMsDSH_DOCTOR_HEALTH_INTERVAL30000Health probe period
healthFailuresToRecoverDSH_DOCTOR_HEALTH_FAILURES3Failures before triage
recoveryBudgetMsDSH_DOCTOR_BUDGET_MS60000Hard ceiling per incident (watchdog)
logMaxBytes5242880Per-log rotation size
logBackups3Rotated log files kept
safeModeBundles["dsh-core"]Bundles kept in safe mode
toolErrorCaptureDSH_DOCTOR_TOOL_ERROR_CAPTUREtrueSubscribe to tools/*
toolErrorMaxQueueDSH_DOCTOR_TOOL_ERROR_QUEUE500Per-session queue cap
watchEnabledDSH_DOCTOR_WATCH_ENABLEDtrueMaster switch for session watch
watchIdleThresholdMsDSH_DOCTOR_WATCH_IDLE_MS600000Idle timeout (10 min)
watchNudgeCooldownMsDSH_DOCTOR_WATCH_COOLDOWN_MS300000Min interval between nudges
watchMaxNudgesPerSessionDSH_DOCTOR_WATCH_MAX_NUDGES3Cap before giving up
watchContinueTextDSH_DOCTOR_WATCH_TEXT"继续"Text to inject (supports {elapsed}, {turn}, {sessionId})
watchTickIntervalMsDSH_DOCTOR_WATCH_TICK_MS30000Idle-check period

Tool error classifier — replace it

If the default classification (network/5xx/429 → transient, 401/403/quota/context-overflow → agent, else → business) is wrong for your stack, pass your own classifier / policy when you register the plugin from a wrapper bundle. Both functions receive the full ToolErrorContext and return synchronously.

Session watch text — localize it

watchContinueText accepts the placeholders {elapsed} (seconds since last event), {turn} (current turn number), {sessionId}. So "已经过去 {elapsed} 了,请继续第 {turn} 步" works.