Commit Graph
4589 Commits
Author SHA1 Message Date
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 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
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
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
Ziya 37cdddd137 Merge branch 'master' into feat/produced-files-folder 2026-08-11 21:36:30 +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 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
Yichen Jiang adfd54dc5c Merge branch 'master' into worktree/minimal-profiles-bare-runtime 2026-08-11 21:11:32 +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
ZiyaZhang 67a5b2ceca Merge upstream master into feat/produced-files-folder 2026-08-11 05:40:11 -07:00
Tianyi Cui 01033361c1 Merge branch 'worktree/schedule-explicit-at' into worktree/schedule-fixed-rate 2026-08-11 20:34:42 +08:00
Tianyi Cui 7583778fbd Merge branch 'worktree/schedule-conversational-after' into worktree/schedule-explicit-at
# Conflicts:
#	packages/client/runtime/README.i18n.yaml
#	packages/client/runtime/README.md
#	packages/client/runtime/README.zh.md
2026-08-11 20:34:34 +08:00
Tianyi Cui 9dc4af386d Merge branch 'master' into worktree/schedule-conversational-after 2026-08-11 20:31:49 +08:00
Yichen Jiang 75b26988dc fix(tasks): claim the teardown report before the producer cancel runs
A throwing producer cancel jumped to the force-fail branch before
`reported` was set, so `settle()` announced an unreported completion and
the default wakeup delivery started a model turn on an owner the host
was already destroying — the exact failure mode marking the record
reported exists to prevent.

Teardown claims the report before calling the producer, because that
decision does not depend on whether the producer's cancel succeeds.

Also reject a `maxConsecutiveWakes` that cannot bound anything: the
field exists to cap a runaway chain, and `Infinity` removed the cap
while a fraction never named a turn.

Correct the module JSDoc and the background-task runtime note, both of
which still promised that notices never wake an idle agent.
2026-08-11 20:29:08 +08:00
ZiyaZhang 693a093dfe Merge upstream master into feat/produced-files-folder 2026-08-11 05:22:59 -07:00
Yichen Jiang 4675914d74 Merge remote-tracking branch 'origin/master' into feat/wake-idle-owner-on-task-completion 2026-08-11 20:20:01 +08:00
Tianyi Cui d991327507 Merge branch 'worktree/schedule-explicit-at' into worktree/schedule-fixed-rate 2026-08-11 20:07:51 +08:00
Tianyi Cui 3e131befb5 Merge branch 'worktree/schedule-conversational-after' into worktree/schedule-explicit-at 2026-08-11 20:06:58 +08:00
Yichen Jiang f7efe2a3b3 Merge remote-tracking branch 'origin/master' into worktree/web-plugin-config 2026-08-11 20:03:23 +08:00
Tianyi Cui 466854a1d6 Merge remote-tracking branch 'origin/master' into worktree/schedule-conversational-after 2026-08-11 20:03:21 +08:00
Tianyi Cui ac9ba8ce28 Merge branch 'worktree/schedule-explicit-at' into worktree/schedule-fixed-rate 2026-08-11 20:00:32 +08:00
Yichen Jiang ac890a3e34 Merge remote-tracking branch 'origin/master' into feat/wake-idle-owner-on-task-completion 2026-08-11 19:58:06 +08:00
Tianyi Cui e4fdd4b1e9 Merge branch 'worktree/schedule-conversational-after' into worktree/schedule-explicit-at 2026-08-11 19:57:55 +08:00
Tianyi Cui 5f64b6815c Merge remote-tracking branch 'origin/master' into worktree/schedule-conversational-after
# Conflicts:
#	docs/event-producer-consumer.i18n.yaml
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
2026-08-11 19:54:39 +08:00
Yichen Jiang fb6fb1fa12 Merge origin/master into worktree/web-plugin-config, adapting to ctx.remote.$on
#2201 landed three moves this branch sits on top of. `bindSettingsScope` became
`ctx.settingsScope.bind` on the Settings surface, so the section injects that
service and the Remote face instead of importing a free function; the
`SettingsScope` types moved into the runtime contract module, which is where
this branch's `base`, `user`, and `unset` now live; and the client
`credentials/changed` event became the forwarded owner event
`credentials/updated`, which the web-search card subscribes to through
`ctx.remote.$on`.

The generated module graph crossed mermaid's 1000-edge render guard with this
branch's 14 new edges. The guard doubles again, exactly as it did at 500 — the
graph counts real package edges, and trimming them to fit a renderer default
would make the document lie about the dependency set.
2026-08-11 19:52:34 +08:00
creatixchu b9e6113af0 Merge remote-tracking branch 'origin/master' into worktree/multimodal-ui
# Conflicts:
#	docs/module-graph.i18n.yaml
#	docs/module-graph.md
#	docs/module-graph.zh.md
2026-08-11 19:44:01 +08:00
Tianyi Cui bfef1648aa Merge branch 'worktree/schedule-explicit-at' into worktree/schedule-fixed-rate 2026-08-11 19:43:34 +08:00
Yichen Jiang 786e884b1f Merge remote-tracking branch 'origin/master' into feat/wake-idle-owner-on-task-completion 2026-08-11 19:42:30 +08:00
Yichen Jiang eb360dbf71 Merge remote-tracking branch 'origin/master' into feat/wake-idle-owner-on-task-completion 2026-08-11 19:38:49 +08:00
Yichen Jiang d78b796a51 feat(tasks): wake an idle owner when a background task completes
Completion notices went through agent.inject(), which never reserves a
driver, so a task settling after its turn closed left the notice parked
until unrelated input woke the agent — while the same prompt told the
model not to poll for it.

An unreported completion now picks its lane from the owner's state: a
busy owner is injected as before, an idle owner is woken with
followup(). This adopts the delivery rule the subagent continuation
manager already ships. maxConsecutiveWakes bounds the self-exciting
chain and is reset by user-authored input; completionDelivery: quiet
restores the old lane for deterministic transcripts.

Teardown cancellation now claims the terminal report the way kill()
already does, so an owner being destroyed is never woken, and settle()
announces completion last so a reporter that opens a turn synchronously
sees a committed record.
2026-08-11 19:36:49 +08:00
Tianyi Cui 97fe09e2c2 Merge branch 'worktree/schedule-conversational-after' into worktree/schedule-explicit-at 2026-08-11 19:34:38 +08:00
Tianyi Cui 4e74c2e056 Merge remote-tracking branch 'origin/master' into worktree/schedule-conversational-after 2026-08-11 19:33:25 +08:00
creatixchu 6a95fdc424 Merge remote-tracking branch 'origin/master' into worktree/multimodal-ui 2026-08-11 19:29:53 +08:00
imccyu ffdf81b28d fix(ci): repair remote event coverage and catalogs 2026-08-11 19:25:42 +08:00
imccyu e0bbe42242 refactor(web): consume owner remote events directly 2026-08-11 19:25:42 +08:00
imccyu 01ecb43ebc docs: state the Host-face rule for the browser e2e and settle the follow-ups
apps/web/tests/README.md records why these e2e type-check in the Host aggregate
and why importing a Client package there pulls its project tree into the Host
build graph, with mirroring as the standing answer. The Agent Note drops the
directory-picker face split (assessed and declined) and the grep-level gate in
favour of that README.

docs: regenerate the catalogs and retarget the moved declarations

The forwarded-event change moved three owner packages' cordis `Events`
declarations and their branded types into client-safe `./types` modules, and
the settings-scope split moves the shell spec into ui-settings-general. Point
the type-equivalence manifest and the affected Agent Note at those homes,
register the new `remote/*` event scope and the `ctx.settingsScope` service in
the catalog partition, and re-run the generators.

`$on` joins the documented `TypeRTClientRemote` surface, and the two Agent Note
fences that quote a bare member signature are marked `ignore-check`: they are
declaration fragments, not compilable units.

refactor(client): make ui-settings the settings domain's base layer

The settings-namespace transport lived in client/runtime, where every feature
could value-import it because runtime is a platform module. It belongs to the
settings domain, but moving it into ui-settings as a shared function fails
twice: the client bundle purity gate forbids cross-plugin value imports, and
ui-settings reached ui-sidebar for its shell, so any feature depending on it
closed a cycle through ui-layout and ui-theme.

Both halves move. `ctx.settingsScope` is now a cordis service — the
collaboration shape the purity gate prescribes, and the service proxy binds
`this.ctx` to the caller, so a bound scope's disposer belongs to the calling
fiber. The shell ui-settings used to own (the `sidebar.settings` occupant, its
navigation, and the nav-row projection) moves to ui-settings-general, which
already owns the chrome and the General section. What stays in ui-settings is
what carries no `ui-*` dependency: the scope service and the canonical settings
slot types, `settings.general.item` included. That type was parked in the locale
package precisely because the declarer was unreachable without a cycle; every
registrant now depends on this base layer, so it comes home.

The scope CONTRACT stays in client/runtime: a feature service accepts a scope
through its own signature without depending on the surface that binds it.

The forwarded settings invalidation replaces the deleted client-side
`settings/changed` event, so the transport reads `ctx.remote.$on`. It reaches
`$on` through the gateway's Client half plus the allowlist's type-only subpath
rather than api-remotes' Client face: that face imports a Host-tsdown-generated
artifact, and this package is reachable from the Host build graph through its
callers.

refactor(client): reach the settings transport through ctx.settingsScope

Every feature that owns a preference row switches from value-importing a shared
binder to the settings domain's service, and declares the two injections that
binding needs: `settingsScope` for the transport and `remote` for the forwarded
invalidation it subscribes to on the caller's own context.

The rows stay with the features that own the preferences — Language with locale,
Appearance with ui-theme, Composer Enter with ui-conversation. Only their route
to the transport changes, so no settings surface moves and no feature gains a
dependency on the shell.

The `settings.general.item` slot type now arrives from ui-settings, the base
layer every registrant already depends on, which retires the re-export outlet
ui-theme kept and the parked declaration in the locale package.

client/runtime drops its settings-form and schemastery dependencies with the
transport that used them.

test(client): bind the settings transport in the specs that boot a preference row

Every bench that activates a plugin owning a preference row now supplies the two
services that plugin injects: the forwarded-event port and the scope service.
Specs that exercise no settings path get the minimal doubles; the ones that do
drive their refresh chains through `remote/host-event`, the same signal
client/runtime republishes from a forwarded frame, replacing the deleted
client-side `settings/changed` event.

Also fixes a publication defect the built-invariant gate catches once it runs:
api-remotes' invariant companion shared the allowlist module with the package
index, so rolldown hoisted it into a third chunk beside the two bundled entries
— a file the mechanically derived publication list does not carry, leaving an
installed companion unable to import it. The companion now reads the allowlist
through this package's own published `./types` subpath, which the bundle keeps
external, so each entry stays self-contained.

The dynamic-subscription cast in apiproxy is gone: after the vendored cordis
rescope, `on` accepts the rest-parameter handler directly, and the allowlist's
shape assertion still carries the safety argument.

fix(client): carry the settings-scope move across the release manifests

Rebasing onto the publishable release set replaced every manifest's dependency
block, so the packages this change touches restate their additions in the
workspace-protocol form: the base layer's own transport dependencies, and the
`ui-settings` plus `remote` edges each preference-row owner now needs.

ui-settings-general takes clsx with the shell it received, and client/runtime
drops the settings-form and schemastery dependencies that left with the
transport.

fix(api-gateway): give each $on subscription its own registration and containment

Two defects in the forwarded-event subscription table, both raised in review:

A set keyed on listener identity stored one entry when two callers subscribed the
same function object to the same event, so the first frame reached it once instead
of twice and either disposer silenced the surviving registration. Subscriptions are
now records addressed by registration, which is what "the disposer belongs to the
calling fiber" requires.

A listener declared void may still be `async`, and the synchronous `try/catch`
could not see its rejection: the promise was dropped and surfaced as an unhandled
rejection outside the documented containment. Delivery now attaches a rejection
handler when a listener returns a promise, so both failure modes are logged and
isolated alike.

Delivery also iterates a snapshot, so a listener that subscribes or disposes during
a frame no longer changes who receives that frame, and production matches the
TestRemote double instead of relying on live Set iteration order.

Both fixes are pinned by tests that fail against the previous implementation. The
double gains its own spec for the `$mount` refusal and the unsubscribed-name drop —
per-file coverage reaches it — plus a note that it propagates a throwing listener
where production contains one, so no spec mistakes it for the containment guarantee.

Three prose corrections: `assertJsonArgs` states where its throw actually surfaces
(the emitter's listener containment, not load or emit time), the browser e2e README
names every standing Client import rather than claiming one exception, and two
comments and a test title state the forwarded event instead of the deleted
client-side one.

refactor(remote): deliver forwarded frames through ctx.remote.$dispatch

The carrier used to relay each decoded frame over an internal
`remote/host-event` cordis event so the delivery port could stay off the Remote
contract. The relay was the wrong shape twice over: it put a client-face event
into a scan whose subject is the Host vocabulary, forcing a walk exemption for
something that is not a Host event at all, and it made a direct handoff between
two Client plugins look like a broadcast any plugin participates in.

`TypeRTClientRemote` now carries both roles of one surface — consumers subscribe
with `$on`, and whoever owns the Host frame sink hands frames over with
`$dispatch` — so client/runtime calls the Remote service directly and the event
declaration is gone. A cordis service method is the collaboration shape the
client bundle purity gate prescribes, and it needs no relay to satisfy it.

The trade is that the handoff is now developer-visible: any plugin holding
`ctx.remote` can synthesize a forwarded event. That is the exposure the relay
already had — `ctx.emit` was equally reachable — stated in the contract instead
of hidden behind a private subscriber.

runtime reaches `ctx.remote` through the gateway's Client face rather than
api-remotes': that face imports a Host-tsdown-generated artifact, and this
project sits in the Host build graph.

refactor(api-remotes): keep the allowlist value out of types.ts

`src/types.ts` carries only types by package convention, but it held the
forwarded-event array, so the type-only subpath published runtime code. The
array moves to `src/remote-events.ts` and `types.ts` derives its projection from
it; both compiler faces list both files, so the Host forwarding loop and the
consumer key face still read one declaration and the package's exports are
unchanged.

The invariant companion returns to an empty installer. Its dispatch-shape check
was the only reason the companion imported the allowlist, which made the two
bundled entries share a module: rolldown hoisted it into a third chunk that the
mechanically derived publication list does not carry, so an installed companion
could not import it. Dropping the check retires that coupling along with the
subpath-import and bundle-external workarounds it needed, and the shape the
check enforced at runtime is the part the Host face's `TypeRTForwardableEvent`
assertion already refuses at compile time.

test(ui-task): bind the locale plugin's new injections in its bench

The bench boots the real locale plugin, which now injects the settings-scope
service and the forwarded-event port, so it stayed pending and left `ctx.locale`
undefined. Supplies both doubles like the other benches that boot a plugin
owning a preference row.

docs: close the documentation gates for the forwarded-event surface

Regenerates the two graph catalogs and re-records every bilingual pair this
branch edited. Several pairs needed real work beyond the record:

- The generators write only the English side, so the Chinese sides of
  `event-producer-consumer` and `module-graph` had drifted: the former still
  listed the three deleted client-face events and pointed at declaration sites
  this branch moved into `types.ts` modules, and the latter carried a stale
  dependency graph.
- `TypeRTClientRemote`'s documented declaration gains `$dispatch` on both sides.
- The pairing contract requires both sides to link the same target, so the
  apiproxy README and the design note now link the English note from both
  languages, and the note's code blocks are byte-identical across the pair
  (a translated comment inside a fence counts as divergence).
- `apps/web/tests/README.md` gains its Chinese counterpart; the browser e2e lane
  documents a discipline reviewers apply, so it belongs in the bilingual corpus
  rather than in the pairing exemption list.
- Four fences in the design note are marked `ignore-check`: each quotes a member
  signature, a union arm, or a snippet that names symbols it does not import, so
  none is a compilable unit.

docs(agent-note): transition the forwarded-event note to implemented

The design shipped in this PR, so the pair moves into `implemented/` and takes
that folder's skeleton: `## Proposal` becomes a present-tense `## Decision`,
and `## Acceptance criteria` plus `## Risks` fold into `## Verification` (what
pins the behavior) and `## Consequences` (what the shipped shape costs).

Facts that moved after the proposal are corrected rather than preserved: the
allowlist value now lives in `remote-events.ts` beside a type-only `types.ts`,
the delivery port is `$dispatch` rather than an internal cordis event, and the
invariant companion is an explained empty installer. `Verification` states the
two `$on` defects the review found — independent registration identity and
async-rejection containment — since those are now the properties tests pin.

Supersession is partial, so five active notes stay active and gain a
cross-link each: `web-config-plane`, `web-client-session-scope`,
`config-plane-boundaries`, `versioned-gui-welcome-onboarding`, and
`permission-default-for-new-sessions` each described a frame this change
replaced. Only the mechanism sentence is annotated; every conclusion those
notes own is untouched, and `host/models-changed` remains apiproxy's own
derived frame in all of them.

Also pins the disposer's idempotence: calling one `$on` disposer twice must not
splice a surviving twin registration out from under its owner.

fix: docs

fix: test
2026-08-11 19:25:41 +08:00
imccyu b64da061a8 docs: record the forwarded-event surface and its face boundaries
Each owner package's README states which of its cordis events are forwarded and
that the declaration now lives in the client-safe ./types export. api/remotes
documents the allowlist as the single control point and the deliberate
both-faces listing of src/types.ts; development.md keeps the split-tsconfig rule
current.
2026-08-11 19:25:40 +08:00
Yichen Jiang d73ffc272d Merge pull request #2118 from deepseek-harness/worktree/docs-homepage-copy
Refine documentation homepage positioning
2026-08-11 19:25:19 +08:00
Tianyi Cui 7028df46e4 Merge worktree/schedule-explicit-at into worktree/schedule-fixed-rate 2026-08-11 19:23:20 +08:00
ZiyaZhang a8092699b1 fix(ci): refresh pairing after master merge 2026-08-11 04:23:13 -07:00
creatixchu 3beb138b3f Merge remote-tracking branch 'origin/master' into worktree/multimodal-ui 2026-08-11 19:23:04 +08:00
Tianyi Cui 035f3e5a65 Merge worktree/schedule-conversational-after into worktree/schedule-explicit-at 2026-08-11 19:20:38 +08:00
Tianyi Cui 32a9a0ac61 Merge remote-tracking branch 'origin/master' into worktree/schedule-conversational-after 2026-08-11 19:10:26 +08:00
Ziya ef565fe7f4 Merge branch 'master' into feat/produced-files-folder 2026-08-11 19:10:11 +08:00