Commit Graph

1158 Commits

Author SHA1 Message Date
Yichen Jiang
bd59fddacd refactor(tasks): declare-then-execute — ctx.tasks.start() replaces register()
start({ kind, label, owner, run }) preflights everything that can fail
(the attachSurface fence, validation, the owner-cleanup attach) BEFORE
invoking the producer's run() starter, then commits atomically —
'work started but never got a collectable id' is now structurally
impossible instead of a producer try/catch rollback obligation (the
P1 review fix, rebuilt on #185's declare/execute split). Producers
lose their catch-wraps; the leak tests now pin the stronger property
that a failed preflight never spawns anything. TaskRegistration splits
into TaskStart (identity + run) and TaskHooks (cancel/done/readOutput);
docs, type-equiv manifest, catalogs, and both RFCs move with it.
2026-07-09 21:55:07 +08:00
Yichen Jiang
f858c647a6 refactor(tasks): drive wait() timing through dsh-timeout
ctx.tasks.wait arms a deadline() fusing the caller's abort with the
wait timeout and classifies the outcome with timeoutOf scoped to the
new TASK_WAIT_TIMEOUT code: a wait timeout resolves to the live
snapshot (the task keeps running), a caller abort rejects the wait —
same contract, no hand-rolled timer/listener plumbing, and a nested
foreign deadline can no longer misread as a wait timeout. task_output
deliberately declares NO ToolDefinition.timeoutMs: timeout-policy
turns a timed-out call into a structured TOOL_TIMEOUT failure, but a
timed-out wait is a SUCCESS that must still report [status: running]
(decision recorded in the runtime RFC alternatives).
2026-07-09 21:36:56 +08:00
Yichen Jiang
beaace5eb3 Merge remote-tracking branch 'origin/master' into codex/rfc-subagent-background-tasks
Adopts #185 (dsh-timeout: clampTimeout/deadline/timeoutOf drive bash
run() timeout classification; runBash loses its own timer) and #108
(ask_user_question) across the task-runtime rework: bash-local keeps
the BashProcess handle shape with master's deadline mechanics, tool
catalogs/expectations carry both the task_* and ask-user tools, and
generated docs are regenerated on the union.
2026-07-09 21:32:07 +08:00
Yichen Jiang
184e164091 feat(tasks): background task runtime, generic task_* control tools, bash/subagent producers
One shared ctx.tasks registry (branded <kind>-N ids, owner-fenced
read/kill/wait/list, attachSurface misconfiguration fence, reported-flag
notice dedup, atomic register) + dsh-tool-tasks (task_output/task_list/
task_kill, completion-notice injection, background prompt habit).
Producers opt in via their own enableRunInBackground config: bash
(stream kind; seam slimmed to resolve/run/start returning a BashProcess
handle, bash_output/bash_kill deleted) and subagent (final-output kind;
done settles after run.dispose()). Owner disposal drains tasks through
the new awaited ctx.agents.onCleanup seam in the loop's disposal chain.
Both RFCs moved to implemented/; docs, catalogs, snapshots re-pinned.
2026-07-09 21:22:54 +08:00
Tianyi Cui
137530954a Merge pull request #108 from deepseek-harness/codex/ask-user-question
Add ask_user_question interaction tool
2026-07-09 20:45:46 +08:00
Yichen Jiang
e41dbe7303 docs: list the user-interaction packages in the ui/ group summaries 2026-07-09 18:42:51 +08:00
Yichen Jiang
1e06fdbb86 refactor: colocate user interaction with ui packages 2026-07-09 17:59:02 +08:00
Yichen Jiang
bdab8c6a61 Merge remote-tracking branch 'origin/master' into codex/ask-user-question
# Conflicts:
#	docs/config-catalog.md
2026-07-09 13:34:13 +08:00
Tianyi Cui
63d890ab96 Merge pull request #185 from deepseek-harness/timeout-design
feat(timeout): dsh-timeout library + tools/execute seam + tool-call timeout policy
2026-07-09 12:45:19 +08:00
Dudu-0223
0a3ffe1b04 Merge remote-tracking branch 'origin/master' into timeout-design
# Conflicts:
#	docs/event-producer-consumer.md
#	packages/README.md
2026-07-09 11:52:18 +08:00
Yichen Jiang
c4aff62ef7 Merge remote-tracking branch 'origin/codex/ask-user-question' into codex/ask-user-question 2026-07-09 11:22:12 +08:00
Yichen Jiang
0009d13693 docs: refresh tool catalog 2026-07-09 11:21:27 +08:00
Yichen Jiang
7db9a6c780 fix review findings: document ask-user recommendation convention 2026-07-09 11:20:17 +08:00
Yichen Jiang
a5ba05121a Merge branch 'master' into codex/ask-user-question 2026-07-09 11:11:07 +08:00
Tianyi Cui
e0e4203263 Merge pull request #208 from deepseek-harness/code-runtime-worker
feat: contained worker-thread code runtime (dsh-code-runtime-worker)
2026-07-09 01:05:48 +08:00
Tianyi Cui
43de115173 Merge branch 'master' into code-runtime-worker 2026-07-09 01:04:01 +08:00
Yichen Jiang
db9437a50e Merge remote-tracking branch 'origin/master' into codex/ask-user-question
# Conflicts:
#	packages/bash/bash-local/tests/executor.spec.ts
#	packages/bash/bash-local/tests/run.spec.ts
2026-07-09 00:48:45 +08:00
Yichen Jiang
56091d5b5d fix review findings: keep ask-user opt-in for acp app 2026-07-09 00:42:36 +08:00
Tianyi Cui
064d1c4ce1 docs: state advisory typing in the worker row (review)
A reviewer read "TypeScript via host-side type-strip" and reasonably
asked what typing buys if nothing checks it — the group README never
said the annotations are advisory by design. The row now states it; the
rationale stays in the RFC and the enforcement story (per-dispatch
validateArgs) in the dsh-tools README.
2026-07-09 00:38:21 +08:00
Tianyi Cui
d014e7eaa6 Merge pull request #221 from deepseek-harness/codex/fix-bash-local-process-tests
test(bash-local): wait for process readiness
2026-07-09 00:02:54 +08:00
Tianyi Cui
75ae8e38af Merge branch 'master' into codex/fix-bash-local-process-tests 2026-07-09 00:01:28 +08:00
Yichen Jiang
7a1ef4b231 Merge remote-tracking branch 'origin/codex/ask-user-question' into codex/ask-user-question 2026-07-08 22:25:05 +08:00
Yichen Jiang
b31399bdc4 Merge remote-tracking branch 'origin/master' into codex/ask-user-question
# Conflicts:
#	docs/module-graph.md
2026-07-08 22:22:25 +08:00
Wenlu Wang
970971fd53 Merge pull request #213 from deepseek-harness/feat/repeat-tool-guard
feat(guard): repeat-tool-guard plugin (implements the RFC)
2026-07-08 22:14:53 +08:00
Tianyi Cui
90547f283b fix: byte-exact value/error caps + write-callback contract (agent review)
Two [P1] review findings on the worker runtime:

- maxValueBytes gated and sliced the rendered fallback by UTF-16 code
  units, so a multibyte string ("€€€€" under a 4-byte cap) crossed whole
  and a truncated multibyte rendering could still run ~3x over budget.
  New truncateUtf8Bytes cuts at code-point boundaries under a real byte
  budget; prepareValue's fallback and the host's forged-error-text bound
  both use it, and the VALUE_RENDER_SLACK comment drops its now-obsolete
  "sliced by characters" wrinkle.

- The patched stream write dropped Node's optional encoding/callback
  arguments, so a program awaiting flush completion
  (write(chunk, resolve)) hung to the wall ceiling and misreported as a
  timeout. The shim now fires the callback asynchronously once the chunk
  is admitted — including for writes the exhausted budget drops.
2026-07-08 21:56:28 +08:00
Yichen Jiang
9c133c644d test(bash-local): wait for process readiness 2026-07-08 21:45:10 +08:00
Yichen Jiang
e7e382f9d1 docs: require awaited subagent owner cleanup 2026-07-08 21:16:56 +08:00
Yichen Jiang
4dee9a8d9b docs: propose background subagent tasks 2026-07-08 20:31:41 +08:00
Yichen Jiang
692a38b72c Merge branch 'master' into codex/ask-user-question 2026-07-08 16:05:16 +08:00
Dudu-0223
a83eb5d5c2 docs: fit packages/README budget after merging code-runtime + timeout rows
The master merge added a code-runtime/ package row while this branch adds
the timeout/ row; together they push packages/README.md over its 605-word
ceiling. Condense the timeout/ row to the terse sibling style and raise the
ceiling 605->610 for the genuinely-new package group, mirroring how the
code-runtime work raised architecture.md's ceiling in the same spirit.
2026-07-08 15:46:46 +08:00
Dudu-0223
ef2a150293 Merge remote-tracking branch 'origin/master' into timeout-design 2026-07-08 15:40:56 +08:00
Dudu-0223
a7c055270d chore(timeout-policy): drop now-unused schemastery dependency
The zero-config enforcer no longer imports schemastery (its Config was
removed); knip flags the stale dependency. Remove it from the manifest
and sync the lockfile.
2026-07-08 15:10:15 +08:00
Dudu-0223
395a0b8336 docs(timeout): update RFC + generated catalogs for the declaration split
The RFC's deployment-policy decision is unchanged; state the current
mechanism in place — the per-tool budget is declared on ToolDefinition
(timeoutMs, set by the owning tool plugin from its config) and the
enforcer is zero-config, so a mistyped tool name is impossible.
Regenerate config-catalog (timeout-policy -> no-config; tool-web gains
fetch/searchTimeoutMs), the event graph (tools/change loses its
timeout-policy consumer), the ToolDefinition type-equiv block, and a
source-line drift in the cordis services catalog.
2026-07-08 15:06:02 +08:00
kingwl
232c1957e2 Merge remote-tracking branch 'origin/master' into feat/repeat-tool-guard 2026-07-08 14:52:12 +08:00
Tianyi Cui
030eebb634 Merge remote-tracking branch 'origin/master' into code-runtime-worker 2026-07-08 14:44:23 +08:00
Tianyi Cui
dabc5e6225 Merge pull request #205 from deepseek-harness/code-runtime-pkg
feat: add the code-execution capability seam (ctx.codeRuntime)
2026-07-08 14:44:04 +08:00
Dudu-0223
7a822ee402 feat(tool-web): declare web tool timeout budgets via config
fetchTimeoutMs/searchTimeoutMs (default 30000) resolve to each tool's
ToolDefinition.timeoutMs, moving the budget's declaration home onto the
owning tool plugin and preserving per-tool deployment override without a
mistypable central tool-name map.
2026-07-08 14:40:14 +08:00
kingwl
e491759f30 fix review finding: cap the detailed reminder's argument payload 2026-07-08 14:40:08 +08:00
Tianyi Cui
d0314736de Merge remote-tracking branch 'origin/master' into code-runtime-pkg 2026-07-08 14:38:54 +08:00
Tianyi Cui
4398daa62b Merge pull request #203 from deepseek-harness/code-mode-rfc
docs: rewrite the Code Mode RFC — registry-native mode over a worker-thread code-runtime seam
2026-07-08 14:38:34 +08:00
Dudu-0223
534b1dc6d0 refactor(timeout-policy): read budget from ToolDefinition, drop config
The enforcer now reads ctx.tools.get(exec.name).timeoutMs instead of a
free-text tool-name config map, so a mistyped name is impossible and the
tools/change warn-once apparatus is gone. exec.name always resolves in the
registry during dispatch, so there is no unknown-name path to warn about.
2026-07-08 14:37:42 +08:00
Tianyi Cui
89941c0b42 Merge remote-tracking branch 'origin/master' into code-mode-rfc 2026-07-08 14:29:50 +08:00
kingwl
a581963070 docs(rfc): promote the repeat-tool-guard RFC to implemented 2026-07-08 14:24:20 +08:00
kingwl
a0e39db3b6 test(acp-snapshot): add the repeat-tool-guard reminder scenario 2026-07-08 14:24:20 +08:00
kingwl
93d5e4c560 test(acp-snapshot): replace the authored-implies-override guard with an explicit overridden flag 2026-07-08 14:24:20 +08:00
kingwl
db26ef479d feat(guard): add the repeat-tool-guard plugin 2026-07-08 14:24:20 +08:00
Dudu-0223
5d451bb2a0 feat(tools): add ToolDefinition.timeoutMs declared+validated via defineTool
A tool declares its cooperative timeout budget on its own definition
rather than a deployment naming it in a central config map. The field
never reaches the model (schemas() whitelists name/description/parameters)
and defineTool rejects a non-positive-finite value at authorship.
2026-07-08 14:06:24 +08:00
Wenlu Wang
2f162308fe Merge pull request #209 from deepseek-harness/repeat-tool-guard-rfc
docs(rfc): propose the repeat-tool-guard plugin
2026-07-08 13:48:12 +08:00
kingwl
36d93b4ad3 docs(rfc): propose the repeat-tool-guard plugin 2026-07-08 13:44:50 +08:00
Tianyi Cui
d6363d3d27 Merge pull request #207 from deepseek-harness/all-checks-passed-gate
ci: add all-checks-passed aggregate job for branch protection
2026-07-08 13:42:44 +08:00