Commit Graph

11815 Commits

Author SHA1 Message Date
imccyu
070a2a7f1e refactor(commands): move the command service to Remote
`CommandService.list` and `execute` carry the wire contract directly through
`@Remote`, and the Client assembly mounts the generated commands
contribution. The legacy API Proxy route, its schemas, the map rows, the
generated client methods and the fixture's command domain are removed, so the
catalog and the admission call have one owner again.

`Session.command()` keeps a result-shaped public face for parity with the
prompt, cancel and attachment neighbours it sits beside, and reads the
generated namespace through one `SessionRemotes` parameter. The Session
cluster declares that face against the owning business package rather than the
generated contribution: the Host compiler aggregate builds this package, and
it runs before any contribution is emitted.

Migrated calls lose the `title-invalid` class of protocol-only error codes and
report `internal`; no production caller branched on them.
2026-08-11 23:33:15 +08:00
imccyu
a2981207b0 feat(typert): deliver the carrier outcome from ctx.remote
Every generated Remote method now resolves to `RemoteResult<T>`: the Client
face folds a carrier failure, a transport throw and a rejected result payload
into one error branch, so no consumer wraps a call to recover them. Only
assembly faults still reject — a wrong argument count, an unmounted method, a
missing Context binder, an absent Connection.

`RemoteFailure.code` stays an open string because the closed RPC code union
lives in the carrier package, which already depends on type-meta; naming it
here would invert that edge.

The goal surface drops its own try/catch plus the structural probe that
guessed whether a thrown cause was an RPC failure, and reads the result
instead.
2026-08-11 23:33:15 +08:00
imccyu
027e5fe9a4 feat(typert): carry Remote absence without a second result envelope
Absence crosses the wire as a missing field: an omitted argument and a void
or undefined result both arrive as an absent JSON member, and the wide RPC
result slot accepts a success response without a value. Parameters declared
optional stay optional in the generated consumer declaration, so a business
signature is never widened to `T | undefined` to suit the wire. The weak SRC
descriptor reads parameter names from a JavaScript signature and cannot see
optionality, so a source-launched Host accepts an absent field and the strict
LIB pass owns rejecting a genuinely missing required parameter.
2026-08-11 23:33:15 +08:00
imccyu
8c31290abb docs: propose unary API Remote migration 2026-08-11 23:33:15 +08:00
Yichen Jiang
0a0737f33b Merge pull request #1873 from deepseek-harness/fix/code-mode-executor-collapse
fix(tools): collapse code-mode executor to run_code for model-direct calls
2026-08-11 23:22:54 +08:00
Yichen Jiang
db4e3e39a5 docs: refresh generated source references after the collapse-section constants
Adding COLLAPSE_SECTION_ORDER and CODE_ONLY_INSTRUCTION shifted every
later line in packages/core/tools/src/index.ts by 14, and three generated
artifacts cite those lines: the subsystems cordis-surface region, the
event producer/consumer matrix, and the Agent Note pair record left
inconsistent by the cherry-pick resolution.
2026-08-11 23:11:12 +08:00
imccyu
38f99f04f1 Merge pull request #2286 from deepseek-harness/release/dsh-0.0.1-rc.2
release(dsh): 0.0.1-rc.2
2026-08-11 23:04:55 +08:00
Yichen Jiang
261349c95e test(acp): refresh both-mode expected prompt onto the merged base 2026-08-11 22:55:53 +08:00
Yichen Jiang
e258cf7a2d fix(tools): resolve the collapse through the scope, not the deployment default
`collapses()` read `defaultMode`, so the collapse only applied when the
DEPLOYMENT was `code`. An agent handed `code` by an agent preset under a
native default announced `[run_code]` on the wire and still executed a
model-direct native call -- the bypass this collapse exists to close,
reopened for exactly the composition `dsh-agent-tool-mode` produces.

`modeFor(scope)` is the same resolution `wireSchemas` and the SDK section
already use, so presentation and execution cannot disagree, and a mode
inherited from a standing preset scope collapses like a declared one.

The per-agent and preset tests asserted only the wire, which is why the
regression passed them. They now assert through the executor: the body
never runs, the call resolves UNKNOWN_TOOL, and the native sibling beside
it still executes.
2026-08-11 22:53:17 +08:00
imccyu
5ca7be5dcb release(dsh): 0.0.1-rc.2 2026-08-11 22:52:39 +08:00
Yichen Jiang
5d2c943d38 fix(tools): state the code-mode collapse in the prompt and the denial
The executor collapse landed without telling the model it exists. Every
tool contributes its own guidance section naming its tool, none of them
qualify how that tool is reached, and they all render before the SDK
(orders 100-199 against SDK_SECTION_ORDER 150), so the prompt said "Use
the read tool" eleven times and never said only run_code is callable.

A real session shows the consequence: the model emitted a native call,
read `unknown tool "read"` for a tool the same prompt declares, and
concluded the deployment was inconsistent rather than routing through
run_code.

The registry now contributes `tools:code-only` at order 99 -- ahead of
the guidance band -- stating the rule, registered wherever `tools:sdk`
is and rendering empty outside an effective `code`. `both` renders it
empty because its native calls do execute, which is also why
both-mode-turn no longer shares code-mode-turn's expected prompt. The
denial itself now names the route back, since a bare UNKNOWN_TOOL for a
declared tool is what misled the model.
2026-08-11 22:51:16 +08:00
Chinesezjc
428aec44e6 ci: retrigger windows native runner 2026-08-11 22:42:17 +08:00
Chinesezjc
47f108bf50 test(tools): use type-safe error assertions instead of any casts
oxlint's no-unsafe-member-access rejects member access through an any
cast; the error info is reachable through the declared optional chain.
2026-08-11 22:40:36 +08:00
Chinesezjc
610dc74ea8 test(tools): fix error code assertions for collapsed call tests
The error code lives on ToolFailure.info.code, not ToolFailure.code.
2026-08-11 22:40:36 +08:00
Chinesezjc
6d0a7c12e1 test(tools): add coverage for collapsed model-direct call under code mode
Add two executor-level tests covering the previously uncovered branches
in createExecution:
- collapsed call (non-aborted signal) returns UNKNOWN_TOOL
- collapsed call (pre-aborted signal) returns ABORTED_BEFORE_DISPATCH
2026-08-11 22:40:36 +08:00
Chinesezjc
846969900a ci: retrigger 2026-08-11 22:40:36 +08:00
Chinesezjc
1e78513806 fix(tools): add collapses() method and fix createExecution collapse logic 2026-08-11 22:40:36 +08:00
Chinesezjc
24dd48b133 fix(tools): collapse code-mode executor to run_code for model-direct calls
wireSchemas() already advertised only run_code under mode: 'code', but the
executor resolved every call through get(), which returns the full visible
map plus the reserved transport. A model could name a native tool directly
and bypass run_code entirely. Route the execution-path lookups through a
new private resolveExecution() that applies the mode collapse at the
operation boundary: model-direct calls under 'code' may only name run_code
(UNKNOWN_TOOL otherwise), while SDK sub-dispatches (parent token set) keep
every visible tool. get()/schemas() public semantics are unchanged.

The denial happens at createExecution, before the extensible policy
pipeline — pre-execute listeners, approval ask, and guards never observe
a call that is deterministically denied. A collapsed call honors the
pre-dispatch cancellation contract, routes aborted results through the
visible tool's finalizeContent, and captures the finalizer before
argument materialization.

Regenerated docs, catalogs, graphs, scoped events, re-recorded
translation pairs, and updated test assertions.

Fixes #1815
2026-08-11 22:40:36 +08:00
Chinesezjc
2aef2d83fa fix(tools): remove tool:* prompt filtering per review feedback
LegGasai noted that filtering prompt sections by tool:* prefix is a poor
heuristic: it conflates section naming convention with presentation
semantics and would incorrectly drop tool:structured_output. The executor
collapse already enforces the boundary — a model-direct native call is
rejected as UNKNOWN_TOOL regardless of what the prompt says, so filtering
the prompt adds no security and only risks losing useful guidance.

The tool:read/tool:bash/etc sections describe capability usage patterns
that apply to both native and code presentations, and keeping them does
not reopen the native direct-call path because the executor blocks it.
2026-08-11 22:40:36 +08:00
Chinesezjc
b558afc373 fix(tools): use @deepseek-ai/cordis import in README type blocks 2026-08-11 22:40:20 +08:00
Chinesezjc
6f6defd64a fix(tools): collapse code-mode executor to run_code for model-direct calls
wireSchemas() already advertised only run_code under mode: 'code', but the
executor resolved every call through get(), which returns the full visible
map plus the reserved transport. A model could name a native tool directly
and bypass run_code entirely. Route the execution-path lookups through a
new private resolveExecution() that applies the mode collapse at the
operation boundary: model-direct calls under 'code' may only name run_code
(UNKNOWN_TOOL otherwise), while SDK sub-dispatches (parent token set) keep
every visible tool. get()/schemas() public semantics are unchanged.

The denial happens at createExecution, before the extensible policy
pipeline — pre-execute listeners, approval ask, and guards never observe
a call that is deterministically denied. A collapsed call honors the
pre-dispatch cancellation contract, routes aborted results through the
visible tool's finalizeContent, and captures the finalizer before
argument materialization.

Under code mode, a system-prompt/assemble listener filters out tool:*
guidance sections that told the model to call native tools directly.
The tools:sdk section and SDK types remain so programs can still use
all tools through run_code.

Regenerated docs, catalogs, graphs, scoped events, and re-recorded
translation pairs.

Fixes #1815
2026-08-11 22:40:20 +08:00
Chinesezjc
75a09efd51 fix(tools): use @deepseek-ai/cordis and @deepseek-ai/schemastery imports 2026-08-11 22:40:19 +08:00
Chinesezjc
4806fdabab fix(tools): collapse code-mode executor to run_code for model-direct calls
wireSchemas() already advertised only run_code under mode: 'code', but the
executor resolved every call through get(), which returns the full visible
map plus the reserved transport. A model could name a native tool directly
and bypass run_code entirely. Route the execution-path lookups through a
new private resolveExecution() that applies the mode collapse at the
operation boundary: model-direct calls under 'code' may only name run_code
(UNKNOWN_TOOL otherwise), while SDK sub-dispatches (parent token set) keep
every visible tool. get()/schemas() public semantics are unchanged.

The denial happens at createExecution, before the extensible policy
pipeline — pre-execute listeners, approval ask, and guards never observe
a call that is deterministically denied. A collapsed call honors the
pre-dispatch cancellation contract, routes aborted results through the
visible tool's finalizeContent, and captures the finalizer before
argument materialization.

Under code mode, a system-prompt/assemble listener filters out tool:*
guidance sections that told the model to call native tools directly.
The tools:sdk section and SDK types remain so programs can still use
all tools through run_code.

Fixes #1815
2026-08-11 22:40:19 +08:00
Tianyi Cui
564a853a04 Merge pull request #2277 from deepseek-harness/codex/background-first-continuable-subagents
feat(subagent): default continuable delegation to background
2026-08-11 22:21:02 +08:00
Yichen Jiang
925df04112 Merge pull request #2249 from deepseek-harness/worktree/minimal-profiles-bare-runtime
feat: align minimal runtime profiles
2026-08-11 21:57:03 +08:00
Tianyi Cui
cb235da37f Merge pull request #2282 from deepseek-harness/worktree/deny-deepseek-base-urls-519
fix(boot): deny DeepSeek endpoint env overrides
2026-08-11 21:55:26 +08:00
Dudu-0223
c778b5b0db fix(subagent): address background-first review 2026-08-11 21:52:59 +08:00
Dudu-0223
98d4551597 docs: refresh module graph 2026-08-11 21:52:59 +08:00
Dudu-0223
8344d64363 feat(subagent): default continuable delegation to background 2026-08-11 21:52:59 +08:00
Yichen Jiang
a5853244ed Merge remote-tracking branch 'origin/master' into worktree/minimal-profiles-bare-runtime 2026-08-11 21:45:38 +08:00
Yichen Jiang
d9dca88f33 test: stabilize steering mid-turn snapshot 2026-08-11 21:45:30 +08:00
Ziya
43b66c0a74 Merge pull request #2210 from deepseek-harness/feat/produced-files-folder
feat(web): make produced-file overflow discoverable
2026-08-11 21:45:13 +08:00
Ziya
37cdddd137 Merge branch 'master' into feat/produced-files-folder 2026-08-11 21:36:30 +08:00
Tianyi Cui
4c9c6c8217 test(cli): align endpoint fixture with boot trust 2026-08-11 21:33:06 +08:00
Yichen Jiang
3625ba1c9b Merge remote-tracking branch 'origin/master' into worktree/minimal-profiles-bare-runtime 2026-08-11 21:30:15 +08:00
Yichen Jiang
87c26ce78f Merge pull request #2275 from deepseek-harness/feat/wake-idle-owner-on-task-completion
feat(tasks): wake an idle owner when a background task completes
2026-08-11 21:29:55 +08:00
Tianyi Cui
a767cd357f Merge pull request #2280 from deepseek-harness/worktree/naming-contract-proposal
docs: propose repository naming contract and rename ledger
2026-08-11 21:28:54 +08:00
Yichen Jiang
1b2181dccd test: align Web minimal compaction assertion 2026-08-11 21:23:17 +08:00
Yichen Jiang
18c33b5fab Merge remote-tracking branch 'origin/master' into feat/wake-idle-owner-on-task-completion 2026-08-11 21:18:32 +08:00
ZiyaZhang
b1c1c93899 Merge remote-tracking branch 'upstream/master' into feat/produced-files-folder 2026-08-11 06:17:51 -07:00
Tianyi Cui
b735af91fa Merge remote-tracking branch 'origin/master' into worktree/naming-contract-proposal 2026-08-11 21:16:36 +08:00
Wenlu Wang
73a59bf60f Merge pull request #2272 from deepseek-harness/codex/fix-packed-install-pwsh-path
test: fix packed install closure and macOS path comparisons
2026-08-11 21:13:13 +08:00
Wenlu Wang
5b5ea127dd Merge pull request #2236 from deepseek-harness/codex/deepseek-user-id-header
feat(llm): send DeepSeek user identity header
2026-08-11 21:12:33 +08:00
Yichen Jiang
adfd54dc5c Merge branch 'master' into worktree/minimal-profiles-bare-runtime 2026-08-11 21:11:32 +08:00
Tianyi Cui
bf6800d972 Merge origin/master into naming contract proposal 2026-08-11 21:07:21 +08:00
Tianyi Cui
32454ba589 docs: address naming ledger review 2026-08-11 21:07:09 +08:00
Yichen Jiang
c1f1a169df Merge remote-tracking branch 'origin/master' into feat/wake-idle-owner-on-task-completion 2026-08-11 21:03:33 +08:00
kingwl
18527071c4 docs: refresh module graph 2026-08-11 21:01:37 +08:00
kingwl
93b0451ed5 feat(llm): send DeepSeek user identity header 2026-08-11 21:01:36 +08:00
ZiyaZhang
3545bbbaaf Merge remote-tracking branch 'upstream/master' into feat/produced-files-folder 2026-08-11 05:58:13 -07:00