One turn through DeepSeek Harness (dsh)
architecture node:
User input:
Representation at this boundary
Source modules
Loop map
One pass — prompt logged → compaction priced → context derived from the log → request built with every tool schema → streamed reply settled as events → pre-execute (approval if asked) → sandboxed execution → results appended → next step re-derives. Nothing reaches the model except through the log.
Unbounded by default —
kick() is while (await turn()) {} in ReactLoopAgent: no step budget, no turn budget. A turn ends when the model stops calling tools, on abort, or when a composed plugin vetoes the serial agent/turn-stopping hook. The only in-loop guard is advisory — a repeat-tool reminder that never vetoes.One registry, two presentations — the same composed tree serves Standard mode (every schema on the wire) and PTC mode (one
run_code schema plus a generated SDK), differing by a single preset row. Bridged sub-calls re-enter the identical approval and sandbox pipeline, so the safety story does not fork.