Tianyi Cui bc7da642d4 feat: fold the Code Mode demos into demo:code-mode with a UI argument 2 месяцев назад
..
tests bc7da642d4 feat: fold the Code Mode demos into demo:code-mode with a UI argument 2 месяцев назад
README.md bc7da642d4 feat: fold the Code Mode demos into demo:code-mode with a UI argument 2 месяцев назад
cordis.yml b59d245c7c feat: Code Mode — the registry's mode config, the SDK codegen, and the run_code bridge 2 месяцев назад
package.json b59d245c7c feat: Code Mode — the registry's mode config, the SDK codegen, and the run_code bridge 2 месяцев назад

README.md

code-agent — the Code Mode demo

The Code Mode form of the coding agent: instead of one native tool call per step, the model is offered exactly ONE wire tool — run_code — plus a generated TypeScript SDK section declaring every other registered tool (bash, read, write, edit, todo_write). The model composes tools by writing a program; the program runs in a fresh worker thread (@deepseek-ai/dsh-code-runtime-worker), its tool calls bridge back through the ordinary tools/pre-execute/post-execute pipeline one at a time, each is logged as a tool/code-dispatch session event, and ONLY what the program prints or returns re-enters the model's context.

pnpm run demo:code-mode   # needs DEEPSEEK_API_KEY (repo-root .env works)

Try a task that spans several tool calls, e.g.:

Count the lines of every *.md file under docs/ and write the three largest to summary.txt.

and watch the transcript: one run_code call, a program looping over tools, and a result the model curated instead of five round-trips of raw tool output.

Two lines of cordis.yml make the difference from examples/coding-agent: the code-runtime entry (the worker-thread backend registering ctx.codeRuntime) and tools: { mode: code } on the app (flip it to both to offer native calls AND run_code side by side; remove both lines and it IS the coding agent).

Tests: tests/keyless-smoke.e2e.ts boots the real cordis.yml through the Loader with no prompt (the export-shape guard); tests/code-mode.e2e.ts is the with-key proof — a real model, a two-tool task, asserting the wire tool list was exactly [run_code], the tool/code-dispatch events landed, and the curated answer came back.