Merge branch 'master' into worktree-process-service-seam

This commit is contained in:
Tianyi Cui
2026-07-27 01:47:49 +08:00
committed by GitHub
68 changed files with 1987 additions and 156 deletions

View File

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
tools.md: 875bea18ff0c34ca97f9c144f4320d3b3a6aaa4a
tools.zh.md: 11f0b8d4a0f29304e6fdbde7c81be981bd940a2d
tools.md: 250e869397f8ecb128d5b644ff7506376d0657c6
tools.zh.md: 96fc9d3eeda0240e195beb11bea088d5606d4757

View File

@@ -231,6 +231,34 @@ type ToolExecutionMode =
| { kind: 'exclusive' }
```
Code Mode's bridge additionally exposes each settled sub-dispatch to the `tools/code-dispatch-log` waterfall, which may reshape the durable event's copy of the content (the program's value and the model contract are untouched):
```ts type-equiv
/**
* One settled `run_code` sub-dispatch about to be logged, as seen by the
* `tools/code-dispatch-log` waterfall: the parent execution (session owner,
* outer call identity), the sub-call identity, and the outcome whose durable
* copy a listener may reshape. `content` is the RENDERED result projection
* (what a native `tool/result` would carry) — the program itself received
* the structured `value` (or just the error message on failure); only the
* `tool/code-dispatch` event's copy changes.
*/
interface CodeDispatchLog {
/** The outer `run_code` execution. */
readonly exec: ToolExecution
/** The calling agent (the scope routing key and the spill owner), when the outer call has one. */
readonly agent?: Agent
/** Deterministic sub-call id (`<parent>:code:<n>`). */
readonly subCallId: CallId
/** The dispatched sub-tool name. */
readonly name: string
/** Whether the sub-call settled as an error. */
readonly isError: boolean
/** The sub-call's complete model-facing content (the settle event's default payload). */
readonly content: ContentBlock[]
}
```
```ts type-equiv
/**
* One pending tool call inside the registry pipeline. Parsed arguments cross

View File

@@ -231,6 +231,34 @@ type ToolExecutionMode =
| { kind: 'exclusive' }
```
Code Mode 的桥接层还会把每个已结算的子分派暴露给 `tools/code-dispatch-log` waterfall该 waterfall 可以改写持久事件所存的内容副本(程序取得的值与模型契约均不受影响):
```ts type-equiv
/**
* One settled `run_code` sub-dispatch about to be logged, as seen by the
* `tools/code-dispatch-log` waterfall: the parent execution (session owner,
* outer call identity), the sub-call identity, and the outcome whose durable
* copy a listener may reshape. `content` is the RENDERED result projection
* (what a native `tool/result` would carry) — the program itself received
* the structured `value` (or just the error message on failure); only the
* `tool/code-dispatch` event's copy changes.
*/
interface CodeDispatchLog {
/** The outer `run_code` execution. */
readonly exec: ToolExecution
/** The calling agent (the scope routing key and the spill owner), when the outer call has one. */
readonly agent?: Agent
/** Deterministic sub-call id (`<parent>:code:<n>`). */
readonly subCallId: CallId
/** The dispatched sub-tool name. */
readonly name: string
/** Whether the sub-call settled as an error. */
readonly isError: boolean
/** The sub-call's complete model-facing content (the settle event's default payload). */
readonly content: ContentBlock[]
}
```
```ts type-equiv
/**
* One pending tool call inside the registry pipeline. Parsed arguments cross