Files
deepseek-harness/packages/timeout
Tianyi Cui 0004b8675f Merge remote-tracking branch 'origin/master' into codex/enforce-tool-cancellation
# Conflicts:
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/snapshots/bash-spill/session.jsonl
#	examples/acp-agent/tests/snapshots/escalation-approved/session.jsonl
#	examples/acp-agent/tests/snapshots/escalation-rejected/session.jsonl
#	examples/acp-agent/tests/snapshots/fs-escalation-approved/session.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-pretool-ask/session.jsonl
#	packages/context/workspace-context/tests/workspace-context.spec.ts
#	packages/core/agent/src/index.ts
#	packages/support/invariants/tests/invariants.spec.ts
#	packages/ui/acp/src/index.ts
#	packages/ui/tui/tests/harness.ts
#	packages/ui/tui/tests/tui.spec.ts
2026-07-21 20:03:00 +08:00
..
2026-07-19 22:52:03 +08:00

timeout/ — tool-call timeout policy

The tool-call timeout policy plugin. A single product package: it is a deployment-policy consumer of the tools/execute around-dispatch seam (owned by dsh-tools) and the pure dsh-timeout library — not a swappable capability with an interface/implementation split, so it needs no seam trio.

Package Role ctx key
timeout-policy/ A tools/execute wrapper: for each configured tool it arms a per-call deadline on exec.signal and returns a structured TOOL_TIMEOUT result when that deadline wins (registers a tools/execute listener; injects nothing)

Timeout is split across three layers: dsh-timeout owns the pure timing/classification primitive (deadline/timeoutOf), each capability owns termination (bash kills its process group, the fetch provider tears down its socket), and this package owns the model-facing tool-call budget as deployment policy — no model-facing timeout argument, no global default. It is the middleware the timeout-library Agent Note foresaw. bash and hook command execution keep their own BASH_TIMEOUT backend timeout and do not route through this policy.