mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
Address @tianyicui's minor-revision review on PR #110: - Make every BasicCompactConfig knob required except `auto` (defaults true): there is no data yet to justify default thresholds/budgets, so a consumer states each value explicitly. Drop the DEFAULTS export and the constructor's `= {}` default; example cordis.yml, the compaction e2e, the README, and every test construction site now pass a complete config (tests route through a `cfg()` helper). - Add a TODO on estimateContentTokens: char/4 is coarse; replace with a real tokenizer or post-response usage feedback in a follow-up. - Add a TODO on the agent/pre-step `fullSystemPrompt` param flagging it as a smell on a generic per-step seam (compaction is its sole consumer); a `//` line comment so it stays out of the generated catalog.
126 lines
5.1 KiB
YAML
126 lines
5.1 KiB
YAML
# The coding-agent plugin tree: the real coding agent. The two swappable
|
|
# backends — the DeepSeek adapter and the local bash executor — plus `hmr` for
|
|
# the dev/demo reload loop, then the stdio chat app (@deepseek-ai/dsh-stdio-
|
|
# agent), which bundles the whole agent-core spine (timer, llm, sessions,
|
|
# system-prompt, tools, agents, invariants, tool-bash, agent-loop), the console
|
|
# logger, JSONL persistence, the readline UI, and a pre-created `main` agent.
|
|
#
|
|
# `hmr` is a leaf entry (not baked into dsh-stdio-agent): it is a Loader-only
|
|
# dev plugin that needs `--expose-internals` — the `demo:coding` script passes
|
|
# it. Requires DEEPSEEK_API_KEY (and optionally DEEPSEEK_BASE_URL) in the
|
|
# environment — the dsh-stdio-agent bin loads the gitignored repo-root .env
|
|
# first. cordis.yml reads them via the `!!js` tag.
|
|
|
|
# Hot-module reload for the dev/demo loop (needs `node --expose-internals`).
|
|
- id: hmr
|
|
name: '@cordisjs/plugin-hmr'
|
|
config:
|
|
root: ['.']
|
|
|
|
# The DeepSeek adapter. Swap to '@deepseek-ai/dsh-llm-pi-ai' for the pi-ai-backed
|
|
# twin (same config shape; `reasoning: high` replaces thinking/reasoningEffort).
|
|
- id: llm-deepseek
|
|
name: '@deepseek-ai/dsh-llm-deepseek'
|
|
config:
|
|
apiKey: !!js process.env.DEEPSEEK_API_KEY
|
|
baseURL: !!js process.env.DEEPSEEK_BASE_URL
|
|
models:
|
|
- deepseek-v4-flash
|
|
- deepseek-v4-pro
|
|
|
|
# Local bash executor for agent-core's tool-bash schema.
|
|
# FIXME(config-comments): keep this executor note from implying bash is the
|
|
# whole tool set; subagent and todo_write are loaded below.
|
|
- id: bash
|
|
name: '@deepseek-ai/dsh-bash-local'
|
|
config:
|
|
timeoutMs: 60000
|
|
|
|
# The stdio chat app: the whole spine + front-door cluster, configured for a
|
|
# real coding agent driving a pre-created `main` agent.
|
|
- id: stdio-agent
|
|
name: '@deepseek-ai/dsh-stdio-agent'
|
|
config:
|
|
model: deepseek-v4-flash
|
|
# Set RESUME_SESSION_ID to continue a prior persisted session (the ids live
|
|
# under ./.sessions); unset starts a fresh session each run.
|
|
resumeSessionId: !!js process.env.RESUME_SESSION_ID
|
|
persistenceRoot: './.sessions'
|
|
welcome: 'coding-agent ready. Give it a coding task (its tools are bash, subagent, and todo_write).'
|
|
systemPrompt: |
|
|
You are coding-agent, a CLI coding assistant.
|
|
|
|
Your tools are bash (plus bash_output/bash_kill for background
|
|
tasks) and subagent. Do ALL file operations through bash: read with
|
|
cat/sed/head, search with grep, write with heredocs (cat <<'EOF' >
|
|
file), edit with sed or a rewrite. Each bash call runs in a fresh
|
|
shell — pass workdir instead of cd, and never rely on shell state
|
|
between calls.
|
|
|
|
Use the subagent tool to delegate a focused, self-contained subtask
|
|
to a fresh child agent (it works in its own context and returns only
|
|
its final result) — give it a complete, standalone instruction. Use
|
|
subagent_fork instead when the subtask needs THIS conversation's
|
|
context: the child inherits the log so far.
|
|
|
|
Check the [exit code: N] marker on every command; investigate
|
|
failures before moving on. Verify your work by running the code or
|
|
tests. Keep answers brief and factual.
|
|
|
|
For multi-step work, use the todo_write tool to track a task list:
|
|
send the WHOLE list each call (it replaces the previous one), keep at
|
|
most one task in_progress (exactly one while work remains), and mark a
|
|
task completed as soon as it is done. Skip it for trivial single-step
|
|
tasks.
|
|
|
|
# Automatic context compaction: when the derived history approaches the model's
|
|
# context window, summarize an older range into a checkpoint so a long-running
|
|
# or tool-heavy session keeps fitting. A leaf entry (needs ctx.llm + the
|
|
# agent-loop's `agent/pre-step` seam from the app above).
|
|
- id: compact-basic
|
|
name: '@deepseek-ai/dsh-compact-basic'
|
|
config:
|
|
contextWindow: 128000
|
|
thresholdRatio: 0.8
|
|
retainTokens: 20480
|
|
summarizationModel: ''
|
|
maxTokens: 8192
|
|
compactionRetries: 1
|
|
|
|
# The subagent seam + BOTH in-process backends + two model-facing tools, as leaf
|
|
# entries after the app (which provides ctx.agents/ctx.tools). spawn (a fresh
|
|
# child) and fork (a child seeded with the parent's completed-turn prefix) are
|
|
# independent backends over the shared dsh-subagent-inprocess driver. Exposing
|
|
# both transports is pure config: load each backend, then load dsh-tool-subagent
|
|
# once per backend with a distinct toolName (the tool registry rejects a
|
|
# duplicate name) — no code change.
|
|
- id: subagent
|
|
name: '@deepseek-ai/dsh-subagent'
|
|
|
|
- id: subagent-spawn
|
|
name: '@deepseek-ai/dsh-subagent-spawn'
|
|
config:
|
|
providerName: spawn
|
|
|
|
- id: subagent-fork
|
|
name: '@deepseek-ai/dsh-subagent-fork'
|
|
config:
|
|
providerName: fork
|
|
|
|
- id: tool-subagent
|
|
name: '@deepseek-ai/dsh-tool-subagent'
|
|
config:
|
|
provider: spawn
|
|
toolName: subagent
|
|
|
|
- id: tool-subagent-fork
|
|
name: '@deepseek-ai/dsh-tool-subagent'
|
|
config:
|
|
provider: fork
|
|
toolName: subagent_fork
|
|
|
|
# The model-facing todo_write tool: whole-list task tracking written to the
|
|
# session log (todo/write), rendered as a stdio checklist / ACP plan.
|
|
- id: tool-todo
|
|
name: '@deepseek-ai/dsh-tool-todo'
|