fix(system-prompt): 保留 section API 的增量系统指令 (#6941)

* feat(system-prompt): admit section updates incrementally

* docs(system-prompt): accept retirement restart gap

* test(system-prompt): cover retirement and reentry before admission

* test(system-prompt): align rebase fixtures and persistence history

* fix: align section prompt consumers and CI fixtures

* test: pin credentials for section snapshot fixtures

* test: align remaining snapshots with section admission

* test: preserve section metadata in Web and PowerShell replays

* refactor(system-prompt): retire sections through Cordis cleanup

* chore: refresh section admission history after rebase

* fix(system-prompt): advance admission head after compaction

* fix(system-prompt): trim sections before admission hashing

* docs: move system upgrade guides to current version

* docs: add system message contribution cookbook

* perf(system-prompt): avoid indexing history for admission

* refactor(system-prompt): derive admission from logged sections

* test(system-prompt): update lifecycle and compaction consumers

* test(system-prompt): refresh CLI section event expectations

* test(system-prompt): refresh question composer section metadata

* feat(system-prompt): resolve same-name sections by scope

* refactor(persona): use ordinary section registrations

* refactor(system-prompt): clarify assembly and related control flow

* test(system-prompt): reconcile rebased section snapshots

* test(python): use current system text helper after rebase

* test(system-prompt): refresh CLI expected section blocks

* test(system-prompt): reconcile latest master integration

* test(agent-loop): seed tools before deferred addition assertion

* refactor(compaction): replace system heads when compacting prefixes

* refactor(system-prompt): separate source text and notice attribution

* fix(system-prompt): preserve legacy instructions in compaction snapshots

* refactor(compaction): build system snapshots while reading the summary prefix

* refactor(compaction): rebuild current system instructions

* refactor(system-prompt): defer compaction rebuild to admission

* refactor(system-prompt): remove redundant fixtures and setup

* fix(plan-mode): announce committed user transitions

* docs(system-prompt): reconcile section lifecycle and compaction design

* refactor(system-prompt): consolidate projection version increments

* fix(system-prompt): reconcile master integration and replay fixtures

* docs(system-prompt): align upgrade guide with current release

* refactor(system-prompt): make admission operations explicit

* fix(system-prompt): reconcile master API and release changes

* docs(system-prompt): regenerate catalogs after master refresh

* refactor(llm-pi-ai): delegate text rendering to pi-ai

* fix(llm-pi-ai): preserve blank lines between system text parts

* refactor(system-prompt): remove redundant retirement metadata

* refactor(system-prompt): own admission and use canonical surface targets

* refactor(system-prompt): compare captured sections at commitment

Assembly fixes section text and lifecycle; PromptAssembly.systemUpdates() compares them with the committed projection when the loop commits. This replaces SystemPrompt.admit(), needsRebuild() and isCurrent(), the SystemAdmission export, the loop's reassembly after compaction, and SessionSurface.systemHeadResetSeq. The projection records a pending rebuild as a boolean that an attributed reset clears.

After a compaction inside a step, the rebuilt head uses the sections captured for that step; later source changes arrive as ordinary updates at the next step.

* test: await the session read fixture and type a matcher for lint

* test(tool-executor-ptc): describe same-name section override on executor replacement

Duplicate section names no longer reject a scoped executor; the earlier registration is overridden and returns as an ordinary update when the executor leaves.

* docs(upgrade-guide): move system-prompt integrations to v0.2.2-rc.3

The root version on master is 0.2.2-rc.3; verify-upgrade-guides rejects a guide added under an earlier version directory.

* refactor(system-prompt): rebuild over system messages without sections

A system message without source.sections now marks rebuilding pending, like a compaction summary. The next model attempt replaces the head with current sections and clears later system messages. This removes the separate legacy flag and its appended whole-prompt replacement and notice.

Sessions written by earlier releases, migrated logs, and imported DeepSeek conversations take the same path, so the importer and its tests return to their master versions.

* test(web): refresh the imported-conversation recording and drop a stray bytecode file

The Web recording for a resumed DeepSeek import was recorded while the prompt was appended after the imported history; the head is replaced again, as on master. The .pyc under the macOS signing skill was staged by accident in an earlier merge.

* refactor(session): scan system nodes on read

surface.systemNodes is read only when a system rebuild is written. Scanning the current surface nodes on each read restores the surface fold's plan types and state to their master definitions, which no longer carry the system message.

* refactor(session): rename SystemSurfaceNode.hasContent to isEmpty

The flag reports that the logged content array has no blocks. isEmpty matches the documented "empty head" wording and covers a head that was written empty without ever being cleared.

* refactor(llm): join system text through extractTextContent

extractTextContent gains a trim option that trims each text block and omits blocks left empty. The DeepSeek serializer, the pi-ai converter, and the prompt inspector use it with a blank-line separator in place of three hand-written joins.

The pi-ai converter now trims system and developer text like the other two, so whitespace-only blocks are omitted there as well.

* test(snapshots): refresh the PowerShell and cordis-inspect recordings

The two PowerShell scenarios still held the initial system message as one unattributed block; replay now writes one block per section with its attribution. The cordis-inspect-jsdoc recording embeds the API catalog, which names SystemSurfaceNode.isEmpty since the rename.

* test(plan-mode,harness-dev-context): cover a rejected pre-step and a repeated legacy prompt

A rejected pre-step must leave a queued plan-mode switch pending and unannounced until the next accepted step. A second unattributed system message with the same legacy paragraphs must keep the admitted paragraphs.

* test(web): refresh Web recordings for section-attributed system messages

Twenty-seven Web recordings still held the initial system message as one unattributed block. Replay now writes one text block per section with its attribution; twenty-six recordings differ only in that line.

plan-review also records the plan-mode switch notice before the first prompt and appends a plan:status update on exit in place of a head replacement and a series header, so its expanded golden gains the notice row.

The Creator persona test joins the system text blocks with blank lines, as the adapters do, before matching the persona line.

* refactor(system-prompt): require the retry argument of systemUpdates

The agent loop passes it on every attempt. A custom loop that omitted it on a retry received a full comparison in place of the pending rebuild, with no diagnostic; the type now makes each caller state which attempt it is.

* docs(upgrade-guide): move the system prompt integrations guide to v0.2.2-rc.5

The root version is 0.2.2-rc.5 after the master merge, and verify-upgrade-guides rejects a guide added under an earlier version directory.

* test(web): refresh the mention path presence recording for section-attributed system messages

* test: align two specs that master left failing

The DeepSeek settings spec waited for a saved notice carrying the provider label from before the rename to DeepSeek API. The Windows packaging workflow spec seeded one of the two helpers that the Stage workflow helpers step copies.

* chore: remove a Python cache file committed by mistake
This commit is contained in:
涂轶翔 authored and GitHub committed 2026-11-19 21:11:38 +08:00
1 parent 0a37a1b89a
commit 101f26de4e
861 files changed
+10705 -7169

No files matched your search

@@ -4,34 +4,22 @@
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-09-02-system-prompt-as-surface-node.md
/agent-note-the-system-prompt-is-surface-node-0:
en: 449b745953058cff
zh: 4db99c7d1f06e6b9
zh: f2ae7c4c4920cfdd
/agent-note-the-system-prompt-is-surface-node-0/problem:
en: 9ff2541082426e31
zh: d8f0ca49d3548f9b
en: 99c28399e0d722dd
zh: df17045e6b8c5346
/agent-note-the-system-prompt-is-surface-node-0/decision:
en: 3911ea80c5466d5e
zh: a0d6844e6f8af462
/agent-note-the-system-prompt-is-surface-node-0/decision/the-event:
en: 35302b956efc4999
zh: e45ee0d001b63269
/agent-note-the-system-prompt-is-surface-node-0/decision/the-operations:
en: a217a08932938062
zh: 4924d99d55d9c973
/agent-note-the-system-prompt-is-surface-node-0/decision/ownership-in-the-loop:
en: a7d0d3a61d2fef04
zh: 29a3d5dbed2f987a
/agent-note-the-system-prompt-is-surface-node-0/decision/consumers:
en: 39f9f4acffcccdc6
zh: 36b23a57e7d28950
/agent-note-the-system-prompt-is-surface-node-0/decision/v2-to-v3-structural-conversion:
en: 131ae882d0a28735
zh: ea4bc81f0ba5ddec
en: 3d3e8cfd46453ff7
zh: e95f6aefc8bf45c7
/agent-note-the-system-prompt-is-surface-node-0/decision/released-conversion:
en: 1cab1035e35837e5
zh: b9aec3cf8f1c92ae
/agent-note-the-system-prompt-is-surface-node-0/alternatives-considered:
en: 067e96734ebbce89
zh: 9f79bc0f4942675d
en: 376b3546528fd792
zh: f0af870e99b65a86
/agent-note-the-system-prompt-is-surface-node-0/consequences:
en: bccea8236b4c32b3
zh: a1150784718a6639
/agent-note-the-system-prompt-is-surface-node-0/testing:
en: 9a5a241ae3d0c676
zh: 8f3e83cc54604bcc
en: 78cc06bfa9e2f842
zh: a2a865b9954f5854
/agent-note-the-system-prompt-is-surface-node-0/verification:
en: 66c74f395cf84b51
zh: ec4ff0b9b35e27ed
@@ -6,89 +6,40 @@ English | [中文](2026-09-02-system-prompt-as-surface-node.zh.md)
## Problem
A system prompt held outside the surface has a different durable representation from every other message the model reads. Conversation messages are surface events (`user/message`, `assistant/message`, `tool/result`) folded in seq order by `Session.deriveMessages()`; a prompt stored as a `system` field of the log-only `request/header` snapshot has to be prepended by each serializer as wire message 0. The [reconstructable-requests Agent Note](2026-07-05-reconstructable-requests.md) made both halves durable, but that layout leaves one model-visible fact with two homes: the surface owns the messages, the header owns the message in front of them.
That split forces every reader of "what did the model see" to join two sources: the compaction summarizer copies the header prompt in front of the region's derived messages, `dsh-token-meter` estimates the system prompt from the header while pricing every other message from the surface, and the Web request-prompt card, the trajectory view, and the snapshot normalizer's `{{system}}` placeholder each read the header on their own. Change detection is split the same way: a `headerEquals` that compares `system` byte-for-byte beside `config` and `tools` makes a prompt change and a tool change indistinguishable in the log (`request/header` reason `change`) even though they are different operations on the conversation.
The split also blocks the next step. A model that accepts a mid-conversation `system` message as a prompt replacement needs the harness to append a system-role message to history; with the prompt living in the header there is no surface representation to append, and the header would have to be frozen by special case. The [in-history replacement decision](../feature/2026-09-02-in-history-system-prompt-replacement.md) depends on this note.
Keeping the system prompt in a log-only request header gives model-visible messages two durable homes. Serializers, compaction, token accounting and request inspection must prepend header text to conversation history independently. Comparing that text alongside configuration and tools also makes instruction changes indistinguishable from request-setting changes. A header cannot represent instructions introduced later in the conversation.
## Decision
The system prompt lives on the surface. It is an ordinary surface event, `system/message`, and every prompt lifecycle operation is one of the two existing `SurfaceOp` variants applied to that event type. The wire request is unchanged: the surface fold yields the message list the serializers send, with the system message first.
System instructions are ordinary `system/message` surface events. The first accepted request reserves a protected system head, including when its content is empty. Empty system content remains addressable in the log and surface but projects to no model message. Later updates can occupy their own conversation positions. [Section admission](2026-10-21-section-based-system-updates.md) owns current attribution and incremental updates; [deferred compaction rebuilding](2026-11-09-deferred-system-compaction.md) owns consolidation. The earlier whole-prompt replacement rule is superseded, while this single durable representation remains.
### The event
The surface fold supplies logged system messages to adapters alongside the rest of the conversation. Adapters choose native messages or their protocol representation without changing durable roles. `EpochHeader` holds configuration, adapter defaults and tools, not system text; prompt changes therefore have their own event identity rather than a header `change` reason. Header reasons still describe initial, resumed, changed or new-series requests.
`system/message` is a member of `SurfaceEventType` beside `user/message`, `assistant/message`, and `tool/result` (`packages/core/session/src/types.ts`). Its payload mirrors `tool/result`: `{ turn, step, message }`, where `message` is a `SystemMessage` with `role: 'system'`, one text block holding the rendered prompt, and source `{ kind: 'plugin', plugin: '@deepseek-ai/dsh-system-prompt' }`. Empty `content` records "no system prompt": the node keeps its surface position and `deriveEventMessage` projects it to `null`, so it contributes no wire message. A non-empty node projects verbatim, so `deriveMessages()` returns the system message at its surface position and the DeepSeek serializers, which pass a `role: 'system'` history message through unchanged, emit it as wire message 0. `EpochHeader` is `{ config, adapterDefaults?, tools? }`; `canonicalHeader` and `headerEquals` in `packages/core/session/src/request-header.ts` compare config, adapter defaults, and tools only.
`assertSystemHeadRewrite` rejects a replacement covering node 0 when it is a system message unless another system message replaces exactly that node. Later system nodes remain replaceable by compaction. Protecting even an empty head gives rebuilding a stable target without inserting a node ahead of existing history. Per-node replacements preserve intervening conversation and use the existing replacement-generation accounting.
### The operations
The loop commits prepared instructions inside an open step, after request middleware and route preparation, before new user input and the model call. Rejection or cancellation before commitment admits neither instructions nor users. System-prompt assembly prepares candidates; the loop owns their durable append or replacement. Runtime context remains an independent user-role contribution. Both become model-visible through logged messages rather than adapter-local state.
| Situation | Surface operation |
|---|---|
| No `system/message` survives on the surface (including an empty rendered prompt) | append `system/message`; on the session's first step it is surface node 0, before the first `user/message` of the step |
| A `system/message` survives and the rendered prompt differs from its text (including a prompt that becomes empty) | replace exactly that node: `surfaceOp: { op: 'replace', startSeq: <seq of the node>, endSeq: <same> }`, `sourceEventSeqs: [<seq of the node>]`; an empty prompt produces an empty-content node that projects to no message |
| The rendered prompt equals the surviving node's text | no operation |
Token usage anchors to the priced surface immediately before the successful assistant event. Step start is too early: system and user admission, or retry recovery, can still change the request afterward. Embedded provider output is priced separately so assistant rewrites retain their signed delta; the open step retains lifecycle coordinates rather than another node snapshot.
When the initial rendered prompt is empty, the loop reserves an empty system head before the initial admitted user messages so a prompt that first becomes non-empty later still replaces node 0. Omitting that empty node would append the later prompt behind user history, where pi-ai converts it to a user message rather than its `systemPrompt`. Replacing node 0 is a head rewrite expressed on the surface: the provider prefix changes from the first token, the log records the shadowed node through `sourceEventSeqs`, and `replaceGeneration` advances as it does for a compaction replacement. The loop's `startsSeries` detection (`requestSurfaceGeneration !== surfaceGeneration`) therefore covers the prompt change without a `system` comparison in `headerEquals`. `request/header` keeps reasons `initial`, `resume`, `change`, and `series`; `change` means config or tools changed, and the unchanged header that follows a prompt replacement logs as `series`.
### Released conversion
`packages/core/session/src/surface.ts` enforces the head invariant in `assertSystemHeadRewrite`: a replacement whose range covers surface node 0 while node 0 is a `system/message` is rejected unless the replacing event is itself a `system/message` covering exactly that node. System nodes at later positions carry no such protection; a compaction range may shadow them.
### Ownership in the loop
`dsh-agent-loop` owns `SystemPromptProjection` beside `RuntimeContextProjection` in `packages/core/agent-loop/src/runtime-context.ts`. It reads the surviving `system/message` nodes from the current surface on every projection, so a compaction or replacement that ran earlier in the same step is already reflected. `project(rendered, { inHistory, startsSeries })` returns `{ message, intent }` — `intent` is `{ surfaceOp: 'append' }` when no system node survives or when the [in-history rule](../feature/2026-09-02-in-history-system-prompt-replacement.md) applies, otherwise a replacement of exactly the latest surviving system node — or `undefined` when the latest node already holds the rendered text.
In `packages/core/agent-loop/src/agent.ts`, `preStep` renders the prompt with `renderPrompt(assembly)` and projects it after the `agent/pre-step` waterfall, so a compaction provider's replacement inside that waterfall is visible to the decision; `turn()` commits the `system/message` immediately after `step/start` and before the step's `user/message` events, so log order is wire order. `buildRequest` sets no `system` on the request: the request is `header.config`, `session.deriveMessages()` (system message first), and `header.tools`. The loop step order is: claim inbox → `systemPrompt.assemble()` → project runtime context → `agent/pre-step` waterfall → project system prompt → `step/start` → commit `system/message` (when changed) → commit `user/message`s → `agent/request` waterfall → `request/header` → `request/context` → stream.
`dsh-token-meter` anchors usage to the priced surface immediately before the successful `assistant/message`, not to `step/start`. The loop admits the system prompt and user messages after step start, and retry recovery can replace nodes before rebuilding the request. Capturing that current surface includes every admitted input once; the embedded provider output remains separately priced so durable assistant rewrites retain their signed delta. The open step stores only turn and step for lifecycle validation, not a second node snapshot.
### Consumers
| Consumer | Reads |
|---|---|
| DeepSeek serializers (`serializeRequest`, `serializeRequestWithImages`) | `options.messages`, passing the `role: 'system'` history message through as wire message 0; `GenerateOptions.system` remains for direct one-shot callers such as title providers |
| `dsh-llm-pi-ai` | a leading system history message maps to pi-ai's `systemPrompt` |
| `compaction-basic` `buildSummarizationInput` | node 0's derived message prepended to the region in `SummarizationInput.messages`, with no separate `system` field; an empty-content head projects to no message while staying protected from compaction |
| `compaction-basic` `selectCompactableRange` | anchors at the first non-system node; node 0 is never inside a compaction range |
| `dsh-token-meter` | the system node is priced as a surface node under the `systemTokens` breakdown |
| Web request-prompt card, trajectory request node, request inspection | the `system/message` node; a replaced node 0 is shown as a prompt change and an appended in-history node as a prompt update, each in a collapsed inspectable card, never a chat bubble |
| Snapshot normalizer `{{system}}` placeholder, plan-mode tests | the system node's text |
| TypeScript and Python SDK expected outputs | include the `system/message` event |
| Human transcript projections | skip `system/message`; it is model history, not conversation |
`RuntimeContextProjection` and `SystemPromptProjection` both hand the loop an uncommitted message that `turn()` commits. They differ in how they observe the surface and in their operation set: runtime context follows `session/event` for its owned user-role snapshots and appends only, while the system prompt scans the current surface for system nodes on each projection because its decision depends on how many survive, and it appends or replaces per the route.
### V2-to-V3 structural conversion
The [V2-to-V3 specification](../../../../packages/session/session-format-v2-to-v3/README.md#system-head) owns system-head conversion and message identities; its [reference rules](../../../../packages/session/session-format-v2-to-v3/README.md#sequence-references) and [source refusal](../../../../packages/session/session-format-v2-to-v3/README.md#source-audit) define preservation and unsupported inputs. The migrated layout is semantically equivalent to native requests, not byte-identical to a native recording. A valid V2 source can lack an order-preserving conversion under the current step invariant; refusing it is preferable to moving history or relaxing ownership. Historical acceptance coordinates must not become acknowledgements of the transformed log.
The [released-format policy](2026-08-31-released-session-format-migrations.md) preserves each released conversion’s semantics; an existing target-format generation does not rerun its incoming edge. Projection-cache versions are independent of Session format versions.
The [canonical-envelope specification](../../../../packages/session/session-format-v2-to-v3/README.md#canonical-envelopes) defines composition with the structural conversion; the [canonical-envelope decision](2026-09-06-v3-canonical-session-envelopes.md) owns the strict-acceptance rationale.
The [V2-to-V3 specification](../../../../packages/session/session-format-v2-to-v3/README.md#system-head) owns structural conversion, message identities, reference preservation and refusal of unsupported sources. Migrated requests are semantically equivalent, not byte-identical to native recordings. When conversion cannot preserve historical order under the step invariant, refusal is preferable to moving messages or relaxing ownership. Historical acceptance coordinates do not acknowledge transformed logs. [Released-format rules](2026-08-31-released-session-format-migrations.md) preserve each conversion's semantics; an existing target generation does not rerun its incoming edge, and projection-cache versions are independent. [Canonical envelopes](2026-09-06-v3-canonical-session-envelopes.md) retain their separate strict-acceptance rationale.
## Alternatives considered
**Keep `header.system` and add `system/message` only for updates.** Two homes for one fact: every consumer above would read the header for message 0 and the surface for later messages, and the loop would need a special case that ignores `system` in `headerEquals` while a surface system node exists. Rejected because the point of the change is one representation.
**Keep `header.system` for the initial prompt and use events only for updates.** Every consumer would still need two sources, and header comparison would need a special exception while a system node exists.
**A dedicated log-only `system-prompt/change` event that rewrites the header.** Preserves the header as the home of the prompt and records changes as their own event kind, but still cannot express a system message inside history, so the in-history proposal would need a second mechanism anyway. Rejected.
**A log-only change event that rewrites the header.** This distinguishes changes but still cannot place a system message inside history; later updates would need another mechanism.
**Synthesize the system message inside the adapter from consecutive headers.** The adapter is stateless per request and never sees the log; a wire history that depends on adapter state is not reconstructable from the surface fold. Rejected.
**Synthesize instructions from consecutive headers in an adapter.** Adapters are stateless per request and do not see the log. Adapter-local reconstruction cannot make the durable message fold authoritative.
**Express the prompt as a `user/message` snapshot like runtime context.** Reuses an existing event type but sends the wrong role, so a model that treats a system message as authoritative would not. Rejected.
**Use a user-role snapshot like runtime context.** This sends a different role and loses native system authority on models that support it.
## Consequences
- One representation: every reader of "what did the model see" folds the surface; no consumer joins the header to the message list. `EpochHeader` has no `system` field, so a reader that expects one fails at compile time.
- A prompt change and a tool or config change are distinguishable in the log: the former is a `system/message` replacement of node 0 followed by a `series` header, the latter a `request/header` with reason `change`.
- Compaction carries an invariant: node 0 is never compacted. The `dsh-session` surface manager enforces it in the replace operation itself, so a compaction provider other than `compaction-basic` cannot shadow the prompt by anchoring at `surfaceNodes[0]`. Later system nodes are unprotected by design.
- `replaceGeneration` advances for a prompt replacement as well as for compaction; a reader that needs to distinguish them inspects the replacement event's type.
- A mid-history system node has a surface representation, which is what the [in-history replacement decision](../feature/2026-09-02-in-history-system-prompt-replacement.md) builds on.
- An initially empty prompt occupies the protected head without contributing a wire message; in replacement mode, a later non-empty prompt replaces it and remains the leading system message.
- Recorded snapshot fixtures carry the `system/message` event instead of a header `system` field. The snapshot normalizer tokenizes that event's text to `{{system}}`, the prompt sidecar is harvested from the `system/message` sequence (one section per prompt version, declared as `header.promptChanges`), and `request/header` pins compare config and tools only.
Request inspection, compaction, accounting, SDK events and recorded-session prompt sidecars read the same logged system messages. Human transcript projections omit them because they are model instructions rather than conversational speech. Replacing a system node changes the request prefix and replacement generation; appending a section can preserve its preceding prefix. No header-to-message join is required.
## Testing
The initial head cannot be compacted by any provider, even when empty; later system additions can be removed. Initial emptiness does not require later instructions to move to the head during ordinary admission. Current section and compaction decisions determine their placement.
- `packages/compaction/compaction-basic/tests/compaction-loop-repro.spec.ts` pins zero post-call surface delta with provider usage through initial, growing, shrinking, and empty prompts, same-step retry replacement, request middleware, and fresh replay.
- `packages/core/session/tests/surface.spec.ts` (`system/message surface node` block) pins the leading system-role projection, the empty-content `null` projection, `assertSystemHeadRewrite`'s acceptance and rejection paths, the unprotected later system nodes, and the rejection of a seeded `system/message` with a non-system role or non-plugin source.
- `packages/core/agent-loop/tests/system-prompt-projection.spec.ts` pins the append on first render (including empty), the later non-empty prompt at the derived head in replacement mode, the no-op on an unchanged prompt, the replacement of the latest surviving node on change, the tail append after a replacement shadowed a non-head system node, and the in-history append and re-baseline rules.
- `packages/core/agent-loop/tests/request-reconstruction.spec.ts` (`a system-prompt change replaces surface node 0 and starts a new series under the same header`) pins the `series` header that follows a prompt replacement.
- `packages/llm/llm-deepseek/tests/serialize.spec.ts` (`serializes a leading system message byte-for-byte like the same prompt passed as options.system`) pins wire identity. `packages/llm/llm-pi-ai/tests/context.spec.ts` compares both system sources on text and image paths. `packages/compaction/compaction-basic/tests/compaction-basic.spec.ts` pins the derived prefix, routed tools, absent separate `system` option, and protected non-empty or empty head through the region transaction and default summarizer.
- The recorded snapshots under `snapshots/` pin the model-visible wire request of every shipped profile; a recorded session that renders a prompt carries the `system/message` event at surface node 0 in its `session.jsonl`, and a session with a mid-session prompt change carries the replacement of node 0 or, on an in-history route, the appended node.
## Verification
Session surface tests cover protected-head rewrites, empty projection, ordinary later-node replacement and persisted system-message validation. Adapter tests cover system-block rendering on text and image paths. Compaction tests retain the leading derived prompt and reject ranges covering the protected head. Request reconstruction and both SDK expected outputs verify that model-visible instructions are logged. Token-meter tests cover admission and retry changes before usage anchoring; recorded-session snapshots cover shipped profile requests and prompt sidecars.
@@ -1,94 +1,45 @@
# Agent Note: 系统提示词是 surface 的第 0 号节点
# Agent Note: 系统提示词是表面节点 0
Status: implemented
[English](2026-09-02-system-prompt-as-surface-node.md) | 中文
## Problem
## 问题
放在 surface 之外的系统提示词,其持久化表示与模型读到的其他所有消息都不同。对话消息是 surface 事件(`user/message`、`assistant/message`、`tool/result`),由 `Session.deriveMessages()` 按 seq 顺序折叠;而存放在仅记日志的 `request/header` 快照 `system` 字段中的提示词,必须由每个序列化器前置为协议消息 0。[可重建请求 Agent Note](2026-07-05-reconstructable-requests.zh.md) 让两半都成为持久数据,但这种布局让一个模型可见的事实拥有两个归属:surface 拥有消息,header 拥有排在这些消息之前的那条消息。
将系统提示词放在仅日志可见的请求头中,会为模型可见消息建立两个持久来源。序列化、压缩、token 计量和请求检查都必须独立地把请求头文本加到对话历史之前。将该文本与配置和工具一起比较,还会让指令变化与请求设置变化无法区分。请求头不能表示在对话后续才引入的指令。
这种拆分迫使每个想知道「模型看到了什么」的读取方都要合并两个来源:压缩(compaction)摘要器把 header 中的提示词复制到区域派生消息之前,`dsh-token-meter` 从 header 估算系统提示词却从 surface 为其他每条消息计价,Web 请求提示词卡片、轨迹视图和快照归一化器的 `{{system}}` 占位符各自单独读取 header。变更检测同样被拆开:在 `config` 和 `tools` 旁边逐字节比较 `system` 的 `headerEquals`,让提示词变更与工具变更在日志中无法区分(`request/header` 的 reason 都是 `change`),尽管它们是对对话的两种不同操作。
## 决策
这种拆分还阻塞了下一步。一个把对话中途的 `system` 消息当作提示词替换来接受的模型,需要 harness 向历史追加一条 system 角色消息;当提示词住在 header 里时,没有可追加的 surface 表示,header 也只能靠特例被冻结。[历史内替换决定](../feature/2026-09-02-in-history-system-prompt-replacement.zh.md) 依赖本 Agent Note。
系统指令是普通的 `system/message` 表面事件。首次接受的请求保留一个受保护的系统头节点,包括内容为空的情况。空系统内容在日志和表面中保持可寻址,但不投影为模型消息。后续更新可占据自己的对话位置。[分段准入](2026-10-21-section-based-system-updates.zh.md)负责当前归属和增量更新;[压缩后的延迟重建](2026-11-09-deferred-system-compaction.zh.md)负责合并。此前的整份提示词替换规则已被取代,但这份统一的持久表示保持不变。
## Decision
表面折叠将日志中的系统消息与其余对话一起提供给适配器。适配器选择原生消息或对应协议表示,不改变持久角色。`EpochHeader` 保存配置、适配器默认值和工具,不保存系统文本;因此提示词变化具有独立的事件标识,而非请求头的 `change` 原因。请求头原因仍描述初始、恢复、变化或新序列请求。
系统提示词住在 surface 上。它是一个普通的 surface 事件 `system/message`,提示词生命周期中的每个操作都是对该事件类型施加现有两种 `SurfaceOp` 变体之一。协议请求不变:surface 折叠产出的就是序列化器发送的消息列表,系统消息在最前面。
当节点 0 是系统消息时,`assertSystemHeadRewrite` 拒绝覆盖它的替换,除非另一条系统消息恰好替换该节点。后续系统节点仍可由压缩替换。连空头节点也受保护,为重建提供了稳定目标,无需在既有历史前插入节点。逐节点替换保留中间对话,并沿用现有替换代次计量。
### 事件
循环在开放步骤内提交准备好的指令,时机在请求中间件和路由准备之后、新用户输入和模型调用之前。提交前的拒绝或取消不会准入指令或用户消息。系统提示词组装准备候选;循环负责其持久追加或替换。运行时上下文仍是独立的用户角色贡献。两者都通过日志消息对模型可见,而非适配器本地状态。
`system/message` 是 `SurfaceEventType` 的成员,与 `user/message`、`assistant/message`、`tool/result` 并列(`packages/core/session/src/types.ts`)。它的载荷与 `tool/result` 对称:`{ turn, step, message }`,其中 `message` 是 `role: 'system'` 的 `SystemMessage`,一个文本块承载渲染后的提示词,source 为 `{ kind: 'plugin', plugin: '@deepseek-ai/dsh-system-prompt' }`。空的 `content` 记录「没有系统提示词」:该节点保持其 surface 位置,`deriveEventMessage` 把它投影为 `null`,因此不贡献任何协议消息。非空节点逐字投影,因此 `deriveMessages()` 在其 surface 位置返回系统消息,而原样透传 `role: 'system'` 历史消息的 DeepSeek 序列化器把它作为协议消息 0 发出。`EpochHeader` 是 `{ config, adapterDefaults?, tools? }`;`packages/core/session/src/request-header.ts` 中的 `canonicalHeader` 与 `headerEquals` 只比较 config、适配器默认值和工具。
Token 用量锚定成功 assistant 事件前的已计价表面。步骤开始过早:系统与用户准入或重试恢复随后仍可改变请求。内嵌的提供方输出单独计价,因此 assistant 重写保留带符号增量;开放步骤只保留生命周期坐标,不再保存另一份节点快照。
### 操作
### 已发布转换
| 情形 | surface 操作 |
|---|---|
| surface 上没有存活的 `system/message`(包括渲染后的提示词为空时) | 追加 `system/message`;在会话的首个步骤中它是 surface 第 0 号节点,位于该步骤首条 `user/message` 之前 |
| 有存活的 `system/message` 且渲染后的提示词与其文本不同(包括提示词变为空) | 恰好替换该节点:`surfaceOp: { op: 'replace', startSeq: <该节点的 seq>, endSeq: <同一值> }`,`sourceEventSeqs: [<该节点的 seq>]`;空提示词产生一个投影为无消息的空内容节点 |
| 渲染后的提示词与存活节点的文本相同 | 无操作 |
[V2 到 V3 规范](../../../../packages/session/session-format-v2-to-v3/README.zh.md#system-head)负责结构转换、消息标识、引用保留及不支持来源的拒绝。迁移请求与原生记录语义等价,但并非字节相同。转换若无法在步骤约束下保留历史顺序,拒绝优于移动消息或放宽所有权。历史接受坐标不构成对转换后日志的确认。[已发布格式规则](2026-08-31-released-session-format-migrations.zh.md)保留每次转换的语义;已有目标代次不会重跑其传入转换边,投影缓存版本也独立于格式版本。[规范信封](2026-09-06-v3-canonical-session-envelopes.zh.md)保留其独立的严格接受依据。
当初始渲染的提示词为空时,循环在初始接纳的用户消息之前预留空系统头部,使稍后首次变为非空的提示词仍替换第 0 号节点。省略该空节点会让后来的提示词追加在用户历史之后,pi-ai 会将其转换为用户消息,而不是 `systemPrompt`。替换第 0 号节点是头部重写在 surface 上的表达:提供方前缀从第一个 token 起改变,日志通过 `sourceEventSeqs` 记录被遮蔽的节点,`replaceGeneration` 与压缩替换时一样推进。因此循环的 `startsSeries` 检测(`requestSurfaceGeneration !== surfaceGeneration`)无需在 `headerEquals` 中比较 `system` 即可覆盖提示词变更。`request/header` 保留 `initial`、`resume`、`change`、`series` 四种 reason;`change` 表示 config 或 tools 变更,提示词替换之后跟随的未变 header 记为 `series`。
## 考虑过的替代方案
`packages/core/session/src/surface.ts` 在 `assertSystemHeadRewrite` 中强制头部不变量:当第 0 号节点是 `system/message` 时,范围覆盖第 0 号节点的替换会被拒绝,除非替换事件本身是恰好覆盖该节点的 `system/message`。位于更后位置的系统节点没有此类保护;压缩范围可以遮蔽它们。
**保留 `header.system` 表示初始提示词,仅用事件表示更新。** 每个消费者仍需读取两个来源,而系统节点存在时,请求头比较需要特殊例外。
### 循环中的归属
**仅日志可见的变化事件重写请求头。** 这能区分变化,却仍不能将系统消息置于历史中;后续更新还需要另一套机制。
`dsh-agent-loop` 在 `packages/core/agent-loop/src/runtime-context.ts` 中与 `RuntimeContextProjection` 并列拥有 `SystemPromptProjection`。它在每次投影时从当前 surface 读取存活的 `system/message` 节点,因此同一步骤中更早运行的压缩或替换已经反映在内。`project(rendered, { inHistory, startsSeries })` 返回 `{ message, intent }`——没有系统节点存活或[历史内规则](../feature/2026-09-02-in-history-system-prompt-replacement.zh.md)适用时 `intent` 为 `{ surfaceOp: 'append' }`,否则是对最新存活系统节点的精确替换——最新节点已持有渲染文本时返回 `undefined`。
**在适配器中从连续请求头合成指令。** 适配器对每次请求无状态,也不读取日志。适配器本地重建无法让持久消息折叠成为权威来源。
在 `packages/core/agent-loop/src/agent.ts` 中,`preStep` 用 `renderPrompt(assembly)` 渲染提示词,并在 `agent/pre-step` waterfall 之后投影它,因此压缩提供者在该 waterfall 内做出的替换对决定可见;`turn()` 紧接在 `step/start` 之后、该步骤的 `user/message` 事件之前提交 `system/message`,因此日志顺序即协议顺序。`buildRequest` 不在请求上设置 `system`:请求由 `header.config`、`session.deriveMessages()`(系统消息在先)和 `header.tools` 构成。循环步骤顺序为:领取收件箱 → `systemPrompt.assemble()` → 投影运行时上下文 → `agent/pre-step` waterfall → 投影系统提示词 → `step/start` → 提交 `system/message`(有变化时) → 提交各条 `user/message` → `agent/request` waterfall → `request/header` → `request/context` → 流式请求。
**像运行时上下文一样使用用户角色快照。** 这发送了不同角色,并在支持系统角色的模型上丢失原生系统权限。
`dsh-token-meter` 把用量锚定到成功的 `assistant/message` 之前的已计价 surface,而不是 `step/start`。循环在步骤开始之后接纳系统提示词与用户消息,重试恢复还可能在重建请求之前替换节点。捕获当前 surface 会让每个已接纳输入恰好计入一次;内嵌的提供方输出仍单独计价,因此持久 assistant 改写保留其带符号增量。开放步骤只保存 turn 与 step 以验证生命周期,不保存第二份节点快照。
## 影响
### 消费方
请求检查、压缩、计量、SDK 事件和已记录 Session 的提示词侧文件读取同一批日志系统消息。面向人的 transcript(文本记录)投影省略它们,因为它们是模型指令而非对话发言。替换系统节点改变请求前缀和替换代次;追加段则可能保留此前前缀。无需将请求头与消息列表合并。
| 消费方 | 读取内容 |
|---|---|
| DeepSeek 序列化器(`serializeRequest`、`serializeRequestWithImages`) | `options.messages`,把 `role: 'system'` 的历史消息作为协议消息 0 透传;`GenerateOptions.system` 为标题提供方等直接单次调用方保留 |
| `dsh-llm-pi-ai` | 开头的 system 历史消息映射为 pi-ai 的 `systemPrompt` |
| `compaction-basic` 的 `buildSummarizationInput` | 第 0 号节点的派生消息前置于 `SummarizationInput.messages` 中的区域消息,无单独的 `system` 字段;空内容头节点不投影为消息,但仍受保护而不能被压缩 |
| `compaction-basic` 的 `selectCompactableRange` | 锚定在首个非系统节点;第 0 号节点永不落入压缩范围 |
| `dsh-token-meter` | 系统节点作为 surface 节点计价,归入 `systemTokens` 明细 |
| Web 请求提示词卡片、轨迹请求节点、请求检视 | `system/message` 节点;被替换的第 0 号节点显示为提示词变更,追加的历史内节点显示为提示词更新,各自以折叠可检视的卡片呈现,永不作为聊天气泡 |
| 快照归一化器的 `{{system}}` 占位符、plan-mode 测试 | 系统节点的文本 |
| TypeScript 与 Python SDK 预期输出 | 包含 `system/message` 事件 |
| 人类 transcript(文本记录)投影 | 跳过 `system/message`;它是模型历史,不是对话 |
任何提供方都不能压缩初始头节点,即使它为空;后续系统新增内容可以移除。初始为空并不要求普通准入将后来的指令移至头部。当前分段与压缩决策负责确定其位置。
`RuntimeContextProjection` 与 `SystemPromptProjection` 都把一条未提交的消息交给循环由 `turn()` 提交。两者在观察 surface 的方式与操作集上不同:运行时上下文跟随 `session/event` 观察自己拥有的 user 角色快照且只做追加,而系统提示词在每次投影时扫描当前 surface 上的系统节点,因为它的决定取决于有多少节点存活,并按路由追加或替换。
## 验证
### V2-to-V3 结构转换
[V2 到 V3 规范](../../../../packages/session/session-format-v2-to-v3/README.zh.md#system-head)负责系统头节点转换与消息身份;其[引用规则](../../../../packages/session/session-format-v2-to-v3/README.zh.md#sequence-references)和[源拒绝](../../../../packages/session/session-format-v2-to-v3/README.zh.md#source-audit)定义保留内容与不支持的输入。迁移布局与原生请求语义等价,而非与原生录制逐字节相同。有效 V2 源在当前步骤不变量下可能没有保持顺序的转换方式;拒绝它优于移动历史或放宽归属。历史接收坐标不得变为对转换后日志的确认。
[已发布格式策略](2026-08-31-released-session-format-migrations.zh.md)保留每条已发布转换的语义;已有目标格式代际不会重跑其入边。投影缓存版本独立于 Session 格式版本。
[规范信封规范](../../../../packages/session/session-format-v2-to-v3/README.zh.md#canonical-envelopes)定义与结构转换的组合;[规范信封决策](2026-09-06-v3-canonical-session-envelopes.zh.md)负责严格准入的依据。
## Alternatives considered
**保留 `header.system`,只为更新添加 `system/message`。** 一个事实两个归属:上述每个消费方都要从 header 读消息 0、从 surface 读后续消息,循环还需要一个在 surface 存在系统节点时让 `headerEquals` 忽略 `system` 的特例。被否决,因为本次变更的目的就是单一表示。
**用专门的仅记日志事件 `system-prompt/change` 重写 header。** 保留 header 作为提示词归属,并把变更记录为独立事件种类,但仍无法表达历史内部的系统消息,历史内替换提案还是需要第二套机制。被否决。
**在适配器内根据相邻 header 合成系统消息。** 适配器逐请求无状态且从不接触日志;依赖适配器状态的协议历史无法从 surface 折叠重建。被否决。
**像运行时上下文那样用 `user/message` 快照表达提示词。** 复用了现有事件类型,却发送了错误的角色,因此把系统消息视为权威的模型不会这样对待它。被否决。
## Consequences
- 单一表示:每个想知道「模型看到了什么」的读取方都折叠 surface;没有消费方需要把 header 与消息列表合并。`EpochHeader` 没有 `system` 字段,因此期望该字段的读取方在编译期失败。
- 提示词变更与工具或 config 变更在日志中可以区分:前者是对第 0 号节点的 `system/message` 替换加随后的 `series` header,后者是 reason 为 `change` 的 `request/header`。
- 压缩带有一条不变量:第 0 号节点永不被压缩。`dsh-session` 的 surface 管理器在替换操作本身中强制它,因此除 `compaction-basic` 以外的压缩提供方无法通过锚定在 `surfaceNodes[0]` 来遮蔽提示词。更后位置的系统节点按设计不受保护。
- `replaceGeneration` 在提示词替换时和压缩时一样推进;需要区分两者的读取方检查替换事件的类型。
- 历史中途的系统节点拥有 surface 表示,这正是[历史内替换决定](../feature/2026-09-02-in-history-system-prompt-replacement.zh.md)所依赖的基础。
- 初始空提示词占据受保护的头部,但不贡献协议消息;在替换模式下,后来的非空提示词替换它,并保持为开头的系统消息。
- 录制的快照 fixture 携带 `system/message` 事件而非 header 的 `system` 字段。快照归一化器把该事件的文本标记化为 `{{system}}`,提示词伴随文件从 `system/message` 序列采集(每个提示词版本一节,以 `header.promptChanges` 声明),`request/header` 的 pin 只比较 config 与 tools。
## Testing
- `packages/compaction/compaction-basic/tests/compaction-loop-repro.spec.ts` 钉住提供方用量下调用后的表面增量为零,覆盖初始、增长、缩短与空提示词、同一步骤中的重试替换、请求中间件和全新回放。
- `packages/core/session/tests/surface.spec.ts`(`system/message surface node` 块)钉住开头 system 角色的投影、空内容的 `null` 投影、`assertSystemHeadRewrite` 的接受与拒绝路径、更后位置系统节点不受保护,以及对 seed 中非 system 角色或非插件 source 的 `system/message` 的拒绝。
- `packages/core/agent-loop/tests/system-prompt-projection.spec.ts` 钉住首次渲染时的追加(包括空提示词)、替换模式下后来非空提示词位于派生历史头部、提示词未变时的无操作、变更时对最新存活节点的替换、替换遮蔽了非头部系统节点之后的尾部追加,以及历史内追加与重新基线规则。
- `packages/core/agent-loop/tests/request-reconstruction.spec.ts`(`a system-prompt change replaces surface node 0 and starts a new series under the same header`)钉住提示词替换之后跟随的 `series` header。
- `packages/llm/llm-deepseek/tests/serialize.spec.ts`(`serializes a leading system message byte-for-byte like the same prompt passed as options.system`)钉住协议一致性。 `packages/llm/llm-pi-ai/tests/context.spec.ts` 在文本与图片路径上比较两种系统提示词来源。`packages/compaction/compaction-basic/tests/compaction-basic.spec.ts` 通过区域事务与默认摘要器钉住派生前缀、已路由工具、不携带单独 `system` 选项,以及非空或空头节点的保护。
- `snapshots/` 下的录制快照钉住每个随发 profile 的模型可见协议请求;渲染了提示词的录制会话在其 `session.jsonl` 中于 surface 第 0 号节点携带 `system/message` 事件,会话中途发生提示词变更的会话则携带对第 0 号节点的替换,或在历史内路由上携带追加的节点。
Session 表面测试覆盖受保护头节点重写、空投影、普通后续节点替换及持久化系统消息校验。适配器测试覆盖文本和图像路径的系统块渲染。压缩测试保留开头的派生提示词,并拒绝覆盖受保护头节点的范围。请求重建和两种 SDK 的预期输出验证模型可见指令写入日志。Token 计量测试覆盖用量锚定前的准入及重试变化;已记录 Session 快照覆盖发行配置的请求和提示词侧文件。
@@ -9,11 +9,11 @@
en: 7cbbdfbe7da9ae7a
zh: 50368b272d7b5ebc
/agent-note-context-breakdown-retains-only-system-prompts/decision:
en: 52d5c42112c5c6dc
zh: 744dbbcc52193300
en: be9e134d8f8f285d
zh: 6909e180e9813d87
/agent-note-context-breakdown-retains-only-system-prompts/verification:
en: 68a7375ca7fe99e8
zh: e3c7d108740e8952
en: 7ae86e3d60b000ab
zh: ad465a17b5ff3532
/agent-note-context-breakdown-retains-only-system-prompts/alternatives-considered:
en: 2bd0e83c5298da2b
zh: 336259b6985eb7b5
@@ -10,18 +10,20 @@ English | [中文](2026-10-13-context-breakdown-system-prompt-state.zh.md)
## Decision
[`breakdown-projection.ts`](../../../../packages/llm/token-meter/src/breakdown-projection.ts) retains the surviving `system/message` nodes in surface order with their heuristic prices, one running surface total, and at most one armed shadow-price claim. State version 6 discards version-5 rows; other projection keys keep their rows.
All retained system messages contribute to system-token accounting under [section-based updates](2026-10-21-section-based-system-updates.md). This note owns the compact retained-state choice independently of that additive classification.
[`breakdown-projection.ts`](../../../../packages/llm/token-meter/src/breakdown-projection.ts) retains surviving `system/message` nodes in surface order with their heuristic prices, one running surface total, and at most one armed shadow-price claim. Its state version invalidates checkpoints whose recovery or accounting semantics differ; other projection keys keep their rows.
- An append adds its price; a `system/message` append also joins the end of the system list.
- `compaction/summary` and `compaction/prune` arm a claim from `shadowedRange`, `shadowedTokenCount`, and the retained system prompts named by `shadowedSeqs`. The next event consumes or expires it. A replacement over the claimed range subtracts the claim price and drops those prompts; a replacement naming another range, or putting a `system/message` in place of a metered range, throws.
- An unmetered replacement of one retained system prompt subtracts that prompt's own price. A `system/message` replacement keeps its position; any other replacement removes it.
- Any other unmetered replacement folds at zero delta, the rule `contextPressure` already applies.
`systemTokens` is the last retained prompt with a positive price, and `messageTokens` is the surface total minus it; both are floored at zero. `shadowedSeqs` is the authoritative set of shadowed nodes, so membership decides which prompts leave without locating non-system endpoints in surface order.
`systemTokens` sums all retained system-message prices; `messageTokens` is the surface total minus that sum, floored at zero. `shadowedSeqs` is the authoritative set of shadowed nodes, so membership decides which prompts leave without locating non-system endpoints in surface order.
## Verification
Folding all 836 stored logs with the version-5 and version-6 definitions produced identical breakdowns after every event. The logs held 2,206 metered replacements, 106 system-prompt rewrites, and no other replacement. Retained state fell from 7.13 MB to 110 KB, with at most five surviving system prompts in one Session.
The original state-size reduction was checked by folding 836 stored logs with the version-5 and version-6 definitions, producing identical breakdowns after every event. Those logs held 2,206 metered replacements, 106 system-prompt rewrites, and no other replacement. Retained state fell from 7.13 MB to 110 KB, with at most five surviving system prompts in one Session. This historical comparison predates additive system-token classification; current tests cover that classification, replacements, replay and checkpoint invalidation.
## Alternatives considered
@@ -10,18 +10,20 @@ Status: implemented
## Decision
[`breakdown-projection.ts`](../../../../packages/llm/token-meter/src/breakdown-projection.ts) 按 surface 顺序保留存活的 `system/message` 节点及其启发式价格、一个 surface 运行总量,以及至多一个已武装的影子价 claim。状态版本 6 丢弃版本 5 的行;其他 projection key 保留各自的行。
[按段更新](2026-10-21-section-based-system-updates.zh.md)将全部保留系统消息计入系统 token。本记录独立于该增量分类,负责紧凑保留状态的选择。
[`breakdown-projection.ts`](../../../../packages/llm/token-meter/src/breakdown-projection.ts) 按表面顺序保留存活的 `system/message` 节点及其启发式价格、一个表面运行总量,以及至多一个待使用的影子价格声明。其状态版本使恢复或计量语义不同的检查点失效;其他投影键保留各自的行。
- 追加加上其价格;`system/message` 追加还会加入系统列表末尾。
- `compaction/summary` 和 `compaction/prune` 依据 `shadowedRange`、`shadowedTokenCount` 以及 `shadowedSeqs` 中列出的已保留系统提示词武装 claim。下一个事件消费或使其失效。覆盖所 claim 范围的替换减去 claim 价格并移除这些提示词;指向其他范围的替换,或以 `system/message` 取代已计量范围的替换,会抛出错误。
- 对单个已保留系统提示词的未计量替换减去该提示词自身的价格。`system/message` 替换保持其位置;其他替换将其移除。
- 其他未计量替换以零增量折叠,这与 `contextPressure` 已采用的规则相同。
`systemTokens` 是最后一个价格为正的保留提示词,`messageTokens` 是 surface 总量减去它;两者都不低于零。`shadowedSeqs` 是被遮蔽节点的权威集合,因此由成员关系决定哪些提示词离开,无需在 surface 顺序中定位非系统端点。
`systemTokens` 汇总全部保留系统消息的价格;`messageTokens` 是表面总量减去该和,下限为零。`shadowedSeqs` 是被遮蔽节点的权威集合,因此由成员关系决定哪些提示词离开,无需在表面顺序中定位非系统端点。
## Verification
用版本 5 和版本 6 的定义折叠全部 836 份已存日志,每个事件之后的构成数字都完全相同。这些日志包含 2,206 次已计量替换、106 次系统提示词改写,没有其他替换。保留状态从 7.13 MB 降到 110 KB,单个 Session 最多有五个存活的系统提示词。
最初的状态缩减验证使用版本 5 和版本 6 定义折叠 836 份已存日志,每个事件后的构成数字都相同。这些日志包含 2,206 次已计量替换、106 次系统提示词重写,没有其他替换。保留状态从 7.13 MB 降到 110 KB,单个 Session 最多有五个存活系统提示词。这项历史比较早于系统 token 的累加分类;当前测试覆盖该分类、替换、重放及检查点失效。
## Alternatives considered
@@ -9,8 +9,8 @@
en: 5247278483ca4e7a
zh: ca711671a43fae76
/agent-note-pi-ai-system-reminder-fallback/decision:
en: 604eb72704c73328
zh: 6661d1065f65ecf9
en: 05a991557d47c067
zh: ee73398e62c92b61
/agent-note-pi-ai-system-reminder-fallback/alternatives-considered:
en: 0e2aaf897587ebb0
zh: 0a7f9a9cb7ddffaf
@@ -10,9 +10,11 @@ Pi-ai concatenates later system messages into the initial prompt for models with
## Decision
The pi-ai adapter uses the prepared model's existing `supportsMidConvoSystemMessages` capability mapping. It preserves native system messages on capable models and converts each non-empty later system message into a user message wrapped in `<system-reminder>` otherwise, before pi-ai receives the context. Leading system text remains in the initial prompt. Message order, repeated updates, and existing text-block concatenation remain intact. Durable messages retain their original roles.
[Section-based updates](2026-10-21-section-based-system-updates.md) admit instruction deltas independently of native system-message support. This note owns their adapter representation on pi-ai routes.
The fallback belongs to the adapter because it depends on the selected protocol capability. Prompt admission remains owned by the agent loop, which consolidates system-prompt updates on routes without native support; this fallback only handles later system messages present in the supplied request.
The pi-ai adapter uses the prepared model's existing `supportsMidConvoSystemMessages` capability mapping. It preserves native system messages on capable models and converts each non-empty later system message into a user message wrapped in `<system-reminder>` otherwise, before pi-ai receives the context. Leading system messages remain in the initial prompt. System text blocks are trimmed and separated by blank lines. Message order and repeated updates remain intact, and durable messages retain their original roles.
The fallback belongs to the adapter because it depends on the selected protocol capability. The system service captures source deltas and the loop commits them; neither consolidates instructions solely because the route lacks native support.
## Alternatives considered
@@ -10,9 +10,11 @@ Status: implemented
## 决策
pi-ai 适配器使用已准备模型的现有 `supportsMidConvoSystemMessages` 能力映射。对于具备该能力的模型,适配器保留原生系统消息;否则,在 pi-ai 接收上下文之前,将每条非空的后续系统消息转换为以 `<system-reminder>` 包裹的用户消息。开头的系统文本仍位于初始提示词中。消息顺序、重复更新和现有文本块拼接方式均保持不变。持久消息保留原始角色。
[按段更新](2026-10-21-section-based-system-updates.zh.md)独立于原生系统消息支持来准入指令增量。本记录负责它们在 pi-ai 路由上的适配器表示。
回退由适配器负责,因为它取决于所选协议的能力。提示词纳入仍由 Agent loop 负责,它在不支持原生更新的路由上合并系统提示词更新;此回退仅处理传入请求中已有的后续系统消息。
pi-ai 适配器使用已准备模型的现有 `supportsMidConvoSystemMessages` 能力映射。对于具备该能力的模型,适配器保留原生系统消息;否则,在 pi-ai 接收上下文之前,将每条非空的后续系统消息转换为以 `<system-reminder>` 包裹的用户消息。开头的系统消息仍位于初始提示词中。系统文本块去除首尾空白,并以空行分隔。消息顺序和重复更新保持不变,持久消息保留原始角色。
回退由适配器负责,因为它取决于所选协议能力。系统服务捕获来源增量,循环提交它们;两者都不会仅因路由缺乏原生支持而合并指令。
## 考虑过的替代方案
@@ -0,0 +1,25 @@
# Bilingual-pair consistency record for 2026-10-21-section-based-system-updates.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-10-21-section-based-system-updates.md
/agent-note-section-based-system-updates:
en: 782bf68313d80f8c
zh: 269fe6df917ba8d1
/agent-note-section-based-system-updates/problem:
en: a83ea0b9159b4413
zh: b99c7aa991a2bfbc
/agent-note-section-based-system-updates/decision:
en: e68f889b2f53accd
zh: b2a91efdea6a3d62
/agent-note-section-based-system-updates/decision/registration-and-retirement:
en: a731f245615075cb
zh: 4381fbd0c3c083ac
/agent-note-section-based-system-updates/decision/canonical-records-and-fixed-assembly:
en: 8c44de7fbc3610cd
zh: fd2eab0252d96eaa
/agent-note-section-based-system-updates/alternatives-considered:
en: 1367dc65863691b0
zh: ffdd4888ee03a1b1
/agent-note-section-based-system-updates/consequences:
en: f95aa7065a87e9d7
zh: e57d2d7be50bdcac
@@ -0,0 +1,61 @@
# Agent Note: Section-based system updates
Status: implemented
English | [中文](2026-10-21-section-based-system-updates.zh.md)
## Problem
Whole-prompt updates repeat unchanged instructions whenever one contributor changes. Separate contributor state, retirement queues and provisional admission records duplicate lifecycle and commitment facts, while process-local comparison loses resume and fork history. Scope overrides must change effective instructions without retiring a logical source that still has a live owner.
## Decision
`section()` is the sole source registration API. A name identifies logical instructions; ordinary `system/message` events record their canonical text, order and state. The per-Session projection of those events is the committed authority. Runtime definitions remain shared because deployment and preset plugins can register before Sessions exist. The Session supplies its own committed state and callback context.
### Registration and retirement
Each Cordis effect owns one registration. Assembly chooses the nearest visible scope, then the latest live registration in that scope. The selected definition supplies text, order, replacement wording and complete mode; only its text provider is evaluated. Removing a hidden owner cannot remove its override. Removing an override reveals an inherited definition as an ordinary update. Persona prefix and suffix use these same registrations: prefix text and complete mode inherit together, while suffix inherits independently, including for subagents.
Retirement requires both no live registration in the visible chain and committed text for that name in the Session. Each Session retains the definitions it observed; the last disposed observed registration supplies its literal retirement wording, or the service supplies a notice naming the source. Neither explicit disposal nor plugin teardown evaluates a disposed provider. One Session completing retirement cannot erase another Session's notice. Committed retirement removes the source from the projection, so later reintroduction is an ordinary introduction.
Disposal records lifecycle state rather than another contribution. Off/on cycles before assembly send nothing when effective text and order are unchanged. A source never committed needs no retirement; inactive references can be released once that Session no longer has committed text. Independent instructions that need separate retirement use different names.
### Canonical records and fixed assembly
Assembly captures source values and lifecycle state before asynchronous presentation middleware. Its final normalized presentation fixes the sections; the loop obtains their updates at commitment, where they are compared with the committed projection. Text is interpolated and trimmed before direct comparison; numeric order and name determine ordering, and order-only changes are logged. Canonical text and each notice occupy separate trimmed text blocks. Adapters own separators, so whitespace added for serialization is not a source contribution.
`source.sections` attributes canonical blocks and notices without parsing their prose. Active records have `contentIndex`, including an empty string; retired records omit it. Optional `noticeIndex` lists replacement or retirement blocks without classifying notice kinds. Indexes refer to the containing message and cannot overlap or repeat. Whole-prompt supersession notices remain unattributed because they concern several sources. Notices are model-visible and logged but excluded from canonical comparison. [Session-format rules](../../../../docs/session-format-status.md) govern durable validation.
Blank initial ordinary sections contribute no attributed text. Making an admitted source blank is a text change that withdraws its guidance, not disposal. The first accepted assembly reserves a system head even when empty; empty content remains logged and addressable but produces no model-request message. Entering or changing a complete prompt appends explicit supersession and reset semantics; leaving it reintroduces current ordinary sections. A system message without `source.sections`, written by an earlier release, a format migration or an importer, receives no invented source metadata; it marks [rebuilding](2026-11-09-deferred-system-compaction.md) pending. Otherwise earlier messages keep their positions.
Rejected or cancelled preparation commits nothing. A later assembly compares current values against committed events again. Once messages are appended, cancellation does not undo them. Source changes after capture wait for the next assembly: disposal can follow a captured introduction, which then commits and is retired on the next assembly. This accepts occasional redundant introduction and retirement rather than losing withdrawal or adding a second observation point. Retries reuse the accepted assembly without another delta commit. After [compaction](2026-11-09-deferred-system-compaction.md), the same captured sections produce a full rebuild at the next model attempt.
Ordinary route, tool, request-series and restart changes do not consolidate instructions. This preserves the [unchanged-prefix guarantee](../bug-fix/2026-10-22-series-start-unchanged-prompt-prefix.md) and the timing of guidance. All retained system messages count as system tokens; adapters preserve additions through native system messages, reminders or a combined system field. The [surface-node representation](2026-09-02-system-prompt-as-surface-node.md) remains the durable representation.
Plan mode retains conditional policy and changes a separate status section on exit and reentry, avoiding repeated policy text. User-switch notices follow committed user-selected transitions, not request headers: headers describe request configuration and need not change with system sections. Cancelled selections emit no notice; approved tool exits use their tool result. Initial entry and committed idle transitions are announced without a second last-announced mode.
## Alternatives considered
**Parallel source APIs and mutable admission fields.** The examined #4969 design supports arbitrary state and declared exits, but text comparison covers this feature. Last-admitted and last-committed fields duplicate candidates and the event-derived projection, adding synchronization for rejection, cancellation and replay. Process-local last-text caches also forget resume and fork state.
**Explicit retirement calls, polling or pending-notice queues.** Producer cleanup was initially preferred to avoid a service-owned liveness detector. Cordis already invokes exact registration cleanup, so registration-time literal wording supplies the same signal without cleanup-time service access. Selecting retirement during assembly coalesces re-registration without a second queue or cancellation mechanism.
**Reject duplicate names or retire every disposed owner.** A single owner avoids fallback rules but prevents scoped overrides. Retiring each owner withdraws instructions that an inherited definition still supplies. Explicit scope precedence and logical-source retirement resolve both cases; duplicate names no longer detect accidental double loading.
**Last registration wins globally or one service per Session.** Global load order would let a late deployment reload override more specific agent instructions. Session-local services would still need to route earlier shared registrations and later disposal, or duplicate plugins and their resources per Session. Shared scope layers with per-Session committed state avoid both problems.
**A dedicated persona registry.** Ordinary sections already resolve prefix and suffix independently, carry complete mode, and restore inherited definitions on disposal. Another registry and assembly overlay duplicate those rules.
**Late source evaluation, retry reevaluation or per-source digests.** Evaluating sources late changes the fixed observation point and an already accepted candidate. Hashing adds recurring work and another representation without eliminating canonical text storage. Direct comparison uses the text already needed for recovery.
**Remove plan policy on exit or rebuild on every restart.** Persistent conditional policy avoids resending it on reentry. Restart rebuilding would move current instructions ahead of intervening turns and discard their original timing. Compaction deliberately permits that movement under its separate decision.
**Persist uncommitted retirement definitions.** Recovery would need stable scope identities, durable cancellation on re-registration and shutdown flushing after cleanup. The runtime-only design accepts the recovery gap rather than adding those mechanisms.
## Consequences
The projection grows with effective sources rather than conversation length and avoids per-request history scans; checkpoints are discardable replay optimizations. Unchanged sections are not duplicated, but retained instructions and notices still consume context. Prefix reuse depends on adapter representation and is not guaranteed. Arbitrary non-text transition state is outside this feature.
Runtime definitions and uncommitted disposal state do not survive restart. A resumed or seeded Session cannot recover registration-specific retirement for a source it never observed locally and that never registers again. This also affects a fork seeded from a completed-turn prefix after its parent retired and released the source during an excluded open turn; copying the parent's current map cannot recover that historical definition. Ordinary admission does not automatically retire missing sources or retain historical definitions. Startup and inherited-source recovery remain deferred; compaction instead adopts current live sources.
Focused registration, assembly and loop tests cover exact-owner teardown, fallback, per-Session retirement, discarded candidates, disposal after capture, reentry, persona inheritance and retry reuse. Persistence and request reconstruction verify canonical metadata and exact model-visible blocks through replay. The compaction note owns rebuilding coverage.
@@ -0,0 +1,61 @@
# Agent Note: 基于 section 的系统更新
Status: implemented
[English](2026-10-21-section-based-system-updates.md) | 中文
## 问题
整份提示词更新会在任一贡献方变化时重复未变的指令。独立的贡献方状态、退役队列和临时准入记录重复了生命周期与提交事实,而进程内比较会丢失恢复和 fork 历史。作用域覆盖需要改变有效指令,却不能让仍有活跃所有者的逻辑来源退役。
## 决策
`section()` 是唯一的来源注册 API。名称标识逻辑指令;普通 `system/message` 事件记录其规范文本、顺序和状态。每个 Session 对这些事件的投影是已提交状态的权威来源。运行时定义保持共享,因为部署和预设插件可以在 Session 创建前注册。Session 提供自身的已提交状态和回调上下文。
### 注册与退役
每个 Cordis effect 拥有一项注册。组装先选择最近的可见作用域,再选择其中最新的活跃注册。选中定义提供文本、顺序、替换措辞和完整模式;只对它的文本提供方求值。移除被遮蔽的所有者不会移除覆盖者。移除覆盖者会将继承定义作为普通更新呈现。Persona 前缀和后缀采用同样的注册:前缀文本与完整模式共同继承,后缀独立继承,subagent 也遵循此规则。
退役同时要求可见链中不存在活跃注册,且该 Session 已提交该名称的文本。每个 Session 保留其观察过的定义;最后被释放的已观察注册提供字面量退役措辞,否则由服务提供点名来源的通知。显式 dispose(资源释放)和插件清理都不会对已释放的提供方求值。一个 Session 完成退役不会清除另一个 Session 的通知。已提交退役会从投影删除来源,因此后来重新引入按普通首次引入处理。
释放记录生命周期状态,而不注册另一项贡献。若有效文本和顺序未变,组装前的关开循环不发送任何消息。来源从未提交就无需退役;该 Session 不再有已提交文本后即可释放非活跃引用。需要独立退役的指令使用不同名称。
### 规范记录与固定组装
组装在异步展示中间件前捕获来源值和生命周期状态。最终规范化的展示结果固定各段;循环在提交时取得其更新,此时将它们与已提交投影比较。文本在直接比较前完成插值并去除首尾空白;数字顺序和名称决定排序,仅顺序变化也会记录。规范文本和每条通知各占一个去除首尾空白的文本块。分隔符由适配器负责,因此序列化添加的空白不属于来源贡献。
`source.sections` 为规范块和通知记录归属,无需解析其文案。活跃记录具有 `contentIndex`,包括空字符串;退役记录省略它。可选的 `noticeIndex` 列出替换或退役块,不区分通知种类。索引指向所在消息,不能重叠或重复。整份提示词的替代通知涉及多个来源,因此不归属于单一来源。通知对模型可见并写入日志,但不参与规范文本比较。[Session 格式规则](../../../../docs/session-format-status.zh.md)负责持久化校验。
初始为空的普通段不贡献带归属的文本。将已准入来源变为空文本是撤回指导的文本变化,而非释放。首次接受的组装即使为空也保留系统头节点;空内容保持可寻址并写入日志,但不产生模型请求消息。进入或改变完整提示词时追加显式替代与重置语义;退出时重新引入当前普通段。由早期版本、格式迁移或导入器写入的、不含 `source.sections` 的系统消息不会获得虚构的来源元数据;它将[重建](2026-11-09-deferred-system-compaction.zh.md)标记为待处理。除此之外,更早的消息保持原位。
被拒绝或取消的准备不提交任何内容。后续组装重新将当前值与已提交事件比较。消息一旦追加,取消不会撤销它们。捕获后的来源变化等待下一次组装:来源可以在其引入被捕获后释放,该引入仍会提交,再由下一次组装退役。这接受偶尔冗余的引入与退役,以免丢失撤回或增加第二个观察点。重试复用已接受的组装,不再次提交增量。[压缩](2026-11-09-deferred-system-compaction.zh.md)之后,同一批已捕获段在下一次模型尝试时生成完整重建。
普通路由、工具、请求序列和重启变化不合并指令。这保留了[不变前缀保证](../bug-fix/2026-10-22-series-start-unchanged-prompt-prefix.zh.md)及指导的生效时机。所有保留的系统消息都计入系统 token;适配器通过原生系统消息、提醒或合并系统字段保留新增内容。[表面节点表示](2026-09-02-system-prompt-as-surface-node.zh.md)仍是持久表示。
计划模式保留有条件适用的策略,并在退出和重新进入时修改独立状态段,避免重复策略文本。用户切换通知跟随已提交的用户选择变化,而不依赖请求头:请求头描述请求配置,不必随系统段变化。取消的选择不发通知;获准的工具退出使用其工具结果。初次进入和已提交的空闲切换都会被说明,无需第二份最后已说明模式状态。
## 考虑过的替代方案
**并行来源 API 与可变准入字段。** 考察过的 #4969 设计支持任意状态和显式退出,但文本比较已覆盖本功能。Last-admitted 和 last-committed 字段重复了候选及事件派生投影,并为拒绝、取消和重放增加同步。进程内最后文本缓存还会遗忘恢复和 fork 状态。
**显式退役调用、轮询或待发通知队列。** 最初偏好生产方清理,以避免服务自行检测存活状态。Cordis 已调用精确的注册清理,因此注册时的字面量措辞提供同一信号,无需清理时访问服务。组装时选择退役可合并重新注册,无需第二套队列或取消机制。
**拒绝重复名称或使每个被释放所有者退役。** 单一所有者避免回退规则,却阻止作用域覆盖。逐个所有者退役会撤回仍由继承定义提供的指令。显式作用域优先级和逻辑来源退役解决这两种情况;重复名称不再检测意外重复加载。
**全局最后注册优先或每个 Session 一个服务。** 全局加载顺序会让后来的部署重载覆盖更具体的 agent(智能体)指令。Session 独立服务仍需转发更早的共享注册及后续释放,或为每个 Session 复制插件和资源。共享作用域层配合每个 Session 的已提交状态避免了这两种问题。
**独立 persona 注册表。** 普通段已能独立解析前缀与后缀、携带完整模式,并在释放时恢复继承定义。另一份注册表和组装覆盖层会重复这些规则。
**延迟来源求值、重试求值或逐来源摘要。** 延迟对来源求值会改变固定观察点及已接受候选。哈希增加持续开销和另一种表示,却无法省去规范文本存储。直接比较使用恢复所需的现有文本。
**退出时移除计划策略或每次重启都重建。** 持久的条件策略避免重新进入时再次发送。重启重建会将当前指令移到中间轮次之前,丢弃原有生效时机。压缩通过独立决策明确允许这种移动。
**持久化未提交的退役定义。** 恢复需要稳定的作用域标识、重新注册时的持久取消,以及清理后的关闭写入。仅运行时设计接受恢复缺口,不引入这些机制。
## 影响
投影随有效来源数而非对话长度增长,避免逐请求扫描历史;检查点只是可丢弃的重放优化。未变化的段不会重复,但保留的指令和通知仍消耗上下文。前缀复用依赖适配器表示,并无保证。任意非文本过渡状态不在本功能范围内。
运行时定义和未提交释放状态不跨重启保留。恢复或继承种子的 Session 无法恢复本地从未观察且不再注册的来源专属退役措辞。这也影响一种 fork:它的种子截止于已完成轮次,而父 Session 在排除的开放轮次中已将来源退役并释放;复制父 Session 的当前映射无法恢复那个历史定义。普通准入不会自动使缺失来源退役,也不保留历史定义。启动和继承来源恢复仍未实现;压缩则采用当前活跃来源。
聚焦的注册、组装和循环测试覆盖精确所有者清理、回退、每个 Session 的退役、丢弃候选、捕获后释放、重新引入、persona 继承与重试复用。持久化和请求重建验证规范元数据及模型可见块在重放中保持一致。压缩记录负责重建覆盖。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-11-09-deferred-system-compaction.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-11-09-deferred-system-compaction.md
/agent-note-deferred-system-rebuilding-after-compaction:
en: c6fa528f2e9eb1ac
zh: 0879b09557393083
/agent-note-deferred-system-rebuilding-after-compaction/problem:
en: 6ccd4f8c4f9dc1ef
zh: 97dd37097903237c
/agent-note-deferred-system-rebuilding-after-compaction/decision:
en: 03a93853db317ab6
zh: 6fc52e8e4f8fa489
/agent-note-deferred-system-rebuilding-after-compaction/alternatives-considered:
en: 7d78cd0b84929ad3
zh: ca604e60bd9c7a4c
/agent-note-deferred-system-rebuilding-after-compaction/consequences:
en: 70cb12c32fe892d4
zh: 1d30e5f6f25a8c8b
@@ -0,0 +1,43 @@
# Agent Note: Deferred system rebuilding after compaction
Status: implemented
English | [中文](2026-11-09-deferred-system-compaction.zh.md)
## Problem
Compaction must choose whether resumed conversation uses instructions from the selected historical endpoint or current registered sources. Historical reconstruction requires separate interpretations of canonical records for endpoint presentation and latest committed state, and cannot include uncommitted source changes.
Manual compaction can finish while a Session is idle, but released readers require ordinary `system/message` events inside an open model step. Immediate system rewriting therefore requires special relationship validation or another durable event and reader implementation. An update computed before compaction is also wrong once compaction removes the instructions it was compared against.
## Decision
Compaction summarizes the existing conversation and leaves current-source evaluation to the next model attempt. The assembly of that attempt’s step uses ordinary scope resolution, interpolation and trimming to capture live sources, including uncommitted changes; the rebuild omits retired sources and transition notices. [Section-based updates](2026-10-21-section-based-system-updates.md) own registration, lifecycle and incremental admission. This decision replaces historical endpoint snapshots and the intermediate immediate-rebuild design.
The existing committed `compaction/summary` event marks system rebuilding pending in the admission projection. A system message without `source.sections` marks it too: an earlier release’s whole prompts and an importer’s empty head are replaced by the same rebuild, without a separate appended replacement and its notice. Assembly fixes section text and lifecycle but computes no update. Before each model attempt, the loop asks the assembly for its updates; that call compares the captured sections with the projection at that moment and returns a full rebuild while one is pending. Compaction between assembly and commitment, or during overflow recovery between attempts of one step, therefore needs no second assembly. A retry receives only a pending rebuild, so system changes that another writer logs between attempts wait for the next assembly, as do source changes after capture.
Within the open step, ordinary `system/message` replacements first clear retained system additions and then reset the initial system node to the full current prompt. Additions outside the compacted range are cleared too. The final attributed reset establishes committed source state and completes the pending rebuild. Empty instructions preserve an empty-capable system head without adding a model-request message. Rejected or cancelled preparation commits no candidate; an interrupted replacement sequence leaves rebuilding pending until a head reset commits. Pending state recovers from the log across restarts without retaining runtime definitions.
The summarizer keeps the original logged instructions, selected conversation and cacheable ordering. Its framed-summary size check remains independent of deferred system text and uses the existing summary-only comparison. Reusing that logic avoids coupling compaction back to current-source assembly. Ordinary system replacements also retain existing scalar context-pressure accounting; this decision does not promise exact pressure after replacements that carry no shadow-price metadata.
## Alternatives considered
**Reconstruct historical instructions from logged sections.** The earlier design folded canonical records through the selected endpoint, omitted retired sources and notices, and let prior full snapshots reset that historical fold. Summary preparation could collect the records alongside selected messages without a second full-log read. A separate snapshot purpose kept the latest admission projection from regressing when an older snapshot was logged after retained suffix updates. This preserved exact endpoint text and order through repeated compaction, but required two interpretations of the log and excluded uncommitted changes. Current instructions govern resumed conversation, so that historical presentation and its tests are deliberately removed; runtime callbacks cannot recreate it.
**Restrict historical snapshots to prefixes or insert them before arbitrary ranges.** Prefix-only compaction allowed the always-present head, even empty, to be replaced with endpoint state using existing operations; it gave up middle ranges to avoid moving historical instructions before retained earlier conversation. Supporting arbitrary historical ranges instead needed insertion and supersession semantics. Current-source rebuilding gives up endpoint fidelity, so the compactor retains its existing range selection and head protection without snapshot-specific restrictions or an insertion operation.
**Immediately replace systems with ordinary messages.** This reuses the message vocabulary, but idle compaction would need an exception to the released open-step rule. Deferral supplies an ordinary open step without another Session-format rule.
**A required atomic rebuild event.** The intermediate `system/rebuild` design used a pure projection to replace the head, clear later system messages and reset committed source state together while preserving conversation positions. Rebuilding before destructive summary replacement protected instructions if preparation failed, but required coordinated event ordering and separate superseded-system token accounting; compaction as a whole still used several events. Readers needed the projection, and older readers safely rejected the required unknown event. Immediate idle inspection and restart visibility motivated that design, but do not justify another event, reader dependency and accounting path. No compatibility reader remains. Reintroduction requires a concrete need for immediate idle visibility or atomic system replacement.
**Compute the update at assembly and recapture after compaction.** Storing the computed delta on the assembly requires recording the latest compaction beside it and assembling again when a later compaction invalidates it. The loop then needs a freshness check, a pending-rebuild query and a commit operation on the system service, called in a fixed order, and source callbacks run twice in one step. Comparing at commitment needs one call and reuses the sections already captured for the step. It gives up source changes made between assembly and a compaction in the same step; they arrive as ordinary updates at the next step.
**Check summary and rebuilt-system size together.** This could reject a summary whose savings are outweighed by fresh system text, but requires evaluating that text during compaction and maintaining combined pricing. The retained summary-only check does not guarantee that the next complete request is smaller after unrelated source growth.
## Consequences
Completed idle compaction can display the old retained instructions until a model attempt begins. This lag is accepted. System replacements are sequential rather than atomically visible, but the model is not called until admission finishes; a failed tail cleanup or head reset remains recoverable from the pending flag. Original events remain in the durable log.
Current instructions move ahead of retained conversation, and later system updates disappear from model history once consolidated. Missing registrations after restart are absent from the full prompt even when ordinary incremental assembly would retain their committed text. A source change between a step’s assembly and a compaction in that step is absent too, until the next step admits it. A Session written by an earlier release is rebuilt once at its first model attempt, which forgoes reuse of its cached request prefix for that request. This gives up exact historical instruction placement and immediate idle visibility while retaining the existing Session vocabulary, surface operations and released reader rules.
Verification covers empty prompts, current and uncommitted sources, retained conversation, interrupted cleanup, restart recovery, repeated compaction and compaction between assembly and commitment. Compaction tests retain summary-only shrink and recovery behavior. Retry tests ensure that source changes after capture are not admitted within the step, with or without compaction.
@@ -0,0 +1,43 @@
# Agent Note: 压缩后延迟重建系统指令
Status: implemented
[English](2026-11-09-deferred-system-compaction.md) | 中文
## 问题
压缩必须选择恢复对话时使用选定历史终点的指令,还是当前注册的来源。历史重建需要分别解释规范记录,以得到终点呈现和最新已提交状态,也无法包含未提交的来源变化。
手动压缩可以在 Session 空闲时完成,但已发布的读取器要求普通 `system/message` 事件位于开放的模型步骤内。因此,立即改写系统指令需要特殊的关系验证,或另一种持久事件及读取实现。压缩移除更新所比较的指令后,压缩前计算的更新也不再正确。
## 决策
压缩对既有对话生成摘要,将当前来源求值留给下一次模型尝试。该尝试所在步骤的组装按普通作用域解析、插值和首尾空白移除规则捕获活跃来源,包含未提交变化;重建省略已退役来源和过渡通知。[按段更新](2026-10-21-section-based-system-updates.zh.md)负责注册、生命周期和增量准入。本决策取代历史端点快照及中间的立即重建设计。
既有的已提交 `compaction/summary` 事件在准入投影中将系统重建标记为待处理。不含 `source.sections` 的系统消息同样会标记:早期版本的整段提示词和导入器写入的空头节点由同一重建替换,不再另行追加替换消息及其通知。组装固定段文本和生命周期,但不计算更新。每次模型尝试前,循环向组装结果请求其更新;该调用将已捕获的段与当时的投影比较,并在重建待处理时返回完整重建。因此,组装与提交之间的压缩,或同一步骤多次尝试之间溢出恢复期间的压缩,都不需要再次组装。重试只会得到待处理的重建,因此其他写入方在两次尝试之间记录的系统变化等待下一次组装,捕获后的来源变化也是如此。
在开放步骤内,普通 `system/message` 替换先清空保留的系统增量,再以完整的当前提示词重置初始系统节点。压缩范围外的增量也会被清空。最终带归属的重置确立已提交来源状态,并完成待处理重建。空指令保留可为空的系统头节点,但不向模型请求添加消息。被拒绝或取消的准备不提交候选;替换序列中断时,重建仍保持待处理,直到头节点重置提交。待处理状态可以跨重启从日志恢复,无需保留运行时定义。
摘要器保留原始已记录指令、所选对话及可缓存顺序。框定摘要的大小检查独立于延后的系统文本,使用既有的仅比较摘要方式。复用这套逻辑避免将压缩重新耦合到当前来源组装。普通系统替换也保留既有的标量上下文压力计数;本决策不保证没有遮蔽价格元数据的替换之后压力精确。
## 考虑过的替代方案
**从已记录段重建历史指令。** 先前设计将规范记录折叠到选定端点,省略退役来源和通知,并让此前的完整快照重置该历史折叠。摘要准备可在收集选定消息时一并收集记录,无需第二次完整日志读取。独立快照用途避免较旧快照在保留后缀更新之后写入时,使最新准入投影回退。这在重复压缩中保留了精确的端点文本和顺序,却需要对日志作两种解释,并排除未提交变化。当前指令负责恢复后的对话,因此明确移除这种历史展示及其测试;运行时回调无法重现它。
**将历史快照限制为前缀,或插入到任意范围之前。** 仅前缀压缩可使用既有操作,将始终存在的头节点(包括空头)替换为端点状态;它放弃中间范围,以免历史指令移到保留的更早对话之前。支持任意历史范围则需要插入和替代语义。当前来源重建放弃端点保真,因此压缩器保留既有范围选择与头节点保护,无需快照专用限制或插入操作。
**立即用普通消息替换系统指令。** 这复用消息词汇,但空闲压缩需要已发布开放步骤规则的例外。延迟重建提供普通开放步骤,无需另一条 Session 格式规则。
**必需的原子重建事件。** 中间的 `system/rebuild` 设计通过纯投影同时替换头节点、清除后续系统消息并重置已提交来源状态,保留对话位置。在破坏性的摘要替换前重建可在准备失败时保护指令,但需要协调事件顺序,并单独计量被替代的系统 token;整个压缩仍包含多个事件。读取器需要该投影,旧读取器会安全拒绝未知必需事件。立即的空闲检查与重启可见性推动了该设计,但不足以证明另一种事件、读取器依赖和计量路径的必要性。不再保留兼容读取器。重新引入需要具体的即时空闲可见性或原子系统替换需求。
**在组装时计算更新,压缩后重新捕获。** 将计算出的增量保存在组装结果上,需要同时记录最近一次压缩,并在之后的压缩使其失效时再次组装。循环因此需要按固定顺序调用系统服务上的新鲜度检查、待重建查询和提交操作,来源回调也会在同一步骤内运行两次。在提交时比较只需要一次调用,并复用该步骤已捕获的段。它放弃了同一步骤内组装与压缩之间发生的来源变化;这些变化在下一步骤作为普通更新到达。
**共同检查摘要和重建系统的大小。** 这可以拒绝被新系统文本增长抵消节省量的摘要,但要求在压缩期间求值这些文本,并维护联合计价。保留的仅摘要检查不保证无关来源增长后下一次完整请求仍然更小。
## 影响
已完成的空闲压缩可以继续显示旧的保留指令,直到模型尝试开始。此显示延迟是可接受的。系统替换按顺序可见,并非原子可见,但模型只在准入完成后才被调用;失败的尾部清理或头节点重置仍可通过待处理标记恢复。原始事件仍保留在持久日志中。
当前指令移到保留对话之前,后续系统更新在归并后从模型历史中消失。重启后缺失的注册不会进入完整提示词,即使普通增量组装会保留其已提交文本。同一步骤内组装与压缩之间发生的来源变化同样不会进入,直到下一步骤将其准入。由早期版本写入的 Session 在其首次模型尝试时重建一次,该次请求因此无法复用已缓存的请求前缀。这放弃了精确的历史指令位置和立即空闲可见性,同时保留既有 Session 词汇、表层操作和已发布读取器规则。
验证覆盖空提示词、当前及未提交来源、保留对话、中断清理、重启恢复、重复压缩,以及组装与提交之间的压缩。压缩测试保留仅摘要缩减检查和恢复行为。重试测试确保无论是否发生压缩,捕获后的来源变化都不会在该步骤内准入。
@@ -4,19 +4,19 @@
# pnpm run verify-translation-pairing --write .agents/notes/implemented/bug-fix/2026-10-22-series-start-unchanged-prompt-prefix.md
/agent-note-a-series-start-with-an-unchanged-prompt-keeps-the-surviving-system-node:
en: f62e2980951e0cb3
zh: 3cd4fd49a89fae40
zh: 659a63b94229c97f
/agent-note-a-series-start-with-an-unchanged-prompt-keeps-the-surviving-system-node/problem:
en: b2b7d5e9a4850ece
zh: cbd91b67969bca02
en: 9c4f98af84c7170d
zh: 813b2fc7aecdb199
/agent-note-a-series-start-with-an-unchanged-prompt-keeps-the-surviving-system-node/decision:
en: 8a3404207a36ecfb
zh: d8bc1decefa60a20
en: f080db598c54b603
zh: 0a7ab5d4abf25232
/agent-note-a-series-start-with-an-unchanged-prompt-keeps-the-surviving-system-node/verification:
en: 1970ea84337ce9b5
zh: da5b9928606c07c6
en: 700c88c6b182bacb
zh: 47bcf424dcc279d7
/agent-note-a-series-start-with-an-unchanged-prompt-keeps-the-surviving-system-node/alternatives-considered:
en: 2e87f55619f04607
zh: 7ca5a8e9a42a799a
en: 84798b5dc5fcae32
zh: 1a621b7004c03983
/agent-note-a-series-start-with-an-unchanged-prompt-keeps-the-surviving-system-node/consequences:
en: bf8a9d6c56722efd
zh: 18dfdf8a7b9bcb5c
en: 426a2b4692184bd0
zh: d37ea7b8121286d7
@@ -6,34 +6,30 @@ English | [中文](2026-10-22-series-start-unchanged-prompt-prefix.zh.md)
## Problem
On an in-history route, a prompt change is appended as a later `system/message`, so node 0 stays stale while the latest surviving node carries the rendering. A surface replacement (compaction, tool-result prune, image offload) starts a new request series. Re-baselining node 0 at a series start while the rendering already matched that latest node emptied the later node and wrote the identical text into node 0. The wire request then differed at its first message, so the provider prefix cache missed from the first token although no prompt text changed.
Real session `session-da55bbc9-…`, turn 710 step 2: `compaction/prune` replaced one tool result (seq 34669, 34670); the next request wrote 7,618 characters identical to the node it emptied (seq 34672, 34673), `request/header` logged reason `series` (seq 34674), and the step billed 722,332 uncached input tokens with 1,152 cache-read tokens (0.16% hit) against about 99.9% on the neighboring steps. A build update at turn 707 had appended the prompt node; nothing changed the rendering at turn 710.
A surface replacement can invalidate only a later portion of conversation history. Moving unchanged system instructions back to node 0 at that request-series start invalidates the provider prefix from the beginning without changing those instructions.
## Decision
`SystemPromptProjection.project` re-baselines node 0 only when the effective text must move: an incapable route, an empty rendering, or a series start whose latest surviving non-empty node text differs from the rendering. When the route is in-history, the rendering is non-empty, and the latest surviving node already holds it, the projection returns no updates and the node stays where the cached history carried it. The loop still records the request series through `request/header` (`series`, or `change` with `startsSeries: true`) and rebuilds declarations as before; when the unchanged-rendering skip coincides with a tool-schema series start, the header records the declaration change without `startsSeries`.
Keep unchanged admitted system nodes in place when a new request series starts. The system-prompt service compares canonical committed section text independently of request-series markers. Replacing unrelated user or tool content does not require rebuilding instructions. Compaction is a separate trigger for [deferred rebuilding from current sources](../architecture/2026-11-09-deferred-system-compaction.md), not a consequence of the series marker. The [section-admission decision](../architecture/2026-10-21-section-based-system-updates.md) owns incremental updates, retirement, complete overrides and adapter representations.
Retry recovery keeps its guarantee: when a retry compaction shadows the latest node, the effective text falls back to an older node, differs from the rendering, and the head is rewritten before users are admitted again. The projection never appends an update after already-admitted users.
Request-series and tool-declaration handling remain independent. A surface replacement still starts a series and declarations can still rebuild; neither operation alone moves system instructions. An unsupported tool-update route receives the complete active declarations even when unchanged system instructions produce no system event or additional `startsSeries` marker.
## Verification
- [`system-prompt-projection.spec.ts`](../../../../packages/core/agent-loop/tests/system-prompt-projection.spec.ts) pins the no-operation decision for a capable series start whose surviving node already matches.
- [`system-prompt-admission.spec.ts`](../../../../packages/core/agent-loop/tests/system-prompt-admission.spec.ts) pins the wire request: a compaction replacement with an unchanged rendering keeps both system messages, the previous request messages remain a prefix, and the neighboring steps regain the provider prefix.
- The [`in-history-series-start`](../../../../snapshots/session/in-history-series-start/) recorded session replays the shipped headless profile through a prompt change and a later surface replacement, pinning the unchanged-rendering series start to two retained prompt versions and no `system/message` event.
- [`admission.spec.ts`](../../../../packages/core/system-prompt/tests/admission.spec.ts) verifies unchanged text produces no delta and compaction alone marks a full rebuild pending.
- [`system-prompt-admission.spec.ts`](../../../../packages/core/agent-loop/tests/system-prompt-admission.spec.ts) verifies unchanged prefixes through explicit series starts, unrelated replacements, tool changes, and resume, plus retry recovery when compaction removes a system node.
- The [`in-history-series-start`](../../../../snapshots/session/in-history-series-start/) recorded session verifies two retained system messages and no redundant system event after replacement of unrelated history.
## Alternatives considered
**Always keep the appended node and never re-baseline.** Simpler, but a route that cannot append prompts, or a prompt that must clear, still needs a single current head, and a changed rendering at a series start must not append after users already admitted by a failed attempt. Rejected.
**Consolidate on every series start.** Rejected because a tail replacement does not invalidate the entire cached prefix.
**Skip consolidation whenever the head differs.** A stale head is authoritative again on an incapable destination route, because that route ignores later system nodes; the route capability, not the head text, decides whether the later node is effective. Rejected.
**Always keep admitted nodes.** Rejected because compaction can remove instructions and explicitly adopts current live sources for the next model attempt. Its full rebuild clears retained additions too; the old head alone is not authoritative current state.
**Stop treating local surface replacements as series starts.** A prune changes one tool result, so the cache loss is local, but image-offload and compaction decisions still legitimately start a series; the projection must not depend on which replacement produced the boundary. Rejected: the projection owns the prompt decision.
**Stop treating local replacements as series starts.** Rejected because compaction and image-offload still require request-series handling. Prompt admission owns the separate instruction decision.
**Compare reconstructed requests instead of surface text.** The loop derives requests from surface events, so comparing past wire messages would duplicate request reconstruction and still need the same effective-text comparison. Rejected.
**Compare reconstructed wire requests.** Rejected because this duplicates request reconstruction and couples admission to adapter serialization. Canonical Session records already identify the instructions and their conversation positions.
## Consequences
- A capable route can retain earlier prompt versions in model history after a series start; they cost input tokens until a later consolidation or compaction shadows them.
- A tool-schema series start on a route without tool updates no longer writes a `system/message` event, so its header records the declaration change without `startsSeries`. The request still carries the complete active declaration set through the unsupported-route projection (`projectToolUpdates`), while `Session.toolHistory()` keeps its incremental baseline instead of resetting.
- Consolidation still applies when the rendering actually differs: route switches, prompt updates concurrent with compaction, and retries that shadow the latest node.
Retained system history continues to cost input tokens. Preserving its position enables prefix reuse only when the adapter representation also preserves it; it does not guarantee a cache hit. Retries reuse accepted instructions. Compaction recovery rebuilds them from the same captured sections before another model attempt without admitting the user input twice.
@@ -1,39 +1,35 @@
# Agent Note: 渲染未变的新序列保留存活的系统节点
# Agent Note: 系列开始时未变化的提示词保留存活系统节点
Status: implemented
[English](2026-10-22-series-start-unchanged-prompt-prefix.md) | 中文
## Problem
## 问题
在 in-history 路由上,提示词变化会追加为后续的 `system/message`,因此 node 0 保持陈旧,由最新存活节点承载渲染文本。surface 替换(压缩、工具结果剪枝、图片省略)会开启新的请求序列。在渲染文本已经与该最新节点一致时重写 node 0,会清空该节点并把完全相同的文本写进 node 0。于是 wire 请求的第一条消息发生变化,提供方前缀缓存从第一个 token 起未命中,尽管提示词文本没有任何变化。
surface 替换可能只使对话历史靠后的部分失效。在该请求序列开始时将未变化的系统指令移回 node 0,会在没有改变指令的情况下从头破坏提供方前缀缓存。
真实会话 `session-da55bbc9-…` 第 710 轮第 2 步:`compaction/prune` 替换了一条工具结果(seq 34669、34670);下一次请求写入的 7,618 个字符与它清空的节点完全相同(seq 34672、34673),`request/header` 记录 reason `series`(seq 34674),该步计费 722,332 个未命中输入 token、1,152 个缓存读取 token(命中率 0.16%),而相邻步骤约为 99.9%。第 707 轮的构建更新追加了提示词节点;第 710 轮没有任何东西改变渲染文本。
## 决策
## Decision
新请求序列开始时,将未变化的已准入系统节点保留在原位。系统提示词服务比较已提交的规范段文本,与请求序列标记独立。替换无关的用户或工具内容不需要重建指令。压缩是[延迟从当前来源重建](../architecture/2026-11-09-deferred-system-compaction.zh.md)的独立触发条件,而非序列标记的结果。[分段准入决策](../architecture/2026-10-21-section-based-system-updates.zh.md)负责增量更新、退役、完整覆盖和适配器表示。
`SystemPromptProjection.project` 只在有效文本必须移动时重写 node 0:不具备能力的路由、空渲染文本,或最新存活非空节点文本与渲染文本不同的新序列开始。当路由为 in-history、渲染文本非空、且最新存活节点已经持有它时,投影不产生任何更新,节点保持在已缓存历史携带它的位置。loop 仍通过 `request/header` 记录请求序列(`series`,或带 `startsSeries: true` 的 `change`),并照旧重建声明;当「渲染未变则跳过」与工具 schema 起因的新序列重合时,header 记录声明变化但不带 `startsSeries`。
请求序列和工具声明处理保持独立。surface 替换仍会开始新序列,声明也仍可重建;两者本身都不会移动系统指令。不支持工具更新的路由会收到完整的活跃声明,即使未变化的系统指令不产生系统事件或额外的 `startsSeries` 标记。
重试恢复保持原有保证:重试压缩遮蔽最新节点后,有效文本回退到更旧的节点,与渲染文本不同,于是头节点在用户消息再次被接纳之前重写。投影从不会在已接纳的用户消息之后追加更新。
## 验证
## Verification
- [`admission.spec.ts`](../../../../packages/core/system-prompt/tests/admission.spec.ts) 验证未变文本不产生增量,而压缩独立地标记待执行完整重建。
- [`system-prompt-admission.spec.ts`](../../../../packages/core/agent-loop/tests/system-prompt-admission.spec.ts) 验证显式序列开始、无关替换、工具变化和恢复期间的未变前缀,以及压缩移除系统节点后的重试恢复。
- [`in-history-series-start`](../../../../snapshots/session/in-history-series-start/) 录制会话验证替换无关历史后保留两条系统消息,且不产生冗余系统事件。
- [`system-prompt-projection.spec.ts`](../../../../packages/core/agent-loop/tests/system-prompt-projection.spec.ts) 固定「能力路由的新序列开始时存活节点文本已一致则不产生操作」的决策。
- [`system-prompt-admission.spec.ts`](../../../../packages/core/agent-loop/tests/system-prompt-admission.spec.ts) 固定 wire 请求:渲染文本未变的压缩替换保留两条系统消息,上一次请求的消息仍构成前缀,相邻步骤重新获得提供方前缀。
- [`in-history-series-start`](../../../../snapshots/session/in-history-series-start/) 录制会话通过 shipped headless profile 回放「提示词变化 + 后续 surface 替换」,固定渲染未变的新序列保留两份提示词版本且不写 `system/message` 事件。
## 考虑过的替代方案
## Alternatives considered
**每次序列开始都归并。** 已拒绝,因为尾部替换不会使整个缓存前缀失效。
**永远保留追加节点、从不重写。** 更简单,但无法追加提示词的路由、或必须清空的提示词仍需要单一当前头节点;新序列开始时若渲染文本确实变化,也不能在失败尝试已接纳的用户消息之后追加。拒绝。
**始终保留已准入节点。** 拒绝,因为压缩可能移除指令,并明确为下一次模型尝试采用当前活跃来源。完整重建也会清除保留的新增内容;旧头节点本身不是当前状态的权威来源。
**只要 head 不同就跳过归并。** 在目标路由变为不具备能力时,陈旧 head 会重新成为权威,因为该路由忽略后续系统节点;决定后续节点是否生效的是路由能力,而不是 head 文本。拒绝。
**不再将局部替换视为序列开始。** 已拒绝,因为压缩与图像卸载仍需要请求序列处理。提示词准入负责独立的指令决策。
**让局部 surface 替换不再算新序列。** 剪枝只改一条工具结果的文本,缓存损失是局部的,但图片省略与压缩决定仍合理地开启新序列;投影不应依赖是哪种替换制造了边界。拒绝:提示词决策属于投影。
**比较重建的线上请求。** 已拒绝,因为这会重复请求重建,并将准入与适配器序列化耦合。规范 Session 记录已标识指令及其对话位置。
**比较重建后的请求而不是 surface 文本。** loop 从 surface 事件派生请求,比较历史 wire 消息会重复请求重建,而且仍然需要同样的有效文本比较。拒绝。
## 影响
## Consequences
- 具备能力的路由在新序列开始后可能在模型历史中保留更早的提示词版本;在被后续归并或压缩遮蔽之前,它们会计入输入 token。
- 不支持工具更新的路由上,工具 schema 变化开启的新序列不再写出 `system/message` 事件,因此其 header 记录声明变化但不带 `startsSeries`。请求仍通过不支持更新的路由投影(`projectToolUpdates`)携带完整的生效声明集合,而 `Session.toolHistory()` 保留其增量基线、不再重置。
- 渲染文本确实不同时归并仍然生效:路由切换、与压缩同时发生的提示词更新,以及遮蔽最新节点的重试。
保留的系统历史仍消耗输入 token。只有适配器表示也保留其位置时,保留位置才有助于前缀复用;这不保证缓存命中。重试复用已接受指令。压缩恢复会在再次模型尝试前根据同一批已捕获段重建指令,而不重复准入用户输入。
@@ -2,33 +2,24 @@
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/feature/2026-09-02-in-history-system-prompt-replacement.md
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes:
en: 7b69ac848815886a
zh: db7a9f4000fe5359
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes/problem:
en: 87965b88be0e831f
zh: d96767a2cef52269
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes/decision:
en: da6d3f0677f0343b
zh: 8b5dcf7e1108edc9
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes/decision/capability:
en: 2f23fa55e1ce652c
zh: 335695fc654ab1db
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes/decision/the-decision-rule:
en: bd990101d220c905
zh: 98f54d523b9ffe52
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes/decision/presentation-and-accounting:
en: 800d579e2fcf2cce
zh: 1e92354d9161c50a
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes/decision/compaction:
en: c21a3e7a773860e5
zh: 566669e245ccdbaf
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes/alternatives-considered:
en: 02b49911bc4601d0
zh: bfa19fd7c4337812
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes/consequences:
en: beda064bcd194a2a
zh: 8a3bb81d5edcd60a
/agent-note-in-history-system-prompt-replacement-for-cache-stable-prompt-changes/testing:
en: 3f9750d67404ac92
zh: 80cb9aced02e2950
/agent-note-in-history-system-prompt-updates:
en: e7e7f2a14e90ace3
zh: 39a793d03e901ee6
/agent-note-in-history-system-prompt-updates/problem:
en: 37cc9d5bf19ae1c5
zh: ee3cbfccf766009d
/agent-note-in-history-system-prompt-updates/decision:
en: bb699c72beef8c05
zh: 618fa5734daa3ca4
/agent-note-in-history-system-prompt-updates/decision/presentation-and-accounting:
en: 73631e9902540dc1
zh: 2e15a6354e607969
/agent-note-in-history-system-prompt-updates/alternatives-considered:
en: df12ea1fc1af8b4d
zh: 645feccb1000039c
/agent-note-in-history-system-prompt-updates/consequences:
en: 602a3728896770b1
zh: 1aeec163d022f609
/agent-note-in-history-system-prompt-updates/verification:
en: d1c8418c34bfc79f
zh: c61281563f4a2f81
@@ -1,4 +1,4 @@
# Agent Note: In-history system prompt replacement for cache-stable prompt changes
# Agent Note: In-history system-prompt updates
Status: implemented
@@ -6,93 +6,44 @@ English | [中文](2026-09-02-in-history-system-prompt-replacement.zh.md)
## Problem
Every system prompt change costs the whole provider prefix cache. The loop renders the prompt on every step; when the bytes differ — a plan-mode section entering or leaving, a skill or tool guidance section registering, an agent-scoped persona shadow, a changed `{{model}}` variable — the request's message 0 changes and the DeepSeek context cache misses from the first token. Long agentic sessions pay this repeatedly, and the [runtime-context snapshot design](../../archived/feature/2026-07-30-current-sandbox-policy-context.md) exists precisely because moving a changing fact out of the prompt was the only way to keep the prefix stable.
A DeepSeek model, recorded here as a model fact supplied for this work, removes that constraint: it accepts a `system` message at any position of the conversation and treats the latest one as the complete effective system prompt, replacing the leading one. Tool schemas remain part of the cached prefix; [dynamic tool updates](../architecture/2026-09-20-dynamic-tool-updates.md) can defer additions, while changed retained definitions still invalidate reuse. With that model the harness can append the new prompt after the cached history instead of rewriting message 0, and the prefix stays warm.
The harness has the representation for this because the [system prompt is surface node 0](../architecture/2026-09-02-system-prompt-as-surface-node.md): a prompt change is an operation on `system/message` surface nodes, and the choice between "replace the latest system node" and "append a new node" is a per-route decision.
Rewriting the leading prompt when plan guidance, tools, persona or model variables change invalidates the provider prefix from its first token. Later instruction messages can preserve the preceding conversation prefix, but their representation depends on model capabilities. The [surface-node decision](../architecture/2026-09-02-system-prompt-as-surface-node.md) makes their original positions durable.
## Decision
For a model route that declares the capability, the loop appends a new `system/message` surface node instead of replacing the latest system node when the rendered prompt changes and the prefix would otherwise survive. Everything else in the [surface-node decision](../architecture/2026-09-02-system-prompt-as-surface-node.md) is unchanged: the event type, the projection owner, the serializers, and the node 0 head protection.
The cache-preserving choice remains: log instructions when they enter the conversation instead of routinely moving them to its beginning. [Section-based updates](../architecture/2026-10-21-section-based-system-updates.md) supersede the original route-gated whole-prompt rule. They append changed source text and explicit notices on every route; the loop does not select the latest system message as the entire prompt or consolidate because native updates are unavailable. [Compaction](../architecture/2026-11-09-deferred-system-compaction.md) provides the explicit consolidation point, while [unchanged series starts](../bug-fix/2026-10-22-series-start-unchanged-prompt-prefix.md) preserve retained instruction positions.
### Capability
`systemPromptUpdate = 'in-history'` remains a declared model capability on resolved model information and prepared calls, recorded in request context. Catalogs validate the value; model names or protocol families do not imply support. The declaration describes native representation, not permission to admit section deltas. Adapters preserve all instructions using native messages, a combined system field or the [pi-ai reminder fallback](../architecture/2026-10-19-pi-ai-system-reminder-fallback.md). The bound prepared call, rather than a preceding request-context snapshot, determines serialization.
`dsh-llm` defines `SystemPromptUpdate = 'in-history'` and carries it as an optional sibling field, `systemPromptUpdate`, on `LlmResolvedModelInfo` and `PreparedLlmCall`; `normalizeModelInfo` rejects any other value with an `LlmError` whose code is `INVALID_MODEL_INFO`. The DeepSeek adapter's catalog model (`DeepSeekCatalogModel.systemPromptUpdate`, validated by zod at load) and the replay provider's `ReplayModelConfig.systemPromptUpdate` declare it per model; absence means the model needs message 0 rewritten. The sole built-in entry in `dsh-llm-deepseek`, `deepseek-flash`, declares it alongside text and image input. This exact catalog entry records the model capability; names and protocol families do not imply support for other models. A deployment can replace the catalog through the `models` list in `cordis.yml`, and every `dsh-llm-pi-ai` route keeps the replace behaviour.
The loop records the mode in the session: `RequestContext.systemPromptUpdate` joins provider, model, and capacity as a `request/context` field, logged whenever any of them differs from the latest snapshot. Admission reads `PreparedLlmCall.systemPromptUpdate` from the actual call prepared after `agent/request`; the preceding snapshot is not an admission input. First requests, resumed sessions, route changes, and same-route capability changes therefore use the capability of the bound adapter that will serve the call.
### The decision rule
`SystemPromptProjection.project(rendered, { inHistory, startsSeries })` in `packages/core/agent-loop/src/runtime-context.ts` scans the surviving `system/message` nodes of the current surface on every call. It returns ordered per-node commits. With no surviving system node it reserves the head even for an empty rendering. Effective text comes from the latest non-empty system node, falling back to the head; dormant empty tails neither supply effective text nor need another empty replacement. An empty rendering clears every active system node, regardless of route or series state. For a non-empty rendering, an incapable route or a new request series whose effective text differs consolidates; a series start whose latest surviving node already holds the rendering emits nothing and keeps that node in place. Otherwise matching effective text emits nothing. The unchanged-text case is owned by the [series-start prefix decision](../bug-fix/2026-10-22-series-start-unchanged-prompt-prefix.md). The operations are:
| Route capability | Prefix state | Operation |
|---|---|---|
| none | non-empty rendering, any prefix state | log an empty replacement for each non-empty later system node, then rewrite the first system node with the rendering if needed |
| `in-history` | the current request series continues | append a new `system/message` before the step's `user/message` events; the append alone needs no `request/header` |
| `in-history` | non-empty rendering, a new series starts and the latest effective text differs | log empty replacements for non-empty later system nodes, then rewrite the first system node if needed |
| `in-history` | non-empty rendering, a new series starts with the rendering already current | no operation: the surviving node stays where the cached history carried it |
| any | the rendered prompt is empty | log empty replacements for non-empty later system nodes, then empty the head if needed; no prompt version remains in derived messages |
`startsSeries` is true when the `agent/pre-step` decision declares `startsRequestSeries`, when the surface replace generation moved since the last request (a compaction or any other replacement), or when the visible tool-schema set changed on a route without `toolUpdate` support. Supported tool additions can accompany a prompt append without starting a series. A provider or model swap alone is not a series start for this rule: on a capable destination route the changed prompt is appended, which costs nothing because the route change already misses the cache. A series start does not by itself discard the whole provider prefix: a replacement or image-offload decision may invalidate only the tail, so consolidation waits until the effective text must move; when it does, the series is the point to keep only the current prompt in model history and to avoid appending after already-admitted users on a retry. Logged per-node empty replacements remove later prompts from derived messages without a surface delete operation or any replacement of intervening conversation nodes. This also keeps compaction recovery from appending a system update after users already admitted by the failed attempt.
The first attempt admits the prompt after assembly, an accepted `agent/pre-step` decision, `step/start`, the `agent/request` waterfall, and `prepareCall()`. A rejected or empty first input opens no step. Neither async request phase commits the pending system prompt or accepted users, and cancellation during either commits neither. Every attempt synchronously reconciles the same rendered assembly after its own `agent/request` and `prepareCall()`, appends the accepted user batch only on the first attempt, logs header/context as needed, and derives and freezes the request before streaming through the same prepared call. Retries do not repeat assembly, `agent/pre-step`, or user admission. Reconciliation sees both pre-step compaction (`compaction-basic` with `auto: true`) and recovery compaction, and consolidates non-empty prompt text at the head when either starts a new series whose effective text differs. Resume is series-continuing — the `resume` header is not a series start — so a prompt that changed across a restart is appended; the provider cache may still be warm across a process boundary.
An empty head with no active later system node represents no prompt. Dormant empty tails do not supply effective text, so repeated clearing and resume cannot resurrect an older prompt. Restoring non-empty text uses the same admission rule: a continuing capable route may append it; an incapable route or a new series refills the head. Clearing uses ordinary per-node replacements, not a surface delete or an initial empty-head creation.
Instruction and user commitment follows successful request middleware and preparation inside an open step. Cancelling either preparation phase leaves them uncommitted. New instructions precede newly admitted users. Retries do not rerun assembly, pre-step selection or user admission; after compaction, the next attempt rebuilds the instructions from the same captured sections. Resume retains committed instructions and appends changes, because a process restart alone need not invalidate provider caches.
### Presentation and accounting
Web presents an appended in-history node at its own position. `SystemPromptNode` carries `{ seq, time, turn, step, text, update }`, `update` being true for an appended `system/message` that follows an earlier system node in the loaded window. Chat renders a non-empty update as a collapsed `system-prompt` card titled by the locale key `message.systemPromptUpdate`, and a `request/header` in the same turn and step does not repeat the prompt card; `inspectRequestPrompt` reports no system change for a header that follows an update. Trajectory folds an update following a loaded request header into a synthetic request-header fact with `promptChange.kind = 'system'`, so later requests show the effective prompt without a real header change. When the loaded window lacks the earlier system node, the update is presented as an initial prompt. Transcript projections skip it like every `system/message`.
Chat shows a later nonempty system node as a collapsed update card and avoids repeating it in a same-step request header. Trajectory can represent it as a synthetic request-header fact. Header configuration and tools remain independent of instruction changes; comparing only real headers would miss an intermediate system update. If the loaded window contains no earlier system node, the node appears as an initial prompt. Human transcripts omit system messages.
`dsh-token-meter` prices the last nonempty surviving system node in surface order as `contextBreakdown.systemTokens`; every other visible node, including superseded prompts, contributes to `messageTokens`. Empty dormant nodes are ignored. The unit retains only the surviving system prompts and a running surface total, and prices replacements from the adjacent shadow-price event ([system-prompt state](../architecture/2026-10-13-context-breakdown-system-prompt-state.md)). `cacheReadTokens` on subsequent assistant usage remains the observable provider-cache effect.
Request-prompt inspection uses immutable prefix states ordered by surviving conversation positions, not simply event sequence or source citations. Head rewrites can be logged after later-position updates; replacements can remove system nodes. Empty nodes remain addressable without erasing other retained text. When a replacement endpoint predates the known window and its position is unknown, inspection withholds later prompt text until prepend replay resolves the missing prefix. Numeric event order cannot safely guess the position. Historical cards retain their own prefix state.
Trajectory chooses the newer of the preceding real header and the preceding synthetic system header as the comparison state. A real header owns configuration and tools; an appended prompt can advance that state without another real header. Comparing only real headers would report A rather than B as the previous prompt for an A → B → C sequence.
Chat and Trajectory interpret the effective prompt through the pure `uiConversation.inspectSystemPrompt` operation. Each target keeps immutable prefix states for system events and positional replacements, with only surviving system nodes and a map of surviving replacement sequences to inherited surface positions. Each replacement copies that map and removes shadowed entries; historical prefix maps remain immutable. Ordinary appends and streaming updates require no prompt fold. Surface order, rather than event order or source-event citations, determines which nodes survive: a compaction can restore an older prompt without another system event, and a head rewrite can have a greater sequence than a later active prompt. Empty nodes remain addressable but do not override a nonempty prompt. An endpoint older than the earliest relevant loaded event has unknown order unless its replacement position is indexed. The interpreter withholds all subsequent prompt text after such an endpoint until prepend replay resolves the missing prefix; numeric event order cannot establish surface order. Historical cards keep their own prefix state rather than reading the final surface.
### Compaction
`compaction-basic` is unchanged. `selectCompactableRange` still anchors at the first non-system node, so node 0 is never shadowed and later in-history nodes can be; `buildSummarizationInput` prepends the derived head to `messages`, followed by every shadowed node's derived message in surface order, so a mid-region system node is replayed in place and the summarization call remains a genuine prefix of the conversation.
Token breakdown counts every surviving system message as system tokens. The [compact accounting state](../architecture/2026-10-13-context-breakdown-system-prompt-state.md) keeps system nodes and a running total rather than per-message accounting entries. Provider `cacheReadTokens` remains the observable cache signal; neither additive admission nor native-support metadata guarantees a cache hit.
## Alternatives considered
**Send only the changed sections as a delta.** The model treats the latest system message as the complete prompt, so a delta would silently drop every unchanged section. Rejected on the model contract.
**Route-gated whole-prompt replacement.** The original design treated the latest system message as the complete prompt and rejected section deltas under that assumption. Canonical per-source records and explicit replacement or retirement notices make additions meaningful without that interpretation; adapter fallback preserves them on other routes. Its former series-start and incapable-route consolidation rules are therefore not current behavior.
**Enable in-history mode by plugin config instead of a model capability.** A deployment flag could pair a non-capable model with appended system messages, which such a model would read as ordinary history at best. The capability belongs to the route that honours it; the adapter catalog already carries per-model capacities. Rejected.
**A deployment switch instead of declared native capability.** A flag could misrepresent what the selected model accepts. Capability remains model-owned even though it no longer gates section admission.
**Always append, never re-baseline.** One rule, but node 0 would stay stale for the life of the session and every request after compaction would carry the stale head plus the replacement. Re-baselining at a series start costs nothing extra because the cache is already lost there. Rejected.
**Always append, or consolidate on every series start or resume.** Unlimited appends retain stale head text and consume context; compaction supplies consolidation. A local replacement can leave most of the prefix valid, and restart can retain a warm provider cache, so neither alone justifies moving instructions. Model swaps likewise need no special consolidation rule beyond the recorded route change.
**Re-baseline on every resume.** Accepts one cache miss per process restart for a simpler resume path. The cache persists across restarts for hours to days, and the log already carries what resume needs. Rejected.
**Commit before pre-step and request preparation, or put updates after new users.** Early commitment can admit cancelled content or miss a compaction that removes the instructions an update was compared against. Putting updates after users reverses the established instruction-before-input order. Capture can happen earlier, but comparison and commitment must follow any compaction and precede request derivation.
**Place the system message after the step's user messages.** Both positions sit after the cached prefix, but the model then reads the instructions after the input it must apply them to; system-before-user matches the leading position's ordering. Rejected.
**Use prior request context to decide the current representation.** It describes a previous call and can be wrong for the first call, resumed sessions or route changes. The actual bound adapter owns current serialization.
**Project the prompt before the `agent/pre-step` waterfall.** The projection would not see a compaction performed inside the waterfall, so a just-appended node could be shadowed in the same step and the request would carry node 0's stale prompt as the only system message. Projecting after the waterfall keeps the rule a pure function of the surface the request is built from. Rejected.
**Clear only the latest system node during consolidation.** Older instructions would survive and could become effective again. Rebuilding clears retained additions before replacing the initial head, preserving intervening conversation.
**Use the preceding request context for admission.** It describes the previous call, not the adapter bound after request middleware. It can select the wrong prompt representation on the first call, after resume, or after a route or capability change. Resolving before prompt and user commits also keeps cancellation from admitting unsent content. Rejected.
**Treat a provider or model swap as a series start.** It would fold the prompt into node 0 on every route change, matching a tool change on an incapable route. The header already records the change and the cache misses either way, so the extra rule bought nothing but a special case in the loop. Rejected.
**Clear only the latest system node.** Empty nodes project to no message, so an older prompt would become effective again. Clearing all active versions preserves the meaning of an empty rendering without deleting conversation history. Rejected.
**Keep only scalar totals.** A scalar shadow price cannot identify which bucket lost the newest prompt or restore its predecessor. Summing all surviving prompts as system tokens would change the intended effective-prompt meaning rather than fix classification. Retained system prompts with the shadow-price event's `shadowedSeqs` answer both questions; [the system-prompt state note](../architecture/2026-10-13-context-breakdown-system-prompt-state.md) records that choice over positional entries.
**Keep only scalar accounting totals.** Replacement prices cannot identify which system nodes disappeared. Retaining only those nodes with shadow-price metadata supports classification without a per-message checkpoint.
## Consequences
- A prompt change on a capable route keeps the provider prefix cache; the appended node costs its own tokens on every request in the series until compaction shadows it. A deployment whose prompt changes on most steps is better served by moving that fact into runtime context.
- The request head is not the only place a system prompt can live: readers of "what did the model see" fold the surface and take the latest system node, and the breakdown's system figure follows the same rule.
- A `request/context` snapshot records the prepared route and declared mode; it describes admission rather than deciding it. Incapable-route consolidation is logged per system node, preserving intervening user, assistant, and tool history.
- The model contract is recorded as supplied. If a released model narrows it — for example honouring only the latest system message within a bounded window — the rule needs a re-baseline trigger beyond series starts.
- A proxy that rewrites or reorders system messages breaks the replacement semantics silently; the real-API e2e's cache-hit assertion is the detector.
Appending an update can preserve the provider prefix, but every retained update consumes input tokens until consolidation or removal. Frequently changing facts remain better suited to runtime context. Adapters that flatten instructions can invalidate the leading prompt, and user-role reminders do not acquire system authority. Proxies that rewrite or reorder messages can also defeat the intended instruction order or cache reuse.
## Testing
## Verification
Lifecycle verification requires no event for an unchanged prompt and an appended changed prompt after resume on a capable route. Both TypeScript and Python SDK expected outputs must include the typed appended `system/message` event, as required by the [SDK snapshot policy](../../../../docs/testing.md). The [TypeScript SDK notifications](../../../../snapshots/sdk/system-prompt-in-history/notifications.expected.jsonl) and [Python SDK prompt history](../../../../scripts/snapshots/python-sdk-single-exe/minimal-in-history/prompt-history.json) record the appended prompt event and retained prompt versions.
- `packages/core/agent-loop/tests/system-prompt-admission.spec.ts` covers capable-to-incapable routing with changed or unchanged text, incapable-to-capable routing, resumed-route admission, cancellation in request middleware or preparation, and a concurrent selection change while the prepared route stays bound. Retry-compaction cases shadow the latest prompt with or without an earlier surviving update and verify reuse of the admitted assembly, one user admission, and no extra series header on an unchanged retry. Clear cases on capable and incapable routes remove three active prompt versions, keep repeated requests and seeded resume empty without extra prompt events, and restore only the new text; log reconstruction and the pi converter retain no old instructions. Focused coverage of `src/agent.ts` and `src/runtime-context.ts` reaches 100% for statements, branches, functions, and lines.
- `packages/core/agent-loop/tests/system-prompt-projection.spec.ts` pins the append on a continuing series, the re-baseline at a series start with or without surviving later nodes and with changed or unchanged effective text, the empty-prompt clearing of all active versions, and the replace-only behaviour without the capability.
- `packages/core/agent-loop/tests/request-reconstruction.spec.ts` pins the appended node under an inherited header with `request/context` carrying `systemPromptUpdate`, the series-start fold into node 0, the compaction-driven re-baseline, and the tool-schema change re-baseline on a route without `toolUpdate`, under a `change` header that starts a series.
- `packages/llm/llm/tests/service.spec.ts`, `packages/llm/llm-deepseek/tests/adapter.spec.ts`, and `packages/test-support/llm-replay/tests/llm-replay.spec.ts` pin the declared mode on resolved model info and the load-time rejection of any other value.
- `packages/llm/token-meter/tests/context-breakdown-projection.spec.ts` pins newest/middle prompt removal, exact heuristic totals, surface ordering after head rewrites, extra source-event citations, dormant empties and fallback clears, immutable transitions, compact retained checkpoints, late registration, replay, and version invalidation.
- `packages/client/ui-conversation`, `ui-chat`, and `ui-trajectory` client specs pin the update card, the same-step header dedupe, the absent system change after an update, and the synthetic trajectory header.
- The keyless authored snapshot `snapshots/session/system-prompt-in-history/` declares the capability on the replay route, changes the prompt after the first tool call through a fixture section, and pins the appended `system/message`, the untouched node 0, the single `request/header`, and the `request/context` mode.
- `packages/llm/llm-deepseek/tests/adapter.e2e.ts` runs a two-step prompt change against the model named by `DEEPSEEK_IN_HISTORY_MODEL`, asserts that the reply follows the appended prompt, and asserts that the appended request reads more cached tokens than the same conversation with a rewritten leading prompt; it skips when the variable is unset.
Loop and request-reconstruction tests cover route changes, resume, cancellation, fixed retry assemblies, rebuilding after compaction and unchanged prefixes. Client tests cover update cards, header deduplication, historical prefix inspection and incomplete-history withholding. Accounting tests cover retained system nodes, replacements and replay. TypeScript and Python SDK expected outputs include appended typed system events, while keyless recorded sessions pin instructions in conversation order. Real-API adapter coverage uses `DEEPSEEK_IN_HISTORY_MODEL` to check following an appended update and compare provider cache reuse with a rewritten leading prompt; it skips without that setting. These live-provider checks remain necessary because metadata cannot establish model behavior.
@@ -1,98 +1,49 @@
# Agent Note: 历史内系统提示词替换,实现缓存稳定的提示词变更
# Agent Note: 历史内系统提示词更新
Status: implemented
[English](2026-09-02-in-history-system-prompt-replacement.md) | 中文
## Problem
## 问题
每一次系统提示词变更都要付出整个提供方前缀缓存的代价。循环在每个步骤渲染提示词;一旦字节不同——plan 模式片段进入或退出、某个 skill 或工具指引片段完成注册、agent 作用域的 persona 遮蔽、`{{model}}` 变量改变——请求的消息 0 随之改变,DeepSeek 上下文缓存从第一个 token 起失效。长时间的 agent 会话反复为此付费,而[运行时上下文快照设计](../../archived/feature/2026-07-30-current-sandbox-policy-context.md)之所以存在,正是因为把会变化的事实移出提示词是保持前缀稳定的唯一办法。
计划指导、工具、persona 或模型变量变化时重写开头提示词,会从第一个 token 起使提供方前缀失效。后续指令消息可以保留此前的对话前缀,但其表示取决于模型能力。[表面节点决策](../architecture/2026-09-02-system-prompt-as-surface-node.zh.md)让其原始位置持久保存。
一个 DeepSeek 模型——在此按为本项工作提供的模型事实记录——移除了这一限制:它接受对话任意位置的 `system` 消息,并把最新一条视为完整的有效系统提示词,替换最前面那条。工具 schema 仍属于被缓存的前缀;[动态工具更新](../architecture/2026-09-20-dynamic-tool-updates.zh.md)可以延迟新增声明,而保留定义的变化仍使复用失效。有了这样的模型,harness 可以把新提示词追加到已缓存的历史之后而不是重写消息 0,前缀就能保持热态。
## 决策
因为[系统提示词是 surface 第 0 号节点](../architecture/2026-09-02-system-prompt-as-surface-node.zh.md),harness 拥有实现这一点的表示:提示词变更是对 `system/message` surface 节点的操作,而「替换最新的系统节点」与「追加新节点」之间的选择是逐路由的决定。
保留缓存的选择保持不变:在指令进入对话时记录它们,而非例行移到对话开头。[按段更新](../architecture/2026-10-21-section-based-system-updates.zh.md)取代了原先按路由限制的整份提示词规则。它在所有路由上追加变化的来源文本与显式通知;循环不会把最新系统消息视为整份提示词,也不会因为不支持原生更新而合并。[压缩](../architecture/2026-11-09-deferred-system-compaction.zh.md)提供显式合并时机,而[未变指令的新序列](../bug-fix/2026-10-22-series-start-unchanged-prompt-prefix.zh.md)保留既有指令位置。
## Decision
`systemPromptUpdate = 'in-history'` 仍是解析后模型信息和已准备调用声明的模型能力,并记录在请求上下文中。目录校验该值;模型名称或协议族不隐含支持。此声明描述原生表示,而非是否允许准入分段增量。适配器通过原生消息、合并系统字段或 [pi-ai 提醒回退](../architecture/2026-10-19-pi-ai-system-reminder-fallback.zh.md)保留全部指令。实际绑定的已准备调用决定序列化,而非此前的请求上下文快照。
对于声明了该能力的模型路由,当渲染后的提示词变化且前缀本可存活时,循环追加一个新的 `system/message` surface 节点而不是替换最新的系统节点。[surface 节点决策](../architecture/2026-09-02-system-prompt-as-surface-node.zh.md)中的其他一切不变:事件类型、投影的拥有者、序列化器,以及第 0 号节点的头部保护。
指令和用户提交发生在开放步骤内,成功完成请求中间件及准备之后。取消任一准备阶段都会使其保持未提交。新指令位于新准入用户之前。重试不重跑组装、步骤前选择或用户准入;压缩后,下一次尝试根据同一批已捕获段重建指令。恢复保留已提交指令并追加变化,因为进程重启本身不必使提供方缓存失效。
### 能力
### 展示与计量
`dsh-llm` 定义 `SystemPromptUpdate = 'in-history'`,并把它作为可选的并列字段 `systemPromptUpdate` 放在 `LlmResolvedModelInfo` 与 `PreparedLlmCall` 上;`normalizeModelInfo` 用代码为 `INVALID_MODEL_INFO` 的 `LlmError` 拒绝任何其他值。DeepSeek 适配器的目录模型(`DeepSeekCatalogModel.systemPromptUpdate`,加载时由 zod 校验)与回放提供者的 `ReplayModelConfig.systemPromptUpdate` 逐模型声明它;缺省表示该模型需要重写消息 0。`dsh-llm-deepseek` 仅内置 `deepseek-flash` 条目,在该条目上声明它,同时声明文本和图片输入。该精确目录条目记录模型能力;名称和协议类别不能推导其他模型是否支持。部署方可以通过 `cordis.yml` 的 `models` 列表替换目录,所有 `dsh-llm-pi-ai` 路由保持替换行为。
Chat 将后续非空系统节点显示为折叠的更新卡片,避免在同一步骤的请求头中重复。Trajectory 可将它表示为合成的请求头事实。请求头配置和工具独立于指令变化;只比较真实请求头会漏掉中间的系统更新。若已加载窗口没有更早的系统节点,该节点显示为初始提示词。面向人的 transcript(文本记录)省略系统消息。
循环把该模式记录进会话:`RequestContext.systemPromptUpdate` 与 provider、model、容量并列成为 `request/context` 的字段,其中任一项与最新快照不同时就记录一次。准入读取 `agent/request` 之后实际准备调用的 `PreparedLlmCall.systemPromptUpdate`;先前快照不是准入输入。因此首次请求、恢复的会话、路由变更以及同一路由的能力变更,都使用将服务该调用的绑定适配器的能力。
请求提示词检查使用按存活对话位置排序的不可变前缀状态,而非仅依赖事件序号或来源引用。头节点重写可以在更靠后位置的更新之后才记入日志;替换可以移除系统节点。空节点保持可寻址,不会抹去其他保留文本。当替换端点早于已知窗口且其位置未知时,检查会隐藏后续提示词文本,直到向前补载重放解析缺失前缀。数字事件顺序无法安全猜测位置。历史卡片保留各自的前缀状态。
### 决策规则
Token 构成将每条存活系统消息计入系统 token。[紧凑计量状态](../architecture/2026-10-13-context-breakdown-system-prompt-state.zh.md)保留系统节点和运行总量,而非逐消息计量条目。提供方的 `cacheReadTokens` 仍是可观察的缓存信号;增量准入和原生支持元数据都不保证缓存命中。
`packages/core/agent-loop/src/runtime-context.ts` 中的 `SystemPromptProjection.project(rendered, { inHistory, startsSeries })` 每次调用都扫描当前 surface 上存活的 `system/message` 节点。它返回有序的逐节点提交。没有存活的系统节点时,即使渲染文本为空也预留头节点。有效文本取自最新的非空系统节点,没有时回退到头节点;未生效的空尾节点既不提供有效文本,也无需再次以空内容替换。无论路由或序列状态如何,空渲染文本都会清除每个生效的系统节点。面对非空渲染文本,不具备能力的路由或有效文本不同的新请求序列执行归并;新序列开始时若最新存活节点已经持有该渲染文本,则不产生事件并保留该节点。除此之外,有效文本相同时不产生事件。有效文本未变的新序列由[系列开始前缀决策](../bug-fix/2026-10-22-series-start-unchanged-prompt-prefix.zh.md)拥有。具体操作如下:
## 考虑过的替代方案
| 路由能力 | 前缀状态 | 操作 |
|---|---|---|
| 无 | 非空渲染文本,任意前缀状态 | 为每个非空的后续系统节点记录空内容替换,随后按需用渲染文本重写首个系统节点 |
| `in-history` | 当前请求序列延续 | 在该步骤的 `user/message` 事件之前追加新的 `system/message`;仅追加本身不需要记录 `request/header` |
| `in-history` | 非空渲染文本,新序列开始且最新有效文本不同 | 为非空的后续系统节点记录空内容替换,再按需重写首个系统节点 |
| `in-history` | 非空渲染文本,新序列开始但渲染文本已经是当前文本 | 不产生操作:存活节点保持在已缓存历史携带它的位置 |
| 任意 | 渲染后的提示词为空 | 为非空的后续系统节点记录空内容替换,再按需清空头节点;派生消息中不保留任何提示词版本 |
**按路由限制的整份提示词替换。** 原设计把最新系统消息视为完整提示词,并据此拒绝分段增量。规范的逐来源记录与显式替换或退役通知让新增内容无需该解释即可成立;适配器回退在其他路由保留这些内容。因此,原先的新序列和不支持路由合并规则并非当前行为。
`startsSeries` 在以下情况为真:`agent/pre-step` 决定声明了 `startsRequestSeries`、surface 的替换代数自上次请求以来发生了移动(压缩或任何其他替换)、不支持 `toolUpdate` 的路由上可见工具 schema 集合发生了变化。受支持的工具添加可以与提示词追加一起发生,无需开启新序列。仅 provider 或 model 切换对本规则不算序列开始:目标路由具备能力时,变更后的提示词被追加,这不花任何代价,因为路由变更本身已经使缓存未命中。序列开始本身并不必然使整段提供方前缀作废:替换或图片省略决定可能只使尾部失效,因此归并会等到有效文本必须移动时才执行;此时借助该序列只保留当前提示词,并避免重试时在已接纳的用户消息之后追加指令。有日志记录的逐节点空内容替换会从派生消息中移除后续提示词,无需 surface 删除操作,也不替换其间的对话节点。这也使压缩恢复不会在失败尝试已接纳的用户消息之后追加系统更新。
**部署开关取代原生能力声明。** 开关可能错误描述选定模型能接受的内容。即使能力不再限制分段准入,它仍由模型负责声明。
首次尝试在组装、被接纳的 `agent/pre-step` 决策、`step/start`、`agent/request` waterfall 与 `prepareCall()` 之后才接纳提示词。被拒绝或为空的首次输入不打开步骤。两个异步请求阶段都不提交待处理的系统提示词与已接纳用户消息,在任一阶段取消都不会提交这两者。每次尝试都在各自的 `agent/request` 与 `prepareCall()` 之后同步协调同一份已渲染组装结果、仅在首次尝试追加已接纳用户批次、按需记录 header/context、派生并冻结请求,再通过同一个已准备调用发起流式请求。重试不重复组装、`agent/pre-step` 或用户消息准入。协调过程可见 pre-step 压缩(`auto: true` 的 `compaction-basic`)与恢复压缩,并在任一种压缩开启有效文本不同的新序列时将非空提示词文本归并到头部。恢复属于序列延续——`resume` header 不是序列开始——因此跨重启发生变化的提示词被追加;提供方缓存在进程边界之后可能仍是热的。
**始终追加,或在每次新序列或恢复时合并。** 无限追加会保留陈旧头文本并占用上下文;压缩提供合并。局部替换可以保留大部分有效前缀,重启也可以保留热的提供方缓存,因此两者本身都不足以移动指令。模型切换同样无需在已记录路由变化之外增加特殊合并规则。
空头节点且没有生效的后续系统节点表示没有提示词。未生效的空尾节点不提供有效文本,因此重复清除与恢复会话都不会使旧提示词重新生效。重新提供非空文本使用同一准入规则:延续中的具备能力路由可以追加它;不具备能力的路由或新序列则重新填充头节点。清除使用普通的逐节点替换,而非 surface 删除或初次创建空头节点。
**在步骤前处理与请求准备之前提交,或将更新放在新用户之后。** 提前提交可能准入已取消内容,或漏掉移除了更新所比较指令的压缩。将更新放在用户之后会颠倒既有的指令先于输入顺序。捕获可以更早发生,但比较和提交必须晚于任何压缩并早于请求派生。
### 呈现与记账
**用此前请求上下文决定当前表示。** 它描述前一次调用,对首次调用、恢复的 Session 或路由变化可能不适用。实际绑定的适配器负责当前序列化。
Web 在追加的历史内节点自己的位置呈现它。`SystemPromptNode` 携带 `{ seq, time, turn, step, text, update }`,其中 `update` 对已加载窗口内跟在更早系统节点之后的追加 `system/message` 为真。Chat 把非空的更新渲染为一张折叠的 `system-prompt` 卡片,标题取自 locale 键 `message.systemPromptUpdate`,同一 turn 与 step 内的 `request/header` 不会重复提示词卡片;`inspectRequestPrompt` 对跟在更新之后的 header 不报告系统变更。Trajectory 把跟在已加载请求 header 之后的更新折叠为一条合成的请求 header 事实,`promptChange.kind = 'system'`,因此之后的请求无需真实的 header 变更就能显示有效提示词。已加载窗口缺少更早的系统节点时,更新按初始提示词呈现。转录投影像对待所有 `system/message` 一样跳过它。
**合并时只清除最新系统节点。** 更早的指令仍会保留,并可能重新生效。重建先清除保留的新增内容,再替换初始头节点,保留中间对话。
`dsh-token-meter` 把 surface 顺序中最后一个非空且存活的系统节点计入 `contextBreakdown.systemTokens`;其余可见节点(包括被取代的提示词)计入 `messageTokens`。休眠空节点被忽略。该单元只保留存活的系统提示词和一个 surface 运行总量,并依据紧邻的影子价事件为替换定价([系统提示词状态](../architecture/2026-10-13-context-breakdown-system-prompt-state.zh.md))。后续 assistant 用量中的 `cacheReadTokens` 仍是可观察的提供方缓存效果。
**只保留标量计量总量。** 替换价格无法识别消失了哪些系统节点。仅保留这些节点并使用影子价格元数据,无需逐消息检查点即可分类。
Trajectory 选择前一条真实 header 与前一条合成系统 header 中较新的一个作为比较状态。真实 header 拥有配置与工具;追加的提示词可以在没有另一条真实 header 时推进该状态。只比较真实 header 会在 A → B → C 序列中把 A 而不是 B 报告为先前提示词。
## 影响
Chat 与 Trajectory 通过纯操作 `uiConversation.inspectSystemPrompt` 解释有效提示词。每个 target 为系统事件与位置替换保留不可变的前缀状态,其中只包含存活系统节点,以及将存活替换序号映射到继承 surface 位置的映射表。每次替换复制该表并删除被遮蔽的条目;历史前缀映射表保持不可变。普通追加与流式更新无需折叠提示词。节点是否存活由 surface 顺序决定,而不是事件顺序或来源引用:压缩可以在没有另一个系统事件的情况下恢复更早的提示词,头部重写的序号也可能大于更后位置的有效提示词。空节点仍可被定位,但不会覆盖非空提示词。早于最早已加载相关事件的端点,其顺序未知,除非已有替换位置索引。遇到这样的端点后,解释器会暂停公开之后的所有提示词文本,直到向前补页回放解析缺失的前缀;事件序号顺序不能确定 surface 顺序。历史卡片保留自己的前缀状态,而不是读取最终 surface。
追加更新可能保留提供方前缀,但每项保留更新在合并或移除前都会消耗输入 token。频繁变化的事实仍更适合运行时上下文。将指令展平的适配器可能使开头提示词失效,而用户角色提醒不会获得系统权限。重写或重排消息的代理也可能破坏预期指令顺序或缓存复用。
### 压缩
## 验证
`compaction-basic` 不变。`selectCompactableRange` 仍锚定在第一个非系统节点,因此第 0 号节点永不被遮蔽,更后的历史内节点则可能被遮蔽;`buildSummarizationInput` 将派生的头节点前置到 `messages`,再按 surface 顺序加入每个被遮蔽节点的派生消息,因此区域中途的系统节点在原位被回放,摘要调用仍是对话的真实前缀。
## Alternatives considered
**只发送变化的片段作为增量。** 模型把最新的系统消息当作完整提示词,因此增量会静默丢掉每个未变化的片段。基于模型约定被否决。
**用插件配置而不是模型能力启用历史内模式。** 部署标志可能把不具备能力的模型与追加的系统消息配对,这样的模型最多把它们当作普通历史。该能力属于兑现它的路由;适配器目录已经承载逐模型的容量信息。被否决。
**永远追加,从不重新基线化。** 规则单一,但第 0 号节点会在会话整个生命周期内保持过时,压缩之后的每个请求都要携带过时的头部加替换消息。在序列开始处重新基线化不花额外代价,因为缓存在那里已经丢失。被否决。
**每次恢复都重新基线化。** 为更简单的恢复路径接受每次进程重启一次缓存未命中。缓存跨重启持续数小时到数天,而日志已经承载恢复所需的一切。被否决。
**把系统消息放在该步骤的用户消息之后。** 两个位置都在已缓存前缀之后,但模型会在读到必须应用指令的输入之后才读到指令;system 在 user 之前与最前位置的顺序一致。被否决。
**在 `agent/pre-step` waterfall 之前投影提示词。** 投影将看不到在该 waterfall 内执行的压缩,刚追加的节点可能在同一步骤内被遮蔽,请求就会把第 0 号节点的过时提示词作为唯一的系统消息携带。在 waterfall 之后投影让规则保持为构建请求所用 surface 的纯函数。被否决。
**用先前的请求上下文决定准入。** 它描述上一次调用,而非请求中间件之后绑定的适配器。在首次调用、恢复之后、路由或能力变更之后,它可能选错提示词表示。在提交提示词与用户消息之前解析,还能防止取消时接纳未发送的内容。被否决。
**把 provider 或 model 切换视为序列开始。** 它会在每次路由变更时把提示词折回第 0 号节点,与不具备能力的路由上的工具变更情形一致。header 已经记录了该变更,缓存无论如何都会未命中,因此这条额外规则除了在循环中多一个特例之外没有任何收益。被否决。
**仅清除最新系统节点。** 空节点不投影为消息,因此更早的提示词会重新生效。清除所有生效版本才能保留空渲染文本的含义,同时不删除对话历史。被否决。
**只保留标量总量。** 标量影子价无法判断最新提示词从哪个分类消失,也无法恢复其前一个版本。把所有存活提示词之和归入系统数字会改变有效提示词的含义,而不是修复分类。保留系统提示词并结合影子价事件的 `shadowedSeqs` 可以回答这两个问题;[系统提示词状态说明](../architecture/2026-10-13-context-breakdown-system-prompt-state.zh.md)记录了为何以这种方式取代位置条目。
## Consequences
- 具备能力的路由上的提示词变更保住提供方前缀缓存;追加的节点在该序列的每个请求上付出自身的 token 开销,直到压缩遮蔽它。提示词在多数步骤都变化的部署,更适合把那个事实移入运行时上下文。
- 请求头部不是系统提示词唯一可能的位置:「模型看到了什么」的读者折叠 surface 并取最新的系统节点,明细的系统数字遵循同一规则。
- `request/context` 快照记录已准备的路由与声明模式;它描述准入结果,而不决定准入。不具备能力的路由逐系统节点记录归并,保留其间的用户、assistant 与工具历史。
- 模型约定按所提供的内容记录。若发布的模型收窄了约定——例如只在有界窗口内兑现最新的系统消息——规则需要序列开始之外的重新基线化触发条件。
- 重写或重排系统消息的代理会静默破坏替换语义;真实 API e2e 的缓存命中断言是探测器。
## Testing
生命周期验证要求:提示词未变更时不产生事件,具备能力的路由在恢复后追加变更后的提示词。TypeScript 与 Python SDK 的期望输出都必须包含带类型的追加 `system/message` 事件,遵循 [SDK 快照策略](../../../../docs/testing.zh.md)。[TypeScript SDK 通知](../../../../snapshots/sdk/system-prompt-in-history/notifications.expected.jsonl)与 [Python SDK 提示词历史](../../../../scripts/snapshots/python-sdk-single-exe/minimal-in-history/prompt-history.json)记录了追加的提示词事件与保留的提示词版本。
- `packages/core/agent-loop/tests/system-prompt-admission.spec.ts` 覆盖文本变化或未变时从具备能力切换到不具备能力的路由、反向路由切换、恢复时的路由准入、请求中间件或准备阶段取消,以及已准备路由保持绑定时并发选择发生变化。重试压缩用例覆盖遮蔽最新提示词后有或没有更早更新存活的情况,并验证复用已接纳的组装结果、用户消息仅接纳一次,以及未变的后续重试不会多记序列 header。具备和不具备能力路由的清除用例会移除三个生效提示词版本,验证重复请求与带 seed 的恢复保持为空且不多记提示词事件,并仅恢复新文本;日志重建与 pi 转换器都不保留旧指令。`src/agent.ts` 与 `src/runtime-context.ts` 的聚焦覆盖率在语句、分支、函数和行四项均达到 100%。
- `packages/core/agent-loop/tests/system-prompt-projection.spec.ts` 钉住序列延续时的追加、序列开始时无论是否存在后续存活节点、有效文本是否变化都执行的重新基线化、空提示词对所有生效版本的清除,以及不具备能力时只做替换的行为。
- `packages/core/agent-loop/tests/request-reconstruction.spec.ts` 钉住继承 header 下追加的节点及携带 `systemPromptUpdate` 的 `request/context`、序列开始时折回第 0 号节点、由压缩驱动的重新基线化,以及在不支持 `toolUpdate` 的路由上、开启序列的 `change` header 下由工具 schema 变更驱动的重新基线化。
- `packages/llm/llm/tests/service.spec.ts`、`packages/llm/llm-deepseek/tests/adapter.spec.ts` 与 `packages/test-support/llm-replay/tests/llm-replay.spec.ts` 钉住已解析模型信息上声明的模式,以及加载时对任何其他值的拒绝。
- `packages/llm/token-meter/tests/context-breakdown-projection.spec.ts` 钉住最新与中间提示词移除、精确启发式总量、头部改写后的 surface 顺序、额外来源引用、休眠空节点与回退清空、不可变转换、紧凑保留检查点、延迟注册、重放和版本失效。
- `packages/client/ui-conversation`、`ui-chat` 与 `ui-trajectory` 的客户端测试钉住更新卡片、同一步骤 header 的去重、更新之后不存在系统变更,以及合成的轨迹 header。
- 无密钥的手写快照 `snapshots/session/system-prompt-in-history/` 在回放路由上声明该能力,通过 fixture 片段在第一次工具调用之后改变提示词,钉住追加的 `system/message`、未被触及的第 0 号节点、唯一一条 `request/header` 以及 `request/context` 中的模式。
- `packages/llm/llm-deepseek/tests/adapter.e2e.ts` 针对 `DEEPSEEK_IN_HISTORY_MODEL` 指定的模型运行两个步骤并夹带一次提示词变更,断言回复遵循追加的提示词,并断言追加后的请求比同一对话在重写最前提示词时读取更多的缓存 token;该变量未设置时跳过。
循环和请求重建测试覆盖路由变化、恢复、取消、固定重试组装、压缩后重建及不变前缀。客户端测试覆盖更新卡片、请求头去重、历史前缀检查及历史不完整时的隐藏。计量测试覆盖保留系统节点、替换和重放。TypeScript 与 Python SDK 的预期输出包含追加的类型化系统事件,无需密钥的已记录 Session 则固定对话顺序中的指令。真实 API 适配器覆盖使用 `DEEPSEEK_IN_HISTORY_MODEL` 检查模型遵从追加更新,并比较它与重写开头提示词的提供方缓存复用;未配置时跳过。这些真实提供方检查仍有必要,因为元数据不能证明模型行为。
+3
View File
@@ -1,6 +1,9 @@
# Minimal keyless composition for loading example MCP overlays against the
# package-owned fixture server in memory-mcp-configs.spec.ts. Source builtins
# keep this unit test independent of prebuilt workspace artifacts.
- id: session-projection
name: cordis:memory-test-session-projection
- id: system-prompt
name: cordis:memory-test-system-prompt
@@ -11,6 +11,7 @@ import { afterEach, describe, expect, it } from 'vitest'
import type { Context } from '@deepseek-ai/cordis'
import type { PatchOptions } from '@deepseek-ai/cordis-plugin-include'
import { boot, loadOverlayPatches } from '@deepseek-ai/dsh-app-boot'
import SessionProjectionRegistry from '@deepseek-ai/dsh-session-projection'
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
import ToolRuntime from '@deepseek-ai/dsh-tools'
import * as McpClient from '@deepseek-ai/dsh-mcp-client/src/index.ts'
@@ -122,6 +123,7 @@ describe('third-party memory MCP example overlays', () => {
[...patches, fixturePatch],
(ctx) => {
liveContexts.add(ctx)
ctx.loader.builtins['memory-test-session-projection'] = SessionProjectionRegistry
ctx.loader.builtins['memory-test-system-prompt'] = SystemPrompt
ctx.loader.builtins['memory-test-tools'] = ToolRuntime
ctx.loader.builtins['memory-test-mcp-client'] = McpClient
@@ -6,7 +6,7 @@
{"type":"turn/start","data":{"turn":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:apply_patch","order":1350,"state":"active","contentIndex":6},{"name":"tool:glob","order":1400,"state":"active","contentIndex":7},{"name":"tool:grep","order":1500,"state":"active","contentIndex":8},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":9},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":10},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":11},{"name":"tool:goal","order":2400,"state":"active","contentIndex":12},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":13},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":14}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Create a durable two-round goal for the ACP snapshot, inspect it, then report readiness."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}
@@ -6,7 +6,7 @@
{"type":"turn/start","data":{"turn":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:apply_patch","order":1350,"state":"active","contentIndex":6},{"name":"tool:glob","order":1400,"state":"active","contentIndex":7},{"name":"tool:grep","order":1500,"state":"active","contentIndex":8},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":9},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":10},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":11},{"name":"tool:goal","order":2400,"state":"active","contentIndex":12},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":13},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":14}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Create a durable goal for the wrap-up snapshot, then report readiness."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}
@@ -50,6 +50,7 @@ describe.skipIf(!process.env.DEEPSEEK_API_KEY)('compaction: a long session compa
},
persistenceRoot: join(workdir, '.sessions'),
})
expect(ctx.get('compaction'), 'the compaction service is active before model requests').toBeDefined()
const agent = await ctx.agentLoop.create(brandString<SessionId>('e2e-compaction'), { provider: 'deepseek-official', model: 'deepseek-v4-flash' }, { cwd: workdir })
// Completed read turns cannot collapse into one retained parallel tool group.
@@ -2,7 +2,7 @@
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"turn/start","seq":4,"time":0,"data":{"turn":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"agent/inbox/spliced","seq":5,"time":0,"data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"step/start","seq":6,"time":0,"data":{"turn":1,"step":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":8,"time":0,"data":{"content":[{"type":"text","text":"Probe strict-schema fillers against missing-goal revision 1, then create a durable goal to finish the snapshot proof and inspect it."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":9,"time":0,"data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"request/header","seq":10,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}}
@@ -6,7 +6,7 @@
{"type":"turn/start","data":{"turn":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Prove the product headless profile path with one real tool round trip."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"cli-mock","model":"cli-mock","reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true},"tools":"{{tools}}"},"reason":"initial"}}
@@ -2,7 +2,7 @@
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"turn/start","seq":4,"time":0,"data":{"turn":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"agent/inbox/spliced","seq":5,"time":0,"data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"step/start","seq":6,"time":0,"data":{"turn":1,"step":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":8,"time":0,"data":{"content":[{"type":"text","text":"say pong"}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":9,"time":0,"data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"request/header","seq":10,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":"{{tools}}"},"reason":"initial"}}}
@@ -2,7 +2,7 @@
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"turn/start","seq":4,"time":0,"data":{"turn":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"agent/inbox/spliced","seq":5,"time":0,"data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"step/start","seq":6,"time":0,"data":{"turn":1,"step":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":9},{"name":"tool:goal","order":2400,"state":"active","contentIndex":10},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":11},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":12}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":8,"time":0,"data":{"content":[{"type":"text","text":"say pong"}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":9,"time":0,"data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"request/header","seq":10,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":"{{tools}}"},"reason":"initial"}}}
@@ -2,7 +2,7 @@
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"turn/start","seq":4,"time":0,"data":{"turn":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"agent/inbox/spliced","seq":5,"time":0,"data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"step/start","seq":6,"time":0,"data":{"turn":1,"step":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":8,"time":0,"data":{"content":[{"type":"text","text":"retry the transient provider failure"}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":9,"time":0,"data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"request/header","seq":10,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}}
@@ -16,7 +16,7 @@
{"type":"turn/start","data":{"turn":2}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":2,"step":1}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}],"reset":true},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"user/message","data":{"content":[{"type":"text","text":"Continue safely from the interrupted operation."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial","startsSeries":true}}
@@ -14,7 +14,7 @@
{"type":"turn/start","data":{"turn":2}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":2,"step":1}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}],"reset":true},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"user/message","data":{"content":[{"type":"text","text":"Call list_agents once and report what it shows."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial","startsSeries":true}}
@@ -6,7 +6,7 @@
{"type":"turn/start","data":{"turn":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:apply_patch","order":1350,"state":"active","contentIndex":6},{"name":"tool:glob","order":1400,"state":"active","contentIndex":7},{"name":"tool:grep","order":1500,"state":"active","contentIndex":8},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":9},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":10},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":11},{"name":"tool:goal","order":2400,"state":"active","contentIndex":12},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":13},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":14}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Agent lead sent a message: "},{"type":"text","text":"Use the write tool exactly once with file_path set to exactly the relative path inherited.txt and content escaped. If the write is denied, reply with the single word CHILD_DENIED and the denial marker line; do not retry and do not request escalation. If it succeeds, reply CHILD_WROTE."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"agent-message","form":"relay","senderSessionId":"{{sessionId}}"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Messages from other agents begin with \"Agent <name> sent a message:\". Other user messages come from the human user, who reads this conversation directly. You can still message other agents to coordinate, but answer the human user in your reply.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Messages from other agents begin with \"Agent <name> sent a message:\". Other user messages come from the human user, who reads this conversation directly. You can still message other agents to coordinate, but answer the human user in your reply."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","reasoningEffort":"low"},"tools":"{{tools}}"},"reason":"initial"}}
@@ -14,7 +14,7 @@
{"type":"turn/start","data":{"turn":2}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":2,"step":1}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:apply_patch","order":1350,"state":"active","contentIndex":6},{"name":"tool:glob","order":1400,"state":"active","contentIndex":7},{"name":"tool:grep","order":1500,"state":"active","contentIndex":8},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":9},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":10},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":11},{"name":"tool:goal","order":2400,"state":"active","contentIndex":12},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":13},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":14}],"reset":true},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"user/message","data":{"content":[{"type":"text","text":"Delegate the write probe to a subagent."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","reasoningEffort":"low"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"resume","startsSeries":true}}
@@ -6,7 +6,7 @@
{"type":"turn/start","data":{"turn":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Agent lead sent a message: "},{"type":"text","text":"Reply with exactly CHILD_RESULT and nothing else. Do not call send_message."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"agent-message","form":"relay","senderSessionId":"{{sessionId}}"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Messages from other agents begin with \"Agent <name> sent a message:\". Other user messages come from the human user, who reads this conversation directly. You can still message other agents to coordinate, but answer the human user in your reply.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Messages from other agents begin with \"Agent <name> sent a message:\". Other user messages come from the human user, who reads this conversation directly. You can still message other agents to coordinate, but answer the human user in your reply."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}
@@ -2,7 +2,7 @@
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"turn/start","seq":4,"time":0,"data":{"turn":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"agent/inbox/spliced","seq":5,"time":0,"data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"step/start","seq":6,"time":0,"data":{"turn":1,"step":1}}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"system/message","seq":7,"time":0,"data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}]},"id":"{{sessionId}}"}},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":8,"time":0,"data":{"content":[{"type":"text","text":"Start one continuable subagent and acknowledge its completion notice. Do not call list_agents or send_message."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"user/message","seq":9,"time":0,"data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"request/header","seq":10,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}}
@@ -14,7 +14,7 @@
{"type":"turn/start","data":{"turn":2}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":2,"step":1}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}],"reset":true},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"user/message","data":{"content":[{"type":"text","text":"Acknowledge the current workspace instruction."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nUpdated instructions from: AGENTS.md\n\nThis file changed after it was loaded. Use the following content instead of the previously loaded instructions from this file.\n\nNew workspace instruction after offline edit.\n\n</system-reminder>"}],"source":{"kind":"agent-instructions","form":"instructions","changes":[{"action":"replace","scope":".\u0000AGENTS.md","path":"AGENTS.md","digest":"d8375b516f158718bd3463bc8eb7ed42c011b29f"}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
@@ -14,7 +14,7 @@
{"type":"turn/start","data":{"turn":2}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":2,"step":1}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"},{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt","sections":[{"name":"harness:identity","order":-1000,"state":"active","contentIndex":0},{"name":"deployment:persona-prefix","order":0,"state":"active","contentIndex":1},{"name":"tool:bash","order":1000,"state":"active","contentIndex":2},{"name":"tool:read","order":1100,"state":"active","contentIndex":3},{"name":"tool:write","order":1200,"state":"active","contentIndex":4},{"name":"tool:edit","order":1300,"state":"active","contentIndex":5},{"name":"tool:glob","order":1400,"state":"active","contentIndex":6},{"name":"tool:grep","order":1500,"state":"active","contentIndex":7},{"name":"tool:jobs","order":1600,"state":"active","contentIndex":8},{"name":"tool:web_search","order":2000,"state":"active","contentIndex":9},{"name":"tool:web_fetch","order":2100,"state":"active","contentIndex":10},{"name":"tool:goal","order":2400,"state":"active","contentIndex":11},{"name":"tool:workflow","order":2600,"state":"active","contentIndex":12},{"name":"tool:subagent","order":2800,"state":"active","contentIndex":13}],"reset":true},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"user/message","data":{"content":[{"type":"text","text":"Acknowledge the current workspace instruction."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThis complete workspace instruction baseline replaces all earlier workspace instruction baselines. The following workspace instructions may be relevant to your work. Use them as guidance when applicable. More specific instructions take precedence over broader ones. They do not override system, developer, or direct user instructions.\n\nInstructions from: AGENTS.md\n\nCurrent AGENTS rule.\n\n\nInstructions from: CLAUDE.md\n\nCurrent CLAUDE rule.\n\n</system-reminder>"}],"source":{"kind":"agent-instructions","form":"instructions","baseline":true,"baselineIdentity":"{\"projectRoot\":\"\",\"projectRootMarkers\":[\".git\"],\"maxBytes\":65536,\"maxSourceBytes\":1048576,\"instructionFileCandidates\":[\"AGENTS.md\",\"CLAUDE.md\"],\"localInstructionFileCandidates\":[\"AGENTS.local.md\",\"CLAUDE.local.md\"]}","changes":[{"action":"set","scope":".\u0000AGENTS.md","path":"AGENTS.md","digest":"7f53d2327837129750aef117f9754a001c46cf68"},{"action":"set","scope":".\u0000CLAUDE.md","path":"CLAUDE.md","digest":"5b1e9e3fd759eee6b43ceff899e47fb10c64701a"}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
@@ -8,6 +8,7 @@ import {
normalizeSessionLog,
normalizeSessionSnapshot,
normalizeSessionSnapshots,
REPLAY_CREDENTIAL_ENV,
normalizeStdout,
scrubModelRequestBulk,
type NormalizeContext,
@@ -394,6 +395,7 @@ describe('headless stream-json snapshots', () => {
binArgs: ['headless', '--patch', headlessOverlayPath, task],
tsconfigPath,
env: {
...REPLAY_CREDENTIAL_ENV,
DSH_PERMISSION_MODE: 'danger-full-access',
DSH_TELEMETRY_DISABLED: '1',
NODE_OPTIONS: [process.env.NODE_OPTIONS, '--disable-warning=ExperimentalWarning'].filter(Boolean).join(' '),
@@ -692,6 +694,7 @@ describe('headless stream-json snapshots', () => {
binArgs: [retryConfigPath, prompt],
tsconfigPath,
env: {
...REPLAY_CREDENTIAL_ENV,
DSH_SNAPSHOT: 'replay',
NODE_OPTIONS: [process.env.NODE_OPTIONS, '--disable-warning=ExperimentalWarning'].filter(Boolean).join(' '),
},
@@ -1318,6 +1321,7 @@ describe('headless stream-json snapshots', () => {
binArgs: [goalConfigPath, prompt],
tsconfigPath,
env: {
...REPLAY_CREDENTIAL_ENV,
DSH_SNAPSHOT: 'replay',
DSH_SNAPSHOT_FILE: join(goalScenarioDir, 'session.jsonl'),
DSH_SNAPSHOT_OVERRIDE: join(goalScenarioDir, 'replay.override.json'),
@@ -1378,6 +1382,7 @@ describe('headless stream-json snapshots', () => {
binArgs: [settlementConfigPath, task],
tsconfigPath,
env: {
...REPLAY_CREDENTIAL_ENV,
// The override fully supplies the parent script; the child fixture
// remains separate so replay binds it to the fresh child Session.
DSH_SNAPSHOT_FILE: parentReplay,
@@ -6,6 +6,7 @@ import {
fixtureContext,
normalizeSessionSnapshot,
normalizeSessionSnapshots,
REPLAY_CREDENTIAL_ENV,
type NormalizeContext,
} from '@deepseek-ai/dsh-session-snapshot'
import { LOADER_SMOKE_TEST_TIMEOUT_MS, runLoaderSmoke } from '@deepseek-ai/dsh-loader-smoke'
@@ -114,6 +115,7 @@ describe('semantic checkpoint recovery snapshot', () => {
binArgs: [configPath, task],
tsconfigPath,
env: {
...REPLAY_CREDENTIAL_ENV,
DSH_SNAPSHOT_FILE: replayFixture,
DSH_SNAPSHOT_OVERRIDE: replayOverride,
},
@@ -11,6 +11,7 @@ import {
fixtureContext,
normalizeSessionSnapshot,
normalizeSessionSnapshots,
REPLAY_CREDENTIAL_ENV,
type NormalizeContext,
} from '@deepseek-ai/dsh-session-snapshot'
import { LOADER_SMOKE_TEST_TIMEOUT_MS, runLoaderSmoke } from '@deepseek-ai/dsh-loader-smoke'
@@ -118,6 +119,7 @@ describe('parent-owned cold child catalog snapshot', () => {
binArgs: [configPath, task],
tsconfigPath,
env: {
...REPLAY_CREDENTIAL_ENV,
DSH_SNAPSHOT_FILE: replayOverride,
DSH_SNAPSHOT_OVERRIDE: replayOverride,
},
@@ -129,7 +131,10 @@ describe('parent-owned cold child catalog snapshot', () => {
const sessionsDir = join(runCwd, '.sessions')
const files = (await readdir(sessionsDir, { recursive: true })).filter(file => file.endsWith('.jsonl'))
const logs = await Promise.all(files.map(async file => readFile(join(sessionsDir, file), 'utf8')))
const parent = logs.find(content => content.includes('"subagent-diagnostic-parent"'))
const parent = logs.find((content) => {
const header = JSON.parse(content.split('\n')[0]!) as SessionHeader
return header.id === parentId
})
if (parent === undefined) throw new Error('missing persisted parent log')
// Discovery reads child catalogs without requiring activation descriptors.
@@ -128,7 +128,7 @@ describe('parent-only override inheritance snapshot', () => {
const logs = await Promise.all(files.map(async file => readFile(join(sessionsDir, file), 'utf8')))
const headerOf = (content: string): Record<string, unknown> =>
JSON.parse(content.split('\n')[0] ?? '{}') as Record<string, unknown>
const parent = logs.find(content => content.includes('"subagent-inheritance-parent"'))
const parent = logs.find(content => headerOf(content).id === sessionId)
const child = logs.find(content => typeof headerOf(content).parentSession === 'string')
if (parent === undefined || child === undefined) throw new Error('missing persisted parent or child log')
@@ -12,6 +12,7 @@ import {
fixtureContext,
normalizeSessionSnapshot,
normalizeSessionSnapshots,
REPLAY_CREDENTIAL_ENV,
type NormalizeContext,
} from '@deepseek-ai/dsh-session-snapshot'
import { LOADER_SMOKE_TEST_TIMEOUT_MS, runLoaderSmoke } from '@deepseek-ai/dsh-loader-smoke'
@@ -147,6 +148,7 @@ describe('agent-instructions resume snapshot', () => {
binArgs: [configPath, 'Acknowledge the current workspace instruction.'],
tsconfigPath,
env: {
...REPLAY_CREDENTIAL_ENV,
DSH_SNAPSHOT_FILE: replayFixture,
DSH_SNAPSHOT_OVERRIDE: replayOverride,
},
@@ -204,6 +206,7 @@ describe('agent-instructions resume snapshot', () => {
binArgs: [configPath, 'Acknowledge the current workspace instruction.'],
tsconfigPath,
env: {
...REPLAY_CREDENTIAL_ENV,
DSH_SNAPSHOT_FILE: replayFixture,
DSH_SNAPSHOT_OVERRIDE: replayOverride,
},
+1 -1
View File
@@ -469,7 +469,7 @@ describe('the shipped Web composition', () => {
try {
const assembly = await ctx.systemPrompt.assemble({ scope: handle.agent })
expect(assembly.sections).toEqual([
{ name: 'deployment:persona-prefix', text: MINIMAL_PROMPT },
{ name: 'deployment:persona-prefix', order: 0, text: MINIMAL_PROMPT, complete: true },
])
expect(assembly.tools.map(tool => tool.name)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
expect(assembly.tools.find(tool => tool.name === 'bash')?.description).toBe(MINIMAL_BASH_DESCRIPTION)
+2 -1
View File
@@ -34,7 +34,8 @@ it('sends the Creator customization intent without taking actions for an ordinar
expect(agent.session.header.agentPreset).toBe('cordis')
const system = agent.session.deriveMessages().find(message => message.role === 'system')
if (system === undefined) throw new Error('Creator request has no system prompt')
const prompt = system.content.flatMap(block => block.type === 'text' ? [block.text] : []).join('')
// Each section is its own text block; adapters join them with blank lines.
const prompt = system.content.flatMap(block => block.type === 'text' ? [block.text] : []).join('\n\n')
expect(prompt).toMatch(/^You are a coding agent powered by the .+ model\. You help the user customize DeepSeek Harness itself\.$/mu)
expect(prompt.split(CUSTOMIZATION_INTENT)).toHaveLength(2)
const sharedPrompt = prompt.replace(` ${CUSTOMIZATION_INTENT}`, '')
@@ -165,7 +165,7 @@ it.each([{ name: 'Chromium', engine: chromium }, { name: 'WebKit', engine: webki
// while the settings snapshot is loading is dropped. The saved notice is
// published by that reload's completion, so waiting for it also makes the
// reopen below deterministic.
await dialog.getByText('已保存 DeepSeek (deepseek-official)。', { exact: true }).waitFor()
await dialog.getByText('已保存 DeepSeek API (deepseek-official)。', { exact: true }).waitFor()
await expect.poll(() => key.count(), { timeout: 10_000 }).toBe(0)
await edit.click()
expect(await key.getAttribute('placeholder')).toBe('•'.repeat('fixture-new-key'.length))
+6 -1
View File
@@ -289,7 +289,12 @@ describe('minimal manual compaction', () => {
const [initial, , continuation] = requests
if (initial === undefined || continuation === undefined) throw new Error('minimal compaction did not continue')
expect(continuation.messages.flatMap(message => message.content)).toEqual(expect.arrayContaining(summary.data.summary))
expect(continuation.messages[0]).toEqual(initial.messages[0])
expect(continuation.messages[0]).toEqual({
...initial.messages[0],
id: expect.any(String) as string,
source: { ...initial.messages[0]?.source, reset: true },
})
expect(continuation.messages[0]?.id).not.toBe(initial.messages[0]?.id)
expect(continuation.tools).toEqual(initial.tools)
expect(continuation.messages.flatMap(message => message.content)
.some(block => block.type === 'text' && block.text === 'MINIMAL_COMPACT_READY')).toBe(true)
+1 -1
View File
@@ -55,7 +55,7 @@ type SessionListResponse = { result: RemoteResult<SessionListValue> }
/** Rendered text of the system prompt surface node, or undefined when the surface carries none. */
function systemPromptText(session: Session): string | undefined {
const message = session.deriveMessages().find(candidate => candidate.role === 'system')
return message?.content.flatMap(block => block.type === 'text' ? [block.text] : []).join('')
return message?.content.flatMap(block => block.type === 'text' ? [block.text.trim()] : []).filter(Boolean).join('\n\n')
}
describe('web e2e: fresh round trip through the real assembly', () => {
+4 -4
View File
@@ -18,14 +18,14 @@
en: b9eeb18645121a8b
zh: 70d87a12c43e042a
/deepseek-harness-architecture/core-packages:
en: 20ef882e44b06a10
en: 24b3cbbce1d7391f
zh: c10c3934ed5570e9
/deepseek-harness-architecture/events:
en: 0d4481070a0ba352
en: 8b87255d577187a5
zh: 026be77a9f3db68e
/deepseek-harness-architecture/turn-flow:
en: 96ad2d8611fd5b88
zh: 0a6bb22b3b0e1335
en: fd8e639264b820ef
zh: 3d21f61de3571a37
/deepseek-harness-architecture/session-log:
en: b3b63d8fe7cab9fe
zh: 3703fcf30b1639d0
+10 -2
View File
@@ -64,6 +64,8 @@ Electron starts the private Desktop Host in Electron Node mode. The Host invokes
| [`core/scope`](subsystems/scope.md) | The per-agent scoped-registration primitive | library, no key |
| [`llm/llm`](subsystems/llm-streaming.md) | Message and stream vocabulary plus the adapter seam | `ctx.llm` |
<a id="events"></a>
## Events
Events provide extension points in three domains.
@@ -78,6 +80,8 @@ AgentLoop rolls back failed initialization and awaits serial `agent/created` bef
[Event producers and consumers](event-producer-consumer.md).
<a id="turn-flow"></a>
## Turn flow
A **step** is one model request plus the tools it calls. A **turn** is zero or more steps: it opens before its first input is claimed and closes once nothing is owed.
@@ -91,7 +95,7 @@ turn/start
reject, or a first enter rewritten empty -> close the turn with no step
step/start
agent/request -> prepareCall (cancellation commits neither system nor users)
reconcile system/message using the prepared call capability
commit system/message updates; rebuild the system head after compaction
append entered messages as user/message; reconcile retained runtime context
log request/header and request/context as needed
derive and freeze model history from the log
@@ -111,7 +115,11 @@ Fork creation stores the caller-supplied history; a sharing backend persists the
One inbox feeds the driver; injected context waits for a waking message. AgentLoop’s durable `inbox` projection exposes pending input without live Agents.
Before assembly, the loop snapshots Session model selection in `AssembleContext.modelSelection` and `agent/pre-step.modelSelection`; retries retain it; omitted reasoning effort uses adapter defaults. `agent/pre-step` listeners accept, rewrite, or reject claimed messages; a rejected or empty first claim closes a durable turn without a step. An enter decision may set `startsRequestSeries`: the loop logs a fresh `request/header` (reason `series`, or `change` with `startsSeries: true` when the envelope also changed). Wrapping listeners preserve that declaration with `{ ...decision, messages }`. After assembly and `step/start`, the deprecated `agent/request` hook adjusts controls without changing the provider, model, or effort selection, and `prepareCall()` binds the adapter before the system prompt and accepted users are committed; cancellation during either async phase commits neither. Prepared call capabilities govern prompt admission, not preceding `request/context`. Each attempt refreshes registered runtime facts, reconciles the bound prompt, admits users once, reconciles runtime reminders by recorded sections, logs header/context as needed, and freezes the request before streaming the bound call. Retries do not repeat assembly or `agent/pre-step`. Surface replacements and image-offload decisions after attachment start a new request series, including during the first resumed pre-step; unchanged resume continues the series. The system prompt travels as `system/message` history: empty text clears it, capable routes append updates, and other routes consolidate it at the first system node. [Agent-loop](../packages/core/agent-loop/README.md#understand-the-implementation) owns prompt admission and replacement details.
Before assembly, the loop captures Session model selection in `AssembleContext.modelSelection` and `agent/pre-step.modelSelection`; retries retain it; omitted reasoning effort uses adapter defaults. System assembly captures live source values and lifecycle with committed Session admissions, fixing whether to append updates or rebuild the full prompt. `agent/pre-step` listeners accept, rewrite, or reject claimed messages; a rejected or empty first claim closes a durable turn without a step. An enter decision may set `startsRequestSeries`: the loop logs a fresh `request/header` (reason `series`, or `change` with `startsSeries: true` when the envelope also changed). Wrapping listeners preserve that declaration with `{ ...decision, messages }`.
After acceptance and `step/start`, the deprecated `agent/request` hook adjusts controls without changing provider, model, or effort selection; `prepareCall()` binds the adapter. Cancellation during either async phase commits neither system candidates nor accepted users. Every attempt refreshes runtime facts and derives history; the first commits both.
Retries retain their assembly; later source changes wait for the next one. Surface replacements and image-offload decisions start a new request series; unchanged resume continues it. Each attempt appends the assembly’s `systemUpdates()` writes; at the first attempt after a logged compaction summary, including a retry, they clear retained system additions and replace the initial system node with the captured instructions through ordinary `system/message` events. [Agent-loop](../packages/core/agent-loop/README.md#understand-the-implementation) owns request and retry timing.
The loop sends immutable requests with live cancellation and reuses freeze evidence for frozen identities; [agent-loop](../packages/core/agent-loop/README.md) owns construction and cancellation causes.
+6 -2
View File
@@ -95,7 +95,7 @@ turn/start
reject, or a first enter rewritten empty -> close the turn with no step
step/start
agent/request -> prepareCall (cancellation commits neither system nor users)
reconcile system/message using the prepared call capability
commit system/message updates; rebuild the system head after compaction
append entered messages as user/message; reconcile retained runtime context
log request/header and request/context as needed
derive and freeze model history from the log
@@ -115,7 +115,11 @@ fork 创建存储调用方提供的历史;共享前缀的后端先持久化父
输入通过同一个 inbox 到达驱动器;注入的上下文等待一条唤醒消息。AgentLoop 的持久 `inbox` 投影使待处理输入在没有活跃 Agent 时仍可读取。
循环在组装前将 Session 模型选择快照到 `AssembleContext.modelSelection` 与 `agent/pre-step.modelSelection`;重试保留该选择,省略推理强度时使用适配器默认值。`agent/pre-step` 监听器接纳、改写或拒绝已领取消息;首次领取被拒绝或为空时,关闭不含步骤的持久轮次。enter 决策可设置 `startsRequestSeries`:循环记录新的 `request/header`(原因为 `series`,或在封装同时变化时为携带 `startsSeries: true` 的 `change`)。包装监听器通过 `{ ...decision, messages }` 保留该声明。组装与 `step/start` 之后,已弃用的 `agent/request` hook 在不改变提供方、模型或推理强度选择的前提下调整控制参数,`prepareCall()` 绑定适配器,再提交系统提示词与已接纳用户消息;在任一异步阶段取消都不会提交这两者。提示词准入依据已准备调用的能力,而非先前的 `request/context`。每次尝试刷新已注册运行时事实、协调绑定的提示词、仅接纳一次用户消息并按已记录的贡献协调运行时提醒、按需记录 header/context,再冻结请求并通过绑定调用发起流式请求。重试不重复组装或 `agent/pre-step`。附接后的 surface 替换和图片省略决定开启新请求序列,包括恢复后的首次 pre-step 中发生的替换;未变化的恢复延续序列。系统提示词通过 `system/message` 历史传递:空文本清除提示词,具备能力的路由追加更新,其他路由将其归并到首个系统节点。[Agent-loop](../packages/core/agent-loop/README.zh.md#understand-the-implementation) 说明提示词准入与替换的细节。
循环在组装前将 Session 模型选择捕获到 `AssembleContext.modelSelection` 与 `agent/pre-step.modelSelection`;重试保留该选择,省略推理强度时使用适配器默认值。系统组装同时捕获活跃来源值、生命周期与已提交的 Session 准入,由此确定是追加更新还是重建完整提示词。`agent/pre-step` 监听器接纳、改写或拒绝已领取消息;首次领取被拒绝或为空时,关闭不含步骤的持久轮次。enter 决策可设置 `startsRequestSeries`:循环记录新的 `request/header`(原因为 `series`,或在封装同时变化时为携带 `startsSeries: true` 的 `change`)。包装监听器通过 `{ ...decision, messages }` 保留该声明。
接纳并记录 `step/start` 后,已弃用的 `agent/request` hook 在不改变提供方、模型或推理强度选择的前提下调整控制参数;`prepareCall()` 绑定适配器。在任一异步阶段取消,都不会提交系统候选与已接纳用户消息。每次尝试刷新运行时事实并派生历史;首次尝试提交这两者。
重试保留其组装结果;此后的来源变化留到下一次组装处理。surface 替换和图片省略决定开启新请求序列;未变化的恢复延续序列。每次尝试追加该组装的 `systemUpdates()` 写入;在已记录压缩摘要之后的首次尝试(包括重试)中,这些写入通过普通 `system/message` 事件清空保留的系统增量,并以捕获的指令替换初始系统节点。[Agent-loop](../packages/core/agent-loop/README.zh.md#understand-the-implementation) 规定请求与重试时序。
循环发送不可变请求,同时保持取消有效,仅对完全冻结的对象复用冻结证据;[agent-loop](../packages/core/agent-loop/README.zh.md) 负责请求构建与取消原因。
+7 -6
View File
@@ -2938,7 +2938,7 @@ export interface PresetSpec {
## `@deepseek-ai/dsh-persona`
- `inject`: `systemPrompt`
- `source`: [`packages/preset/persona/src/index.ts:30`](../packages/preset/persona/src/index.ts)
- `source`: [`packages/preset/persona/src/index.ts:23`](../packages/preset/persona/src/index.ts)
```ts config-catalog
/** Plugin config: the persona text this composition contributes. */
@@ -4198,7 +4198,8 @@ export interface Config {
## `@deepseek-ai/dsh-system-prompt`
- `source`: [`packages/core/system-prompt/src/index.ts:266`](../packages/core/system-prompt/src/index.ts)
- `inject`: `sessionProjections`
- `source`: [`packages/core/system-prompt/src/index.ts:316`](../packages/core/system-prompt/src/index.ts)
```ts config-catalog
/** Plugin config: the deployment-authored fragment of the system prompt (see {@link Config.personaPrefix} for its contract). */
@@ -4208,13 +4209,13 @@ export interface Config {
/** Include optional runtime-context snapshots in model history (default true); required context remains. */
includeRuntimeContext?: boolean
/**
* Deployment-wide persona prefix template before first-party guidance. A scoped section named
* `deployment:persona-prefix` shadows it; `{{variable}}` references are strict.
* Deployment-wide persona prefix template before first-party guidance. A section
* named {@link PERSONA_PREFIX_SECTION} can override it; `{{variable}}` references are strict.
*/
personaPrefix?: string
/**
* Persona suffix template after first-party guidance. A scoped `deployment:persona-suffix`
* section shadows it; `{{variable}}` references are strict. Defaults to empty.
* Persona suffix template after first-party guidance. A section named
* {@link PERSONA_SUFFIX_SECTION} can override it; `{{variable}}` references are strict. Defaults to empty.
*/
personaSuffix?: string
/**
+7 -6
View File
@@ -2940,7 +2940,7 @@ export interface PresetSpec {
## `@deepseek-ai/dsh-persona`
- `inject`: `systemPrompt`
- `source`: [`packages/preset/persona/src/index.ts:30`](../packages/preset/persona/src/index.ts)
- `source`: [`packages/preset/persona/src/index.ts:23`](../packages/preset/persona/src/index.ts)
```ts config-catalog
/** Plugin config: the persona text this composition contributes. */
@@ -4200,7 +4200,8 @@ export interface Config {
## `@deepseek-ai/dsh-system-prompt`
- `source`: [`packages/core/system-prompt/src/index.ts:266`](../packages/core/system-prompt/src/index.ts)
- `inject`: `sessionProjections`
- `source`: [`packages/core/system-prompt/src/index.ts:316`](../packages/core/system-prompt/src/index.ts)
```ts config-catalog
/** Plugin config: the deployment-authored fragment of the system prompt (see {@link Config.personaPrefix} for its contract). */
@@ -4210,13 +4211,13 @@ export interface Config {
/** Include optional runtime-context snapshots in model history (default true); required context remains. */
includeRuntimeContext?: boolean
/**
* Deployment-wide persona prefix template before first-party guidance. A scoped section named
* `deployment:persona-prefix` shadows it; `{{variable}}` references are strict.
* Deployment-wide persona prefix template before first-party guidance. A section
* named {@link PERSONA_PREFIX_SECTION} can override it; `{{variable}}` references are strict.
*/
personaPrefix?: string
/**
* Persona suffix template after first-party guidance. A scoped `deployment:persona-suffix`
* section shadows it; `{{variable}}` references are strict. Defaults to empty.
* Persona suffix template after first-party guidance. A section named
* {@link PERSONA_SUFFIX_SECTION} can override it; `{{variable}}` references are strict. Defaults to empty.
*/
personaSuffix?: string
/**
@@ -0,0 +1,34 @@
# Bilingual-pair consistency record for contributing-system-messages.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/cookbook/contributing-system-messages.md
/cookbook-contributing-system-messages:
en: e24e1c78f974ceb4
zh: 82e8af97798040b9
/cookbook-contributing-system-messages/summary:
en: deb81565ddddb5b8
zh: 156d072e5b093dca
/cookbook-contributing-system-messages/table-of-contents:
en: 27d98da04e0f22eb
zh: e709b895f5d17e7e
/cookbook-contributing-system-messages/1-register-instructions:
en: 3790dd96714c9175
zh: ed5b540ea8aa12d0
/cookbook-contributing-system-messages/2-update-the-text:
en: 56c376c2ad789185
zh: 67fa94e9f156e34b
/cookbook-contributing-system-messages/3-end-the-registration:
en: 16245f682af4bdb3
zh: c3140db50904760d
/cookbook-contributing-system-messages/4-choose-scope-and-message-kind:
en: 9d9725254c118241
zh: 8fc8f6deba30fac5
/cookbook-contributing-system-messages/5-verify-admission:
en: 0279908df24b4305
zh: 81015df1bd33ae93
/cookbook-contributing-system-messages/further-exploration:
en: 30019bb44ef63557
zh: 27e1356291c26e54
/cookbook-contributing-system-messages/dev-note:
en: b75c8458928b72b9
zh: 003ba4e17b4b5269
@@ -0,0 +1,132 @@
# Cookbook: contributing system messages
English | [中文](contributing-system-messages.zh.md)
## Summary
Register named instructions with `ctx.systemPrompt.section()` so accepted agent steps introduce them, send changed text, and retire them after their owner unloads. This tutorial assumes a Cordis plugin mounted in a `dsh` profile that provides `systemPrompt`; use the [package checklist](adding-a-package.md) to create that plugin.
## Table of Contents
- [1. Register instructions](#1-register-instructions)
- [2. Update the text](#2-update-the-text)
- [3. End the registration](#3-end-the-registration)
- [4. Choose scope and message kind](#4-choose-scope-and-message-kind)
- [5. Verify admission](#5-verify-admission)
- [Further Exploration](#further-exploration)
- [Dev Note](#dev-note)
<a id="1-register-instructions"></a>
## 1. Register instructions
Declare the service dependency and register through your plugin's `ctx`. Cordis owns the returned disposer and cleans up the registration when the plugin unloads.
```ts
import type { Context } from '@deepseek-ai/cordis'
import '@deepseek-ai/dsh-system-prompt'
export const name = 'example-response-style'
export const inject = ['systemPrompt']
export function apply(ctx: Context) {
ctx.systemPrompt.section({
name: 'example:response-style',
order: 100,
text: 'Use concise sentences and include relevant file paths.',
interpolate: false,
retirement: 'The response-style instructions no longer apply.',
})
}
```
Use a stable, namespaced `name`: it identifies the same instructions across updates and reloads. The nearest scope shadows enclosing registrations with the same name; within one scope, the latest live registration wins. `order` must be finite; sections sort by order, then name. These examples use local order values; first-party contributions use the owning slot from `getSectionOrder()`. Look up the available names and values in `SECTION_ORDERS`, alongside `SystemPrompt.getSectionOrder()`, in [the system-prompt source](../../packages/core/system-prompt/src/index.ts).
<a id="2-update-the-text"></a>
## 2. Update the text
For changing instructions, keep one registration and let its synchronous `text` callback read current state. Call this helper from your plugin's `apply(ctx)`, then call the returned `update()` from the state-change handler you own.
```ts
import type { Context } from '@deepseek-ai/cordis'
import '@deepseek-ai/dsh-system-prompt'
export function registerInstructions(ctx: Context, initialText: string) {
let currentText = initialText
const dispose = ctx.systemPrompt.section({
name: 'example:workspace-policy',
order: 200,
text: () => currentText,
interpolate: false,
replacement: 'The workspace policy has changed.',
retirement: 'The workspace policy no longer applies.',
})
return {
update(text: string) { currentText = text },
dispose,
}
}
```
The effective registration’s callback runs on each `assemble()` call, including inspections and proposed steps that may not be accepted. Hidden registrations’ callbacks do not run. Keep it free of side effects; it does not run only when the text changes. Assembly with a Session captures the rendered text; the loop compares it with the Session’s committed system records and commits the resulting message deltas before the accepted step’s first request. Retries reuse that assembly, and a compaction during the step rebuilds the system head from the same captured text. `update()` does not itself send a message or start a model request. An already assembled step retains its captured text.
Omit `replacement` to get the default notice naming the changed section, or set it to `''` to omit the prefix. The notice applies only to an update of previously admitted instructions, not their introduction. Calling `section()` again in the same scope overrides the previous registration until the new one is disposed; reading mutable state in `text()` avoids adding an override.
**Set `interpolate: false` explicitly on every new section**, as in both examples, to avoid unexpected interpolation. The API keeps its `true` default for compatibility, so omitting the option can substitute `{{name}}` or fail on an unknown variable, even in text returned by a callback. Compute dynamic text in the callback using ordinary JavaScript expressions or template literals instead. System sections are trimmed before direct text comparison, so changing only leading or trailing whitespace sends no update.
For large, mutable system prompts, split independently changing instructions into multiple sections. For example, keep stable response rules separate from frequently updated workspace instructions. Give each part a stable name, its own order and text provider, and an explicit retirement notice. Updates resend the whole changed section; splitting lets you update or retire one part without resending unchanged parts.
To make a still-registered section empty, return `''`. A new empty section contributes nothing; an existing nonempty section becoming empty uses its replacement notice, or the default retraction when no replacement is supplied. Whitespace-only strings behave the same way, so `"\n"` becoming `"\n\n"` sends no additional update.
<a id="3-end-the-registration"></a>
## 3. End the registration
Call the returned `dispose()` when the instructions stop applying before plugin unload. Otherwise let Cordis teardown do it. Provide an explicit `retirement` notice for every section so the model knows which instructions no longer apply. The API permits omission, but a descriptive notice is encouraged. It is literal text and must remain nonempty after trimming; cleanup never calls the disposed text provider again.
Disposal removes that exact registration. If another visible registration has the same name, the next assembly uses its text and replacement notice instead of retiring the source. Retirement requires every registration in the visible scope chain to be disposed; only Sessions that observed registrations and previously committed the name receive it. The last disposed observed registration supplies the retirement notice. Registering and disposing before admission produces no retirement message for an uninformed Session. Disposing and re-registering the same name before the next admission sends nothing when the rendered text is unchanged, or one replacement update when it differs.
For several registrations sharing one lifetime, yield their disposers from a Cordis generator effect. The [tools executor registration](../../packages/core/tools/src/index.ts) uses this pattern. If a later registration throws, Cordis cleans up the earlier registrations; their ordinary retirement behavior still applies.
<a id="4-choose-scope-and-message-kind"></a>
## 4. Choose scope and message kind
Register through an agent's `ctx` for instructions specific to that agent. Reuse a parent source's name to override it; use distinct names for instructions that need independent retirement. For persona overrides, register `PERSONA_PREFIX_SECTION` or `PERSONA_SUFFIX_SECTION` with the corresponding `getSectionOrder()` slot, or mount the [persona plugin](../../packages/preset/persona/README.md) to register both. Prefix-only overrides inherit the suffix. Keep changing operational facts, such as working directories, in `ctx.systemPrompt.context()`; they become user-role context snapshots and have a separate refresh path.
`complete: true` is strongly discouraged for plugins. It is retained only to let the [minimal preset](../../packages/bundle/web-app/presets/minimal.patch.yml) suppress normal system messages, an exception applicable in almost no plugin scenario. Contribute ordinary sections instead; suppressing the entire prompt also removes other plugins' instructions.
<a id="5-verify-admission"></a>
## 5. Verify admission
Exercise the contribution in an agent Session and inspect its logged `system/message` events. Registration and assembly alone do not commit messages; the loop appends the prepared deltas once on the first attempt. The [admission tests](../../packages/core/system-prompt/tests/admission.spec.ts) show a small harness for package tests.
1. Admit initial text, then admit unchanged text: the second admission adds no system update.
2. Change the callback's state: the next accepted assembly adds only that section's text and replacement notice.
3. Change only surrounding whitespace: no update is added.
4. Dispose an override: inherited instructions return through an ordinary replacement. Dispose all visible registrations: an informed Session receives one retirement notice; a fresh Session receives none.
5. Dispose and restore identical text between admissions: no retirement or replacement is added.
Run the existing focused behavior tests while developing a contribution:
```sh
pnpm exec vitest run packages/core/system-prompt/tests
```
Read all surviving system messages when inspecting a transcript; later messages contain updates, not the complete prompt. Compaction can consolidate them. Runtime definitions and uncommitted disposal state are process-local. Replayed or inherited text alone cannot recover retirement for a source never observed by the current Session; see the [known limitations](../../packages/core/system-prompt/README.md#known-limitations-and-deferred-work).
<a id="further-exploration"></a>
## Further Exploration
- [System-prompt API reference](../subsystems/system-prompt.md) — types and service methods.
- [Section admission rationale](../../.agents/notes/implemented/architecture/2026-10-21-section-based-system-updates.md) — registration, scoped overrides, and retirement.
- [Deferred compaction rebuilding](../../.agents/notes/implemented/architecture/2026-11-09-deferred-system-compaction.md) — captured sections and the rebuilt instructions after compaction.
<a id="dev-note"></a>
## Dev Note
None.
@@ -0,0 +1,132 @@
# 实践指南:贡献系统消息
[English](contributing-system-messages.md) | 中文
## 概要
通过 `ctx.systemPrompt.section()` 注册具名指令,已接受的 agent(智能体)步骤会首次引入指令、发送变化后的文本,并在其拥有者卸载后撤回指令。本教程假定你已有一个挂载在 `dsh` 配置中的 Cordis 插件,且配置提供 `systemPrompt`;创建插件的步骤见[包检查清单](adding-a-package.zh.md)。
## 目录
- [1. 注册指令](#1-register-instructions)
- [2. 更新文本](#2-update-the-text)
- [3. 结束注册](#3-end-the-registration)
- [4. 选择作用域与消息类型](#4-choose-scope-and-message-kind)
- [5. 验证准入](#5-verify-admission)
- [延伸阅读](#further-exploration)
- [开发备注](#dev-note)
<a id="1-register-instructions"></a>
## 1. 注册指令
声明服务依赖,并通过插件的 `ctx` 注册。Cordis 管理返回的清理函数,在插件卸载时清理注册。
```ts
import type { Context } from '@deepseek-ai/cordis'
import '@deepseek-ai/dsh-system-prompt'
export const name = 'example-response-style'
export const inject = ['systemPrompt']
export function apply(ctx: Context) {
ctx.systemPrompt.section({
name: 'example:response-style',
order: 100,
text: 'Use concise sentences and include relevant file paths.',
interpolate: false,
retirement: 'The response-style instructions no longer apply.',
})
}
```
使用稳定且带命名空间的 `name`,以便在更新和重新加载之间识别同一组指令。最近作用域中的同名注册遮蔽外层注册;同一作用域中,最后一个活跃注册优先。`order` 必须是有限数值;节先按顺序值排序,再按名称排序。示例使用局部顺序值;第一方贡献应通过 `getSectionOrder()` 获取所属位置。可用名称和数值见[系统提示源码](../../packages/core/system-prompt/src/index.ts)中的 `SECTION_ORDERS`,查询方法 `SystemPrompt.getSectionOrder()` 也位于该文件。
<a id="2-update-the-text"></a>
## 2. 更新文本
对于会变化的指令,保留一次注册,让同步 `text` 回调读取当前状态。在插件的 `apply(ctx)` 中调用此辅助函数,再从你负责的状态变化处理器调用返回的 `update()`。
```ts
import type { Context } from '@deepseek-ai/cordis'
import '@deepseek-ai/dsh-system-prompt'
export function registerInstructions(ctx: Context, initialText: string) {
let currentText = initialText
const dispose = ctx.systemPrompt.section({
name: 'example:workspace-policy',
order: 200,
text: () => currentText,
interpolate: false,
replacement: 'The workspace policy has changed.',
retirement: 'The workspace policy no longer applies.',
})
return {
update(text: string) { currentText = text },
dispose,
}
}
```
有效注册的回调会在每次 `assemble()` 时执行,包括检查操作和可能不被接受的候选步骤。隐藏注册的回调不会执行。保持回调无副作用;它并非只在文本变化时执行。带 Session 的组装会捕获渲染文本;循环将其与该 Session 的已提交系统记录比较,并在已接受步骤的首次请求前提交由此得到的消息增量。重试复用该组装;步骤内发生压缩时,根据同一份捕获文本重建系统头节点。`update()` 本身不会发送消息或启动模型请求。已完成组装的步骤保留当时捕获的文本。
省略 `replacement` 可使用包含节名称的默认替换通知;设为 `''` 可省略前缀。通知只用于更新此前已准入的指令,不用于首次引入。在同一作用域再次调用 `section()` 会覆盖先前注册,直到新注册被清理;通过 `text()` 读取可变状态可避免添加覆盖。
**每个新节都应显式设置 `interpolate: false`**,像两个示例一样,避免意外插值。API 为兼容性保留默认值 `true`,因此省略该选项可能替换 `{{name}}`,或因未知变量而失败,即使文本由回调返回也一样。请在回调中使用普通 JavaScript 表达式或模板字符串计算动态文本。系统节在直接比较文本前去除首尾空白,因此只改变首尾空白不会发送更新。
对于大型且可变的系统提示,可将独立变化的指令拆分为多个节。例如,将稳定的回答规则与频繁更新的工作区指令分开。为每部分分配稳定的名称、各自的顺序值和文本提供者,以及显式撤回通知。更新会重发整个发生变化的节;拆分后,可以更新或撤回其中一部分,而不重发未变的部分。
要让仍然注册的节变为空文本,返回 `''`。新注册的空节不贡献内容;已有非空节变空时,使用其替换通知,未提供替换通知时则使用默认撤回通知。仅含空白的字符串行为相同,因此 `"\n"` 变为 `"\n\n"` 不会发送额外更新。
<a id="3-end-the-registration"></a>
## 3. 结束注册
如果指令在插件卸载前就不再适用,调用返回的 `dispose()`;否则交给 Cordis 清理。为每个节提供显式的 `retirement` 通知,让模型知道哪些指令不再适用。API 允许省略,但鼓励提供含义明确的通知。通知是字面文本,去除首尾空白后必须非空;清理不会再次调用已清理的文本提供者。
释放只移除对应注册。如果另一个可见注册具有同名,下一次组装会使用其文本和替换通知,而不是撤回来源。只有可见作用域链中的所有注册都被释放后才会撤回,且仅发送给观察过注册并此前提交过该名称的 Session。通知来自最后一个被释放且曾被观察到的注册。在准入前注册并立即清理,不会向从未接收该节的 Session 发送撤回消息。在下次准入前清理并重新注册同名节,若渲染文本未变,则不发送消息;若文本不同,则发送一次替换更新。
若多项注册共享同一生命周期,在 Cordis 生成器副作用中 yield 各自的清理函数。[工具执行器注册](../../packages/core/tools/src/index.ts)使用了这一模式。如果后续注册抛出异常,Cordis 会清理之前的注册;这些注册仍遵循普通撤回规则。
<a id="4-choose-scope-and-message-kind"></a>
## 4. 选择作用域与消息类型
通过 agent 的 `ctx` 注册仅适用于该 agent 的指令。复用父级来源名称以覆盖它;需要独立撤回的指令应使用不同名称。覆盖 persona 时,以对应的 `getSectionOrder()` 位置注册 `PERSONA_PREFIX_SECTION` 或 `PERSONA_SUFFIX_SECTION`,或挂载 [persona 插件](../../packages/preset/persona/README.zh.md)来注册两者。只覆盖前缀时会继承后缀。将工作目录等变化的运行事实放在 `ctx.systemPrompt.context()` 中;它们会成为用户角色上下文快照,并使用独立的刷新路径。
强烈不建议插件使用 `complete: true`。保留它仅为让 [minimal 预设](../../packages/bundle/web-app/presets/minimal.patch.yml)抑制正常系统消息,几乎没有插件场景适用这一例外。请贡献普通节;抑制整个提示也会移除其他插件的指令。
<a id="5-verify-admission"></a>
## 5. 验证准入
在代理 Session 中运行贡献,并检查日志中的 `system/message` 事件。注册和组装本身不会提交消息;循环只在首次尝试中追加准备好的增量一次。[准入测试](../../packages/core/system-prompt/tests/admission.spec.ts)展示了适用于包测试的小型测试装置。
1. 准入初始文本,再准入未变的文本:第二次准入不增加系统更新。
2. 改变回调读取的状态:下次接受的组装只增加该节的文本和替换通知。
3. 只改变首尾空白:不增加更新。
4. 清理覆盖:继承的指令通过普通替换恢复。清理所有可见注册:已接收该节的 Session 收到一次撤回通知;新 Session 不收到撤回通知。
5. 在两次准入之间清理并恢复相同文本:不增加撤回或替换消息。
开发贡献时运行现有的聚焦行为测试:
```sh
pnpm exec vitest run packages/core/system-prompt/tests
```
检查转录时读取所有仍保留的系统消息;后续消息包含更新,而非完整提示。压缩可能将它们合并。运行时定义和未提交的释放状态仅存在于进程中。仅凭重放或继承文本,无法恢复当前 Session 从未观察过的来源的撤回;见[已知限制](../../packages/core/system-prompt/README.zh.md#known-limitations-and-deferred-work)。
<a id="further-exploration"></a>
## 延伸阅读
- [系统提示 API 参考](../subsystems/system-prompt.zh.md)——类型和服务方法。
- [按节准入的设计理由](../../.agents/notes/implemented/architecture/2026-10-21-section-based-system-updates.zh.md)——注册、作用域覆盖与退役。
- [延后的压缩重建](../../.agents/notes/implemented/architecture/2026-11-09-deferred-system-compaction.zh.md)——已捕获的段与压缩后重建的指令。
<a id="dev-note"></a>
## 开发备注
无。
+2 -2
View File
@@ -3,8 +3,8 @@
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/cookbook/extension-cookbook.md
/cookbook-extension-plugin-shapes:
en: 1d31f2923d4b4e42
zh: 194aaeceaa020e8e
en: 75356dcac6f6000d
zh: 9d9d9f5821fa4994
/cookbook-extension-plugin-shapes/a-tool-plugin:
en: 39704ef102f2f2f7
zh: 8771f9c19450b347
+1 -1
View File
@@ -2,7 +2,7 @@
English | [中文](extension-cookbook.zh.md)
Reference patterns for harness extensions. The snippets omit imports and helper implementations and are not copy-paste-complete. For concrete authoring paths, see the [package checklist](adding-a-package.md), [first-tool tutorial](../user/develop/basic/tool.md), [tool reference](adding-a-tool.md), [LLM adapter guide](adding-an-llm-adapter.md), and [Session format version tutorial](adding-a-session-format-version.md); the [architecture](../architecture.md) owns the system and extension-point map.
Reference patterns for harness extensions. The snippets omit imports and helper implementations and are not copy-paste-complete. For concrete authoring paths, see the [package checklist](adding-a-package.md), [first-tool tutorial](../user/develop/basic/tool.md), [tool reference](adding-a-tool.md), [system-message cookbook](contributing-system-messages.md), [LLM adapter guide](adding-an-llm-adapter.md), and [Session format version tutorial](adding-a-session-format-version.md); the [architecture](../architecture.md) owns the system and extension-point map.
## A tool plugin
+1 -1
View File
@@ -2,7 +2,7 @@
[English](extension-cookbook.md) | 中文
harness 扩展的参考模式。代码片段省略了 import 和辅助实现,无法直接复制运行。具体编写路径见[包检查清单](adding-a-package.zh.md)、[第一个工具教程](../user/develop/basic/tool.zh.md)、[工具参考](adding-a-tool.zh.md)、[LLM(大语言模型)适配器指南](adding-an-llm-adapter.zh.md)和 [Session 格式版本教程](adding-a-session-format-version.zh.md);系统与扩展点映射由[架构文档](../architecture.zh.md)负责。
harness 扩展的参考模式。代码片段省略了 import 和辅助实现,无法直接复制运行。具体编写路径见[包检查清单](adding-a-package.zh.md)、[第一个工具教程](../user/develop/basic/tool.zh.md)、[工具参考](adding-a-tool.zh.md)、[系统消息实践指南](contributing-system-messages.zh.md)、[LLM(大语言模型)适配器指南](adding-an-llm-adapter.zh.md)和 [Session 格式版本教程](adding-a-session-format-version.zh.md);系统与扩展点映射由[架构文档](../architecture.zh.md)负责。
## 工具插件
+2 -2
View File
@@ -82,8 +82,8 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
| `subagent/provider-added` | `emit` | [`packages/subagent/subagent/src/index.ts:144`](../packages/subagent/subagent/src/index.ts) | [`subagent`](../packages/subagent/subagent) (`emit`) | [`tool-subagent`](../packages/subagent/tool-subagent) |
| `subagent/provider-removed` | `emit` | [`packages/subagent/subagent/src/index.ts:150`](../packages/subagent/subagent/src/index.ts) | [`subagent`](../packages/subagent/subagent) (`events.dispatch`) | [`tool-subagent`](../packages/subagent/tool-subagent) |
| `subagent/start` | `emit` | [`packages/subagent/subagent/src/index.ts:160`](../packages/subagent/subagent/src/index.ts) | [`subagent`](../packages/subagent/subagent) (`events.dispatch`) | [`hooks-claude-code`](../packages/experimental/hooks-claude-code) |
| `system-prompt/assemble` | `waterfall` | [`packages/core/system-prompt/src/index.ts:31`](../packages/core/system-prompt/src/index.ts) | [`system-prompt`](../packages/core/system-prompt) (`waterfall`) | `browser-use-runtime`, [`working-directory`](../packages/session/working-directory) |
| `system-prompt/change` | `emit` | [`packages/core/system-prompt/src/index.ts:37`](../packages/core/system-prompt/src/index.ts) | [`system-prompt`](../packages/core/system-prompt) (`emit`) | - |
| `system-prompt/assemble` | `waterfall` | [`packages/core/system-prompt/src/index.ts:41`](../packages/core/system-prompt/src/index.ts) | [`system-prompt`](../packages/core/system-prompt) (`waterfall`) | `browser-use-runtime`, [`working-directory`](../packages/session/working-directory) |
| `system-prompt/change` | `emit` | [`packages/core/system-prompt/src/index.ts:47`](../packages/core/system-prompt/src/index.ts) | [`system-prompt`](../packages/core/system-prompt) (`emit`) | - |
| `timeline/priority` | `emit` | [`packages/experimental/timeline/src/storage.ts:56`](../packages/experimental/timeline/src/storage.ts) | [`timeline`](../packages/experimental/timeline) (`emit`) | [`timeline`](../packages/experimental/timeline) |
| `tools/change` | `emit` | [`packages/core/tools/src/events.ts:56`](../packages/core/tools/src/events.ts) | [`agent-preset-registry`](../packages/preset/agent-preset-registry) (`emit`), [`tools`](../packages/core/tools) (`emit`) | `browser-use-runtime`, [`timeline`](../packages/experimental/timeline) |
| `tools/execute` | `waterfall` | [`packages/core/tools/src/events.ts:29`](../packages/core/tools/src/events.ts) | [`tools`](../packages/core/tools) (`waterfall`) | `browser-use-runtime`, `browser-use-stagehand-native`, `claude-code-mods`, `computer-use-cua-driver-native`, [`cua-macos`](../packages/experimental/cua-macos), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), `timeout-policy` |
+2 -2
View File
@@ -84,8 +84,8 @@
| `subagent/provider-added` | `emit` | [`packages/subagent/subagent/src/index.ts:144`](../packages/subagent/subagent/src/index.ts) | [`subagent`](../packages/subagent/subagent) (`emit`) | [`tool-subagent`](../packages/subagent/tool-subagent) |
| `subagent/provider-removed` | `emit` | [`packages/subagent/subagent/src/index.ts:150`](../packages/subagent/subagent/src/index.ts) | [`subagent`](../packages/subagent/subagent) (`events.dispatch`) | [`tool-subagent`](../packages/subagent/tool-subagent) |
| `subagent/start` | `emit` | [`packages/subagent/subagent/src/index.ts:160`](../packages/subagent/subagent/src/index.ts) | [`subagent`](../packages/subagent/subagent) (`events.dispatch`) | [`hooks-claude-code`](../packages/experimental/hooks-claude-code) |
| `system-prompt/assemble` | `waterfall` | [`packages/core/system-prompt/src/index.ts:31`](../packages/core/system-prompt/src/index.ts) | [`system-prompt`](../packages/core/system-prompt) (`waterfall`) | `browser-use-runtime`, [`working-directory`](../packages/session/working-directory) |
| `system-prompt/change` | `emit` | [`packages/core/system-prompt/src/index.ts:37`](../packages/core/system-prompt/src/index.ts) | [`system-prompt`](../packages/core/system-prompt) (`emit`) | - |
| `system-prompt/assemble` | `waterfall` | [`packages/core/system-prompt/src/index.ts:41`](../packages/core/system-prompt/src/index.ts) | [`system-prompt`](../packages/core/system-prompt) (`waterfall`) | `browser-use-runtime`, [`working-directory`](../packages/session/working-directory) |
| `system-prompt/change` | `emit` | [`packages/core/system-prompt/src/index.ts:47`](../packages/core/system-prompt/src/index.ts) | [`system-prompt`](../packages/core/system-prompt) (`emit`) | - |
| `timeline/priority` | `emit` | [`packages/experimental/timeline/src/storage.ts:56`](../packages/experimental/timeline/src/storage.ts) | [`timeline`](../packages/experimental/timeline) (`emit`) | [`timeline`](../packages/experimental/timeline) |
| `tools/change` | `emit` | [`packages/core/tools/src/events.ts:56`](../packages/core/tools/src/events.ts) | [`agent-preset-registry`](../packages/preset/agent-preset-registry) (`emit`), [`tools`](../packages/core/tools) (`emit`) | `browser-use-runtime`, [`timeline`](../packages/experimental/timeline) |
| `tools/execute` | `waterfall` | [`packages/core/tools/src/events.ts:29`](../packages/core/tools/src/events.ts) | [`tools`](../packages/core/tools) (`waterfall`) | `browser-use-runtime`, `browser-use-stagehand-native`, `claude-code-mods`, `computer-use-cua-driver-native`, [`cua-macos`](../packages/experimental/cua-macos), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), `timeout-policy` |
+21 -19
View File
@@ -535,8 +535,6 @@ flowchart TD
pkg_typert_loader --> pkg_typert_registry
pkg_typert_protocol --> pkg_error
pkg_util_ripgrep --> pkg_subprocess
pkg_system_prompt --> pkg_llm
pkg_system_prompt --> pkg_scope
pkg_skill --> pkg_error
pkg_skill --> pkg_llm
pkg_skill --> pkg_scope
@@ -592,6 +590,10 @@ flowchart TD
pkg_remote_mock --> pkg_typert_protocol
pkg_session_snapshot --> pkg_http_proxy
pkg_session_snapshot --> pkg_session
pkg_system_prompt --> pkg_llm
pkg_system_prompt --> pkg_scope
pkg_system_prompt --> pkg_session
pkg_system_prompt --> pkg_session_projection
pkg_fs --> pkg_llm
pkg_fs --> pkg_sandbox
pkg_skill_office --> pkg_skill
@@ -606,10 +608,7 @@ flowchart TD
pkg_deepseek_account --> pkg_util_values
pkg_config_editor --> pkg_app_boot
pkg_config_editor --> pkg_hmr
pkg_cli_account --> pkg_subprocess
pkg_cli_account --> pkg_system_prompt
pkg_upstream_skills --> pkg_skill
pkg_deliverable_file_references --> pkg_system_prompt
pkg_experimental_speech_to_text --> pkg_settings
pkg_experimental_translator --> pkg_credentials
pkg_experimental_translator --> pkg_launch_environment
@@ -623,7 +622,6 @@ flowchart TD
pkg_plugin_recommendations --> pkg_typert_protocol
pkg_skill_badge --> pkg_skill
pkg_host_product_telemetry_otel --> pkg_otel
pkg_persona --> pkg_system_prompt
pkg_ptc_runtime --> pkg_attachment
pkg_ptc_runtime --> pkg_error
pkg_ptc_runtime --> pkg_sandbox
@@ -692,12 +690,9 @@ flowchart TD
pkg_api_workspace_controller --> pkg_storage_domain
pkg_api_workspace_controller --> pkg_typert_protocol
pkg_api_workspace_controller --> pkg_workspace
pkg_feishu --> pkg_cli_account
pkg_feishu --> pkg_skill
pkg_tencent_meeting --> pkg_cli_account
pkg_tencent_meeting --> pkg_upstream_skills
pkg_wecom --> pkg_cli_account
pkg_wecom --> pkg_upstream_skills
pkg_cli_account --> pkg_subprocess
pkg_cli_account --> pkg_system_prompt
pkg_deliverable_file_references --> pkg_system_prompt
pkg_experimental_api_speech_to_text --> pkg_experimental_speech_to_text
pkg_experimental_api_speech_to_text --> pkg_typert_protocol
pkg_experimental_client_ui_cot_translation --> pkg_experimental_translator
@@ -711,6 +706,7 @@ flowchart TD
pkg_lsp_stdio --> pkg_lsp
pkg_lsp_stdio --> pkg_subprocess
pkg_lsp_stdio --> pkg_timeout
pkg_persona --> pkg_system_prompt
pkg_bash_local --> pkg_shell
pkg_bash_local --> pkg_subprocess
pkg_bash_local --> pkg_timeout
@@ -753,6 +749,12 @@ flowchart TD
pkg_web_search_deepseek --> pkg_launch_environment
pkg_web_search_deepseek --> pkg_session
pkg_web_search_deepseek --> pkg_web
pkg_feishu --> pkg_cli_account
pkg_feishu --> pkg_skill
pkg_tencent_meeting --> pkg_cli_account
pkg_tencent_meeting --> pkg_upstream_skills
pkg_wecom --> pkg_cli_account
pkg_wecom --> pkg_upstream_skills
pkg_file_reference --> pkg_agent
pkg_harness_dev_context --> pkg_agent
pkg_harness_dev_context --> pkg_session
@@ -1806,7 +1808,6 @@ flowchart TD
| [`typert-loader`](../packages/typert/loader) | `typert` | [`typert-registry`](../packages/typert/registry) |
| [`typert-protocol`](../packages/typert/protocol) | `typert` | [`error`](../packages/util/error) |
| [`util-ripgrep`](../packages/util/ripgrep) | `util` | [`subprocess`](../packages/subprocess/subprocess) |
| [`system-prompt`](../packages/core/system-prompt) | `core` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`skill`](../packages/skill/skill) | `skill` | [`error`](../packages/util/error), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`web-fetch-http`](../packages/web/web-fetch-http) | `web` | [`timeout`](../packages/util/timeout), [`web`](../packages/web/web) |
| [`spill`](../packages/spill/spill) | `spill` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
@@ -1833,21 +1834,19 @@ flowchart TD
| [`otel`](../packages/telemetry/otel) | `telemetry` | [`session`](../packages/core/session) |
| [`remote-mock`](../packages/test-support/remote-mock) | `test-support` | [`typert-protocol`](../packages/typert/protocol) |
| [`session-snapshot`](../packages/test-support/session-snapshot) | `test-support` | [`http-proxy`](../packages/util/http-proxy), [`session`](../packages/core/session) |
| [`system-prompt`](../packages/core/system-prompt) | `core` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection) |
| [`fs`](../packages/fs/fs) | `fs` | [`llm`](../packages/llm/llm), [`sandbox`](../packages/sandbox/sandbox) |
| [`skill-office`](../packages/skill/skill-office) | `skill` | [`skill`](../packages/skill/skill) |
| [`spill-local`](../packages/spill/spill-local) | `spill` | [`spill`](../packages/spill/spill) |
| [`session-log-export`](../packages/session-query/session-log-export) | `session-query` | [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence) |
| [`deepseek-account`](../packages/account/deepseek-account) | `account` | [`authorization`](../packages/credentials/authorization), [`brand`](../packages/util/brand), [`credentials`](../packages/credentials/credentials), [`host-webserver`](../packages/host/webserver), [`typert-protocol`](../packages/typert/protocol), [`util-values`](../packages/util/values) |
| [`config-editor`](../packages/boot/config-editor) | `boot` | [`app-boot`](../packages/boot/app-boot), [`hmr`](../packages/boot/hmr) |
| [`cli-account`](../packages/connector/cli-account) | `connector` | [`subprocess`](../packages/subprocess/subprocess), [`system-prompt`](../packages/core/system-prompt) |
| [`upstream-skills`](../packages/connector/upstream-skills) | `connector` | [`skill`](../packages/skill/skill) |
| [`deliverable-file-references`](../packages/deliverables/deliverable-file-references) | `deliverables` | [`system-prompt`](../packages/core/system-prompt) |
| [`experimental-speech-to-text`](../packages/experimental/speech-to-text) | `experimental` | [`settings`](../packages/settings/settings) |
| [`experimental-translator`](../packages/experimental/translator) | `experimental` | [`credentials`](../packages/credentials/credentials), [`launch-environment`](../packages/util/launch-environment), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`timeout`](../packages/util/timeout), [`util-values`](../packages/util/values) |
| [`plugin-recommendations`](../packages/experimental/plugin-recommendations) | `experimental` | [`llm`](../packages/llm/llm), [`skill`](../packages/skill/skill), [`typert-protocol`](../packages/typert/protocol) |
| [`skill-badge`](../packages/experimental/skill-badge) | `experimental` | [`skill`](../packages/skill/skill) |
| [`host-product-telemetry-otel`](../packages/host/product-telemetry-otel) | `host` | [`otel`](../packages/telemetry/otel) |
| [`persona`](../packages/preset/persona) | `preset` | [`system-prompt`](../packages/core/system-prompt) |
| [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime) | `ptc-runtime` | [`attachment`](../packages/attachment/attachment), [`error`](../packages/util/error), [`sandbox`](../packages/sandbox/sandbox) |
| [`sandbox-local`](../packages/sandbox/sandbox-local) | `sandbox` | [`llm`](../packages/llm/llm), [`sandbox`](../packages/sandbox/sandbox), [`session`](../packages/core/session) |
| [`sandbox-windows-acl`](../packages/sandbox/sandbox-windows-acl) | `sandbox` | [`skill`](../packages/skill/skill), [`subprocess`](../packages/subprocess/subprocess) |
@@ -1866,14 +1865,14 @@ flowchart TD
| [`skill-filesystem`](../packages/skill/skill-filesystem) | `skill` | [`fs`](../packages/fs/fs), [`home-paths`](../packages/util/home-paths), [`skill`](../packages/skill/skill) |
| [`deepseek-auth`](../packages/account/deepseek-auth) | `account` | [`credentials`](../packages/credentials/credentials), [`deepseek-account`](../packages/account/deepseek-account), [`error`](../packages/util/error), [`launch-environment`](../packages/util/launch-environment) |
| [`api-workspace-controller`](../packages/api/workspace-controller) | `api` | [`api-gateway`](../packages/api/gateway), [`client-connection`](../packages/client/connection), [`host-directory-picker`](../packages/host/directory-picker), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`typert-protocol`](../packages/typert/protocol), [`workspace`](../packages/workspace/workspace) |
| [`feishu`](../packages/connector/feishu) | `connector` | [`cli-account`](../packages/connector/cli-account), [`skill`](../packages/skill/skill) |
| [`tencent-meeting`](../packages/connector/tencent-meeting) | `connector` | [`cli-account`](../packages/connector/cli-account), [`upstream-skills`](../packages/connector/upstream-skills) |
| [`wecom`](../packages/connector/wecom) | `connector` | [`cli-account`](../packages/connector/cli-account), [`upstream-skills`](../packages/connector/upstream-skills) |
| [`cli-account`](../packages/connector/cli-account) | `connector` | [`subprocess`](../packages/subprocess/subprocess), [`system-prompt`](../packages/core/system-prompt) |
| [`deliverable-file-references`](../packages/deliverables/deliverable-file-references) | `deliverables` | [`system-prompt`](../packages/core/system-prompt) |
| [`experimental-api-speech-to-text`](../packages/experimental/api-speech-to-text) | `experimental` | [`experimental-speech-to-text`](../packages/experimental/speech-to-text), [`typert-protocol`](../packages/typert/protocol) |
| [`experimental-client-ui-cot-translation`](../packages/experimental/client-ui-cot-translation) | `experimental` | [`experimental-translator`](../packages/experimental/translator) |
| [`experimental-speech-to-text-sensevoice`](../packages/experimental/speech-to-text-sensevoice) | `experimental` | [`experimental-speech-to-text`](../packages/experimental/speech-to-text), [`subprocess`](../packages/subprocess/subprocess) |
| [`hook-protocol`](../packages/experimental/hook-protocol) | `experimental` | [`session`](../packages/core/session), [`shell`](../packages/shell/shell) |
| [`lsp-stdio`](../packages/lsp/lsp-stdio) | `lsp` | [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`lsp`](../packages/lsp/lsp), [`subprocess`](../packages/subprocess/subprocess), [`timeout`](../packages/util/timeout) |
| [`persona`](../packages/preset/persona) | `preset` | [`system-prompt`](../packages/core/system-prompt) |
| [`bash-local`](../packages/shell/bash-local) | `shell` | [`shell`](../packages/shell/shell), [`subprocess`](../packages/subprocess/subprocess), [`timeout`](../packages/util/timeout) |
| [`pwsh-local`](../packages/shell/pwsh-local) | `shell` | [`shell`](../packages/shell/shell), [`subprocess`](../packages/subprocess/subprocess), [`timeout`](../packages/util/timeout) |
| [`llm-deepseek-account`](../packages/llm/llm-deepseek-account) | `llm` | [`agent`](../packages/core/agent), [`deepseek-account`](../packages/account/deepseek-account), [`deepseek-auth`](../packages/account/deepseek-auth), [`launch-environment`](../packages/util/launch-environment), [`llm`](../packages/llm/llm), [`llm-deepseek`](../packages/llm/llm-deepseek) |
@@ -1883,6 +1882,9 @@ flowchart TD
| [`goal`](../packages/goal/goal) | `goal` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`typert-protocol`](../packages/typert/protocol) |
| [`web-deepseek-api`](../packages/web/web-deepseek-api) | `web` | [`agent`](../packages/core/agent), [`credentials`](../packages/credentials/credentials), [`deepseek-auth`](../packages/account/deepseek-auth), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`web`](../packages/web/web) |
| [`web-search-deepseek`](../packages/web/web-search-deepseek) | `web` | [`agent`](../packages/core/agent), [`credentials`](../packages/credentials/credentials), [`deepseek-auth`](../packages/account/deepseek-auth), [`launch-environment`](../packages/util/launch-environment), [`session`](../packages/core/session), [`web`](../packages/web/web) |
| [`feishu`](../packages/connector/feishu) | `connector` | [`cli-account`](../packages/connector/cli-account), [`skill`](../packages/skill/skill) |
| [`tencent-meeting`](../packages/connector/tencent-meeting) | `connector` | [`cli-account`](../packages/connector/cli-account), [`upstream-skills`](../packages/connector/upstream-skills) |
| [`wecom`](../packages/connector/wecom) | `connector` | [`cli-account`](../packages/connector/cli-account), [`upstream-skills`](../packages/connector/upstream-skills) |
| [`file-reference`](../packages/context/file-reference) | `context` | [`agent`](../packages/core/agent) |
| [`harness-dev-context`](../packages/context/harness-dev-context) | `context` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`time-context`](../packages/context/time-context) | `context` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`util-time`](../packages/util/time) |
+21 -19
View File
@@ -537,8 +537,6 @@ flowchart TD
pkg_typert_loader --> pkg_typert_registry
pkg_typert_protocol --> pkg_error
pkg_util_ripgrep --> pkg_subprocess
pkg_system_prompt --> pkg_llm
pkg_system_prompt --> pkg_scope
pkg_skill --> pkg_error
pkg_skill --> pkg_llm
pkg_skill --> pkg_scope
@@ -594,6 +592,10 @@ flowchart TD
pkg_remote_mock --> pkg_typert_protocol
pkg_session_snapshot --> pkg_http_proxy
pkg_session_snapshot --> pkg_session
pkg_system_prompt --> pkg_llm
pkg_system_prompt --> pkg_scope
pkg_system_prompt --> pkg_session
pkg_system_prompt --> pkg_session_projection
pkg_fs --> pkg_llm
pkg_fs --> pkg_sandbox
pkg_skill_office --> pkg_skill
@@ -608,10 +610,7 @@ flowchart TD
pkg_deepseek_account --> pkg_util_values
pkg_config_editor --> pkg_app_boot
pkg_config_editor --> pkg_hmr
pkg_cli_account --> pkg_subprocess
pkg_cli_account --> pkg_system_prompt
pkg_upstream_skills --> pkg_skill
pkg_deliverable_file_references --> pkg_system_prompt
pkg_experimental_speech_to_text --> pkg_settings
pkg_experimental_translator --> pkg_credentials
pkg_experimental_translator --> pkg_launch_environment
@@ -625,7 +624,6 @@ flowchart TD
pkg_plugin_recommendations --> pkg_typert_protocol
pkg_skill_badge --> pkg_skill
pkg_host_product_telemetry_otel --> pkg_otel
pkg_persona --> pkg_system_prompt
pkg_ptc_runtime --> pkg_attachment
pkg_ptc_runtime --> pkg_error
pkg_ptc_runtime --> pkg_sandbox
@@ -694,12 +692,9 @@ flowchart TD
pkg_api_workspace_controller --> pkg_storage_domain
pkg_api_workspace_controller --> pkg_typert_protocol
pkg_api_workspace_controller --> pkg_workspace
pkg_feishu --> pkg_cli_account
pkg_feishu --> pkg_skill
pkg_tencent_meeting --> pkg_cli_account
pkg_tencent_meeting --> pkg_upstream_skills
pkg_wecom --> pkg_cli_account
pkg_wecom --> pkg_upstream_skills
pkg_cli_account --> pkg_subprocess
pkg_cli_account --> pkg_system_prompt
pkg_deliverable_file_references --> pkg_system_prompt
pkg_experimental_api_speech_to_text --> pkg_experimental_speech_to_text
pkg_experimental_api_speech_to_text --> pkg_typert_protocol
pkg_experimental_client_ui_cot_translation --> pkg_experimental_translator
@@ -713,6 +708,7 @@ flowchart TD
pkg_lsp_stdio --> pkg_lsp
pkg_lsp_stdio --> pkg_subprocess
pkg_lsp_stdio --> pkg_timeout
pkg_persona --> pkg_system_prompt
pkg_bash_local --> pkg_shell
pkg_bash_local --> pkg_subprocess
pkg_bash_local --> pkg_timeout
@@ -755,6 +751,12 @@ flowchart TD
pkg_web_search_deepseek --> pkg_launch_environment
pkg_web_search_deepseek --> pkg_session
pkg_web_search_deepseek --> pkg_web
pkg_feishu --> pkg_cli_account
pkg_feishu --> pkg_skill
pkg_tencent_meeting --> pkg_cli_account
pkg_tencent_meeting --> pkg_upstream_skills
pkg_wecom --> pkg_cli_account
pkg_wecom --> pkg_upstream_skills
pkg_file_reference --> pkg_agent
pkg_harness_dev_context --> pkg_agent
pkg_harness_dev_context --> pkg_session
@@ -1808,7 +1810,6 @@ flowchart TD
| [`typert-loader`](../packages/typert/loader) | `typert` | [`typert-registry`](../packages/typert/registry) |
| [`typert-protocol`](../packages/typert/protocol) | `typert` | [`error`](../packages/util/error) |
| [`util-ripgrep`](../packages/util/ripgrep) | `util` | [`subprocess`](../packages/subprocess/subprocess) |
| [`system-prompt`](../packages/core/system-prompt) | `core` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`skill`](../packages/skill/skill) | `skill` | [`error`](../packages/util/error), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`web-fetch-http`](../packages/web/web-fetch-http) | `web` | [`timeout`](../packages/util/timeout), [`web`](../packages/web/web) |
| [`spill`](../packages/spill/spill) | `spill` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
@@ -1835,21 +1836,19 @@ flowchart TD
| [`otel`](../packages/telemetry/otel) | `telemetry` | [`session`](../packages/core/session) |
| [`remote-mock`](../packages/test-support/remote-mock) | `test-support` | [`typert-protocol`](../packages/typert/protocol) |
| [`session-snapshot`](../packages/test-support/session-snapshot) | `test-support` | [`http-proxy`](../packages/util/http-proxy), [`session`](../packages/core/session) |
| [`system-prompt`](../packages/core/system-prompt) | `core` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection) |
| [`fs`](../packages/fs/fs) | `fs` | [`llm`](../packages/llm/llm), [`sandbox`](../packages/sandbox/sandbox) |
| [`skill-office`](../packages/skill/skill-office) | `skill` | [`skill`](../packages/skill/skill) |
| [`spill-local`](../packages/spill/spill-local) | `spill` | [`spill`](../packages/spill/spill) |
| [`session-log-export`](../packages/session-query/session-log-export) | `session-query` | [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence) |
| [`deepseek-account`](../packages/account/deepseek-account) | `account` | [`authorization`](../packages/credentials/authorization), [`brand`](../packages/util/brand), [`credentials`](../packages/credentials/credentials), [`host-webserver`](../packages/host/webserver), [`typert-protocol`](../packages/typert/protocol), [`util-values`](../packages/util/values) |
| [`config-editor`](../packages/boot/config-editor) | `boot` | [`app-boot`](../packages/boot/app-boot), [`hmr`](../packages/boot/hmr) |
| [`cli-account`](../packages/connector/cli-account) | `connector` | [`subprocess`](../packages/subprocess/subprocess), [`system-prompt`](../packages/core/system-prompt) |
| [`upstream-skills`](../packages/connector/upstream-skills) | `connector` | [`skill`](../packages/skill/skill) |
| [`deliverable-file-references`](../packages/deliverables/deliverable-file-references) | `deliverables` | [`system-prompt`](../packages/core/system-prompt) |
| [`experimental-speech-to-text`](../packages/experimental/speech-to-text) | `experimental` | [`settings`](../packages/settings/settings) |
| [`experimental-translator`](../packages/experimental/translator) | `experimental` | [`credentials`](../packages/credentials/credentials), [`launch-environment`](../packages/util/launch-environment), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`timeout`](../packages/util/timeout), [`util-values`](../packages/util/values) |
| [`plugin-recommendations`](../packages/experimental/plugin-recommendations) | `experimental` | [`llm`](../packages/llm/llm), [`skill`](../packages/skill/skill), [`typert-protocol`](../packages/typert/protocol) |
| [`skill-badge`](../packages/experimental/skill-badge) | `experimental` | [`skill`](../packages/skill/skill) |
| [`host-product-telemetry-otel`](../packages/host/product-telemetry-otel) | `host` | [`otel`](../packages/telemetry/otel) |
| [`persona`](../packages/preset/persona) | `preset` | [`system-prompt`](../packages/core/system-prompt) |
| [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime) | `ptc-runtime` | [`attachment`](../packages/attachment/attachment), [`error`](../packages/util/error), [`sandbox`](../packages/sandbox/sandbox) |
| [`sandbox-local`](../packages/sandbox/sandbox-local) | `sandbox` | [`llm`](../packages/llm/llm), [`sandbox`](../packages/sandbox/sandbox), [`session`](../packages/core/session) |
| [`sandbox-windows-acl`](../packages/sandbox/sandbox-windows-acl) | `sandbox` | [`skill`](../packages/skill/skill), [`subprocess`](../packages/subprocess/subprocess) |
@@ -1868,14 +1867,14 @@ flowchart TD
| [`skill-filesystem`](../packages/skill/skill-filesystem) | `skill` | [`fs`](../packages/fs/fs), [`home-paths`](../packages/util/home-paths), [`skill`](../packages/skill/skill) |
| [`deepseek-auth`](../packages/account/deepseek-auth) | `account` | [`credentials`](../packages/credentials/credentials), [`deepseek-account`](../packages/account/deepseek-account), [`error`](../packages/util/error), [`launch-environment`](../packages/util/launch-environment) |
| [`api-workspace-controller`](../packages/api/workspace-controller) | `api` | [`api-gateway`](../packages/api/gateway), [`client-connection`](../packages/client/connection), [`host-directory-picker`](../packages/host/directory-picker), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`typert-protocol`](../packages/typert/protocol), [`workspace`](../packages/workspace/workspace) |
| [`feishu`](../packages/connector/feishu) | `connector` | [`cli-account`](../packages/connector/cli-account), [`skill`](../packages/skill/skill) |
| [`tencent-meeting`](../packages/connector/tencent-meeting) | `connector` | [`cli-account`](../packages/connector/cli-account), [`upstream-skills`](../packages/connector/upstream-skills) |
| [`wecom`](../packages/connector/wecom) | `connector` | [`cli-account`](../packages/connector/cli-account), [`upstream-skills`](../packages/connector/upstream-skills) |
| [`cli-account`](../packages/connector/cli-account) | `connector` | [`subprocess`](../packages/subprocess/subprocess), [`system-prompt`](../packages/core/system-prompt) |
| [`deliverable-file-references`](../packages/deliverables/deliverable-file-references) | `deliverables` | [`system-prompt`](../packages/core/system-prompt) |
| [`experimental-api-speech-to-text`](../packages/experimental/api-speech-to-text) | `experimental` | [`experimental-speech-to-text`](../packages/experimental/speech-to-text), [`typert-protocol`](../packages/typert/protocol) |
| [`experimental-client-ui-cot-translation`](../packages/experimental/client-ui-cot-translation) | `experimental` | [`experimental-translator`](../packages/experimental/translator) |
| [`experimental-speech-to-text-sensevoice`](../packages/experimental/speech-to-text-sensevoice) | `experimental` | [`experimental-speech-to-text`](../packages/experimental/speech-to-text), [`subprocess`](../packages/subprocess/subprocess) |
| [`hook-protocol`](../packages/experimental/hook-protocol) | `experimental` | [`session`](../packages/core/session), [`shell`](../packages/shell/shell) |
| [`lsp-stdio`](../packages/lsp/lsp-stdio) | `lsp` | [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`lsp`](../packages/lsp/lsp), [`subprocess`](../packages/subprocess/subprocess), [`timeout`](../packages/util/timeout) |
| [`persona`](../packages/preset/persona) | `preset` | [`system-prompt`](../packages/core/system-prompt) |
| [`bash-local`](../packages/shell/bash-local) | `shell` | [`shell`](../packages/shell/shell), [`subprocess`](../packages/subprocess/subprocess), [`timeout`](../packages/util/timeout) |
| [`pwsh-local`](../packages/shell/pwsh-local) | `shell` | [`shell`](../packages/shell/shell), [`subprocess`](../packages/subprocess/subprocess), [`timeout`](../packages/util/timeout) |
| [`llm-deepseek-account`](../packages/llm/llm-deepseek-account) | `llm` | [`agent`](../packages/core/agent), [`deepseek-account`](../packages/account/deepseek-account), [`deepseek-auth`](../packages/account/deepseek-auth), [`launch-environment`](../packages/util/launch-environment), [`llm`](../packages/llm/llm), [`llm-deepseek`](../packages/llm/llm-deepseek) |
@@ -1885,6 +1884,9 @@ flowchart TD
| [`goal`](../packages/goal/goal) | `goal` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`typert-protocol`](../packages/typert/protocol) |
| [`web-deepseek-api`](../packages/web/web-deepseek-api) | `web` | [`agent`](../packages/core/agent), [`credentials`](../packages/credentials/credentials), [`deepseek-auth`](../packages/account/deepseek-auth), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`web`](../packages/web/web) |
| [`web-search-deepseek`](../packages/web/web-search-deepseek) | `web` | [`agent`](../packages/core/agent), [`credentials`](../packages/credentials/credentials), [`deepseek-auth`](../packages/account/deepseek-auth), [`launch-environment`](../packages/util/launch-environment), [`session`](../packages/core/session), [`web`](../packages/web/web) |
| [`feishu`](../packages/connector/feishu) | `connector` | [`cli-account`](../packages/connector/cli-account), [`skill`](../packages/skill/skill) |
| [`tencent-meeting`](../packages/connector/tencent-meeting) | `connector` | [`cli-account`](../packages/connector/cli-account), [`upstream-skills`](../packages/connector/upstream-skills) |
| [`wecom`](../packages/connector/wecom) | `connector` | [`cli-account`](../packages/connector/cli-account), [`upstream-skills`](../packages/connector/upstream-skills) |
| [`file-reference`](../packages/context/file-reference) | `context` | [`agent`](../packages/core/agent) |
| [`harness-dev-context`](../packages/context/harness-dev-context) | `context` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`time-context`](../packages/context/time-context) | `context` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`util-time`](../packages/util/time) |
+123 -108
View File
@@ -9,11 +9,11 @@
en: 1387c4505dde2faf
zh: 48570fa1c13d6910
/session-persistence-event-catalog/persistence-type-fingerprints:
en: bbdeea7adbc0bf30
zh: ed1eea613a6cb14b
en: bb1795849509eed8
zh: 24da7f15491796d3
/session-persistence-event-catalog/event-envelope:
en: 5cae0233560db4d6
zh: c8f5efc48be52095
en: 947348a213475aa8
zh: 6cb83c078ba7cda4
/session-persistence-event-catalog/events:
en: f4776ba3d0fd53ce
zh: e86769f50a69055a
@@ -45,11 +45,11 @@
en: 44426b6cd0dc01cf
zh: 44426b6cd0dc01cf
/session-persistence-event-catalog/events/assistant/assistant-attempt-log-only:
en: 70e451c323143cc6
zh: da3d9431dcdf6f72
en: 33e9a1cbce49bbd7
zh: b37b523a2589bc82
/session-persistence-event-catalog/events/assistant/assistant-message-surface:
en: 20a219d6bec394b5
zh: 8e736cc1a9cb91eb
en: 99e67ee50b939919
zh: ca076679cc8106da
/session-persistence-event-catalog/events/command:
en: 2cecb5b0ee955732
zh: 2cecb5b0ee955732
@@ -159,11 +159,11 @@
en: a8df82440ebdf5f8
zh: a8df82440ebdf5f8
/session-persistence-event-catalog/events/request/request-context-log-only:
en: 1a3b4a851c4fcd5f
zh: 6b04d16c3b887bb9
en: acf595ccb477ab86
zh: 19abbc18519cea2c
/session-persistence-event-catalog/events/request/request-header-log-only:
en: 76b36e4dd1ddbbb9
zh: fd33cc82251a53e1
en: eea3fc7b778e14e7
zh: aada32461c3afbb8
/session-persistence-event-catalog/events/sandbox:
en: ec841ab8439335b0
zh: ec841ab8439335b0
@@ -180,8 +180,8 @@
en: a1ac8f2660a4f61e
zh: a1ac8f2660a4f61e
/session-persistence-event-catalog/events/session/session-end-seed-log-only:
en: 0ba9c67eb5a991ed
zh: 9500b1e7ef982308
en: 4b82c000625b81e9
zh: 4a7a21ae050e969f
/session-persistence-event-catalog/events/session/session-title-log-only:
en: 5775e52a72c0ce94
zh: fa211a35b4660c10
@@ -219,8 +219,8 @@
en: 8cac41d2fb575975
zh: 8cac41d2fb575975
/session-persistence-event-catalog/events/system/system-message-surface:
en: 0884bfe2040c0fd1
zh: 0585042a60f95b6e
en: 9da99ca575bd97d5
zh: ead74ecdaf33c8b7
/session-persistence-event-catalog/events/team:
en: a640800a38b3c874
zh: a640800a38b3c874
@@ -249,8 +249,8 @@
en: 28a24430609494b2
zh: 28a24430609494b2
/session-persistence-event-catalog/events/tool/tool-call-log-only:
en: 1a037457c37eee87
zh: 83b4ecf3a566010c
en: a97db8769bd351ea
zh: 680a7392fcb715fb
/session-persistence-event-catalog/events/tool/tool-ptc-dispatch-log-only:
en: a62b38c00afed655
zh: 793bef93e856eafa
@@ -258,8 +258,8 @@
en: da841b1ed3b22c87
zh: 4c9a4d4bc5bd76b6
/session-persistence-event-catalog/events/tool/tool-result-surface:
en: fab9aa908584968a
zh: 689883ffd34869e1
en: 3abd9e71037acea2
zh: 6f1e4d4e3d363583
/session-persistence-event-catalog/events/tool-workflow:
en: 1eac7deac6af15f3
zh: 1eac7deac6af15f3
@@ -723,8 +723,11 @@
en: ade80ed58d3b63b2
zh: ade80ed58d3b63b2
/session-persistence-event-catalog/resolved-persistence-types/resume:
en: f9a34b26963fc22d
zh: f9a34b26963fc22d
en: e08f6b049bcee33f
zh: e08f6b049bcee33f
/session-persistence-event-catalog/resolved-persistence-types/retired:
en: 5ea243f5684bee1a
zh: 5ea243f5684bee1a
/session-persistence-event-catalog/resolved-persistence-types/retry:
en: 68c90ebe83c80004
zh: 68c90ebe83c80004
@@ -1005,8 +1008,8 @@
en: 5341a464a13a03e4
zh: 24646b10e58ba2cd
/session-persistence-event-catalog/resolved-persistence-types/assistantmessage:
en: 6256529c68fa8a4a
zh: c6b36aa7ed6a6561
en: 11077588e9861b8d
zh: 8fcff40427ce4915
/session-persistence-event-catalog/resolved-persistence-types/assistantstreamrecord:
en: 06ea09d614a94006
zh: 03ebd4893c9ac303
@@ -1014,8 +1017,8 @@
en: e393deed01de3665
zh: 0fa98ad93c22ce79
/session-persistence-event-catalog/resolved-persistence-types/commandsource:
en: eb46c8a1fdacd013
zh: 7e331ff3531407d2
en: bdaf9b779349eb45
zh: 4e8bf75576add88d
/session-persistence-event-catalog/resolved-persistence-types/compactioncheckpointsource:
en: 0795c7736e079322
zh: b95c1b8790851588
@@ -1029,8 +1032,8 @@
en: 9207aa0489ccf8db
zh: 850dd92da6769998
/session-persistence-event-catalog/resolved-persistence-types/contextsnapshotsection:
en: b1ee86f2cffbf211
zh: c829b0ddfef06ea8
en: 147c4af9218e2d58
zh: 54b1c3d96c1aab3b
/session-persistence-event-catalog/resolved-persistence-types/contextsnapshotsection~2:
en: 6e11a7855b002f20
zh: d752566bb2b75948
@@ -1038,11 +1041,11 @@
en: a6a2e38fdd6d127a
zh: 1fe82356d89f5769
/session-persistence-event-catalog/resolved-persistence-types/deepseeksearchllmrequest:
en: e044fc1cee2eb7d4
zh: efe705bce6fc0ef9
en: 72147977c1f0912b
zh: 5de53295844b841a
/session-persistence-event-catalog/resolved-persistence-types/developermessage:
en: 116cc4dc07d18606
zh: 3f91cbe2b5fff144
en: 9e105d38578e91a7
zh: 72c7bbaba383026a
/session-persistence-event-catalog/resolved-persistence-types/epochheader:
en: fa7fd1a765a494e2
zh: fd8e6fdd37d986cf
@@ -1152,11 +1155,11 @@
en: 6dbe099c62f7c226
zh: 6fd788f63c038c91
/session-persistence-event-catalog/resolved-persistence-types/llmretrystartedeventdata:
en: cf2fa679500b170f
zh: c5ae8545aede2062
en: d5eb01a11ddbbfa8
zh: 7506a09990ec82fa
/session-persistence-event-catalog/resolved-persistence-types/message:
en: 43a4e4bd1200fc62
zh: 0358110cfec20dd7
en: 84a5d53f9c04f98d
zh: 0d1f866f8ba7b598
/session-persistence-event-catalog/resolved-persistence-types/messagefeedbackdelete:
en: c582953270d4ca44
zh: 966ccfe2e7660a2a
@@ -1167,14 +1170,14 @@
en: f58575a1fc96df42
zh: 9f0c6ed9033e5c9d
/session-persistence-event-catalog/resolved-persistence-types/messagefeedbackrating:
en: 8056c68bde26363d
zh: d8cbe789276124b1
en: 9dbb00077e6d69ec
zh: d6bd4cd4120faa77
/session-persistence-event-catalog/resolved-persistence-types/messagesource:
en: 908ec41c770af7d9
zh: bf07ae6532c9e850
en: e008933d587a950a
zh: 728e309a5808a35a
/session-persistence-event-catalog/resolved-persistence-types/message~2:
en: 93d183436da8c385
zh: c877886104c2a594
en: cf2472051587430a
zh: 31a5d78baa9d2e9c
/session-persistence-event-catalog/resolved-persistence-types/modelmessagesource:
en: 65a618e2ec94bbc4
zh: 622197f4b127068b
@@ -1233,11 +1236,11 @@
en: 9a54c4478ad3b620
zh: 02c4c1fd7e252770
/session-persistence-event-catalog/resolved-persistence-types/sessiontitleeventdata:
en: cdcdc0620e6d7c49
zh: 3a4e98cb9544c12e
en: 2bb68ce98e9a476f
zh: 741c68f855e0338b
/session-persistence-event-catalog/resolved-persistence-types/sessiontitlellmrequesteventdata:
en: 8a721906148e35c3
zh: 4964b375d0a1bd9f
en: 17de88c8bd3e34c8
zh: 666c679a58a757cc
/session-persistence-event-catalog/resolved-persistence-types/sessiontitlemodelidentity:
en: 7a7245bb23c38655
zh: 6d96a94c367fbe64
@@ -1269,14 +1272,20 @@
en: e6d9113dc09f4098
zh: 3426e4f2f3cc5612
/session-persistence-event-catalog/resolved-persistence-types/surfaceop:
en: 26f3d59c80d9abbe
zh: 90a9ba58ff06d197
en: 055e5ecdd20a9ac5
zh: 621b82ced9e91c73
/session-persistence-event-catalog/resolved-persistence-types/systemmessage:
en: f689bc49f7561a5d
zh: c5eeb6590dcdf42d
en: f1bbb8d6f1127c4a
zh: 755e1725addb8bff
/session-persistence-event-catalog/resolved-persistence-types/systempromptmessagesource:
en: d325b34f94e9c4e8
zh: 11db81c2aba9d275
en: 9dae7b7ce10d0a5d
zh: e05e816d7a7caa52
/session-persistence-event-catalog/resolved-persistence-types/systempromptsectionstate:
en: 28cad56982138a23
zh: d6285389f72d28ef
/session-persistence-event-catalog/resolved-persistence-types/systempromptsectionstate~2:
en: 4f6fa9bc7e915a95
zh: 2aa6c5d2da5dc003
/session-persistence-event-catalog/resolved-persistence-types/teammemberphase:
en: bf78ae1a14d64469
zh: 0d5c34aff23a133c
@@ -1323,8 +1332,8 @@
en: b2488366535b5fdc
zh: b64d50345521eb99
/session-persistence-event-catalog/resolved-persistence-types/toolresultmessage:
en: 49fcbb63c824347e
zh: 187486d676edfe0e
en: 9258f30a9c4e2a3a
zh: c44d997d719e863c
/session-persistence-event-catalog/resolved-persistence-types/toolschema:
en: afa1e3fd9ccdd95b
zh: 7af667e3ebac25e8
@@ -1347,14 +1356,14 @@
en: 73fde4d98617b19f
zh: adae612c15a67764
/session-persistence-event-catalog/resolved-persistence-types/turnendreason:
en: 883ed71f55d838fd
zh: 6e5251555f9fa362
en: 72a26cd49fe16ead
zh: f8d8a4b6c52bdb48
/session-persistence-event-catalog/resolved-persistence-types/usermessage:
en: 2efbd385157c572a
zh: 8472acc0f626ce58
en: 0a358975d714a560
zh: ea7e80a27528364a
/session-persistence-event-catalog/resolved-persistence-types/usermessage~2:
en: 7df6a7019dc1adbf
zh: 1f193dc2d0dc672e
en: 962079fc729592c4
zh: 506bb301b8073ed9
/session-persistence-event-catalog/resolved-persistence-types/workflowagentoutcome:
en: 711564ea7898e156
zh: 36b88b84a6dc3c7e
@@ -1449,8 +1458,8 @@
en: a117573a5d58cb3c
zh: d5ad59e17a3a815d
/session-persistence-event-catalog/resolved-persistence-types/arguments-callid-name-step:
en: 0762eb6df9be91ea
zh: 06f6c1641ab6e0a2
en: a0dd6cf41edda23b
zh: 5b4448dfd06c1df1
/session-persistence-event-catalog/resolved-persistence-types/callid-files-turn:
en: 5f4d3f66ed86a14d
zh: 7c729360fa1279e6
@@ -1494,8 +1503,8 @@
en: 90d6159479e5d717
zh: c4dbebd0950e55e9
/session-persistence-event-catalog/resolved-persistence-types/code-name-reason:
en: 7ae42d830651c83c
zh: 1387de7f803d9f08
en: b87639528f5741ae
zh: d3f2edeaf7f700d9
/session-persistence-event-catalog/resolved-persistence-types/commandid-kind-sourceeventseq-text:
en: 87b03e1c73d2a326
zh: d7b9f06863cad891
@@ -1509,8 +1518,11 @@
en: 45f1d815198508e1
zh: 5c2818b0e38e1356
/session-persistence-event-catalog/resolved-persistence-types/compactionid-sourcecommandid-turn:
en: bef51e0442ebb903
zh: 240ebeb160533d8c
en: 4e49d16788ac2266
zh: 741b64ae662a6673
/session-persistence-event-catalog/resolved-persistence-types/contentindex-name-noticeindex-order:
en: 9a09c926e253e127
zh: ae6b5205b716c266
/session-persistence-event-catalog/resolved-persistence-types/cwd:
en: dfc595f52f794ea2
zh: ae9754ae00a97b5f
@@ -1542,14 +1554,14 @@
en: 4b7a8793663d3fef
zh: 249459c825d330c3
/session-persistence-event-catalog/resolved-persistence-types/endseq-op-startseq:
en: 1b7de272fcc24627
zh: 1464f7df891db98b
en: bc675a9ffc91a809
zh: 64d06e2fe6f6af7f
/session-persistence-event-catalog/resolved-persistence-types/error-kind-error:
en: 1abf274246674789
zh: 3d8c38c4240f7e3c
/session-persistence-event-catalog/resolved-persistence-types/error-message-meta-step:
en: 20db789d8ae2101c
zh: 77e21bc4380a7033
en: 07b24cc065b76e48
zh: 118cce0059445f56
/session-persistence-event-catalog/resolved-persistence-types/failure-kind-aborted:
en: 7dddcbc923491531
zh: bbdaea7d433b6fda
@@ -1557,11 +1569,11 @@
en: 4cb1c48095df98dc
zh: 5a03e44761af559e
/session-persistence-event-catalog/resolved-persistence-types/header-reason-startsseries:
en: 747233c059621ae6
zh: c43d942a7feb996f
en: 8855003b11c5be0e
zh: 08f17602961534ff
/session-persistence-event-catalog/resolved-persistence-types/headerseq-message-step-turn:
en: 4a0977d6ef222a05
zh: a85ce6839bc04604
en: 12a429b645f91e18
zh: 869a1f157ccf89a0
/session-persistence-event-catalog/resolved-persistence-types/height-width:
en: a5df50710083ac25
zh: aad3ccf6f6de70e4
@@ -1578,14 +1590,14 @@
en: 41f73c58a77dfa28
zh: af77f4aee3cb4a40
/session-persistence-event-catalog/resolved-persistence-types/inherited:
en: 26b15ad93125db72
zh: 78b407367bbebe52
en: ac8a8e92a98817c2
zh: 8e16e472edf6a90e
/session-persistence-event-catalog/resolved-persistence-types/inserted-outcome-removedcount-start:
en: c43e5f1a961a97c7
zh: 4ab16a990eca92ff
en: 73a9cecdafc5efc2
zh: 44a78523b8b66fab
/session-persistence-event-catalog/resolved-persistence-types/interrupted-message-step-stream:
en: 35e45d462a41e963
zh: 89953d22ddada652
en: bf346c833781e3f5
zh: 5c4fef4be447f3bb
/session-persistence-event-catalog/resolved-persistence-types/kind-aborted-reason:
en: ee4118da9df6d1e5
zh: 0c6ef48c9a1f8ed2
@@ -1953,11 +1965,11 @@
en: efe43158304eaf7b
zh: 7a4b0d7f1a9f1c65
/session-persistence-event-catalog/resolved-persistence-types/member-teamid-version:
en: 33c28b8c72b73604
zh: 8b606ec7196176c8
en: 59023eed71bfbf05
zh: ededa82c7d83290a
/session-persistence-event-catalog/resolved-persistence-types/message-step-turn:
en: 9573c6e91d1e3f53
zh: ddd2b6dab3dec069
en: 8521286d1a1056e5
zh: d38a37026b0d2cda
/session-persistence-event-catalog/resolved-persistence-types/message-teamid-version:
en: 6eab6fceb441352e
zh: 353625684fd63022
@@ -1965,8 +1977,11 @@
en: 39b24e7c4c5d21dc
zh: 33b0c2e6b76979f2
/session-persistence-event-catalog/resolved-persistence-types/mode-source:
en: 3028b222670ce5ad
zh: cae4c9437e560d61
en: 891d02aa89eff082
zh: edad8335e8efa145
/session-persistence-event-catalog/resolved-persistence-types/name-noticeindex-state:
en: 2313554c481b68ff
zh: d54480a39b4ddf10
/session-persistence-event-catalog/resolved-persistence-types/policy-source:
en: 88fd92dff7aa505f
zh: b400712b3ef749aa
@@ -1986,8 +2001,8 @@
en: 7a2ab7b62244f43b
zh: 1084e3f8876feebc
/session-persistence-event-catalog/resolved-persistence-types/step-stream-turn:
en: 034511416374bd90
zh: baa4945de30bb0f5
en: be67a9a7f1592258
zh: 1609b2e1bb3b6305
/session-persistence-event-catalog/resolved-persistence-types/step-turn:
en: 6b52ead32f8457f6
zh: db9f15511b123e7d
@@ -2004,11 +2019,11 @@
en: e0d6826170f96136
zh: c684a666de7cee7c
/session-persistence-event-catalog/resolved-persistence-types/type-agent-preset-selected:
en: 6f4e460cc02ecb54
zh: cbc4655190a0596a
en: 983a5fd8f9e6242b
zh: a777113f7d77ea4c
/session-persistence-event-catalog/resolved-persistence-types/type-agent-inbox-spliced:
en: bfa17b1dd35c840a
zh: 3cd4658024ce7417
en: 64d4b2b98154b78c
zh: be115f2716f9d004
/session-persistence-event-catalog/resolved-persistence-types/type-approval-asked:
en: 9c77f18b0dad22f0
zh: 8894cf2878fe90db
@@ -2052,11 +2067,11 @@
en: ba73fb10b7e2ffc9
zh: 8d5c97e63e5f16da
/session-persistence-event-catalog/resolved-persistence-types/type-deliverables-presented:
en: 9804c72cee421005
zh: 27b031dee4e371c4
en: 9b03a0ac813e6648
zh: 4c25e9a2cfca8db8
/session-persistence-event-catalog/resolved-persistence-types/type-developer-message:
en: 75fd3954fcf8628d
zh: 69d808b702e90e15
en: d63f42c81158ec4c
zh: 030d004f65b3a071
/session-persistence-event-catalog/resolved-persistence-types/type-disabled:
en: 04db8a26a3befdd4
zh: 8b24a37ac00bac8a
@@ -2130,11 +2145,11 @@
en: acf7e21e4d21ebff
zh: fb83a853634d204a
/session-persistence-event-catalog/resolved-persistence-types/type-session-title:
en: 978de727067fd9e1
zh: 6a4c91b2aa5479ad
en: 486f85017d5e3118
zh: a2ced7eddb4c7a2e
/session-persistence-event-catalog/resolved-persistence-types/type-session-title-llm-request:
en: aeb2eb7f645f92a0
zh: ecf4aa7d6247628b
en: c7506a8bf5b336e9
zh: 6694131899a31148
/session-persistence-event-catalog/resolved-persistence-types/type-step-end:
en: 7fc233c4a569dae2
zh: bc2b3fed4a397c00
@@ -2148,11 +2163,11 @@
en: 2adab4361a5b558d
zh: 7f2a8da669f9e117
/session-persistence-event-catalog/resolved-persistence-types/type-subagent-model-selection-policy:
en: 9dd6539f4a5d9d16
zh: d886630b70a4bce8
en: a855fb4ac71a9bb1
zh: 19ea03f91f01d8cf
/session-persistence-event-catalog/resolved-persistence-types/type-system-message:
en: 7fb45f52932f268b
zh: 5019109b99274589
en: 7ccb329e6cac5333
zh: 212eea52a06b42ee
/session-persistence-event-catalog/resolved-persistence-types/type-team-member:
en: d21fd23a5254e74f
zh: effe5a8971aaeef5
@@ -2214,11 +2229,11 @@
en: 1b045de96172be4b
zh: 8a15c6f35b576b37
/session-persistence-event-catalog/resolved-persistence-types/type-usage:
en: 7e301e838a718abd
zh: fbf004287370a259
en: d024dc1a91b2d7a7
zh: a0781b6651bf5de8
/session-persistence-event-catalog/resolved-persistence-types/type-user-message:
en: 6a3fdd4c0501be4a
zh: b5ddb6da9843466d
en: d3a84b26416a1aa7
zh: 66b304803a341b70
/session-persistence-event-catalog/resolved-persistence-types/type-web-deepseek-search-llm-request:
en: 99c8837344178a47
zh: bf746f5678346596
+159 -100
View File
@@ -23,7 +23,7 @@ The [format references](persistence-changes/historical-formats/README.md) cover
| `JsonlHeaderLine` | header | `18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f` | [`HeaderLine`](#persistence-type-sha256-18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f) |
| `SessionEventEnvelope` | envelope | `5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc` | [`union (3 variants)`](#persistence-type-sha256-5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc) |
| `event:agent-preset/selected` | event | `a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b` | [`{ type: "agent-preset/selected" }`](#persistence-type-sha256-a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b) |
| `event:agent/inbox/spliced` | event | `5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb` | [`{ type: "agent/inbox/spliced" }`](#persistence-type-sha256-5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb) |
| `event:agent/inbox/spliced` | event | `2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498` | [`{ type: "agent/inbox/spliced" }`](#persistence-type-sha256-2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498) |
| `event:approval/asked` | event | `3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1` | [`{ type: "approval/asked" }`](#persistence-type-sha256-3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1) |
| `event:approval/decided` | event | `bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3` | [`{ type: "approval/decided" }`](#persistence-type-sha256-bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3) |
| `event:approval/policy` | event | `26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78` | [`{ type: "approval/policy" }`](#persistence-type-sha256-26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78) |
@@ -36,7 +36,7 @@ The [format references](persistence-changes/historical-formats/README.md) cover
| `event:compaction/start` | event | `db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965` | [`{ type: "compaction/start" }`](#persistence-type-sha256-db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965) |
| `event:compaction/summary` | event | `e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602` | [`{ type: "compaction/summary" }`](#persistence-type-sha256-e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602) |
| `event:deliverables/presented` | event | `13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176` | [`{ type: "deliverables/presented" }`](#persistence-type-sha256-13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176) |
| `event:developer/message` | event | `53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e` | [`{ type: "developer/message" }`](#persistence-type-sha256-53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e) |
| `event:developer/message` | event | `ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4` | [`{ type: "developer/message" }`](#persistence-type-sha256-ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4) |
| `event:feedback/message-delete` | event | `3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796` | [`{ type: "feedback/message-delete" }`](#persistence-type-sha256-3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796) |
| `event:feedback/message-put` | event | `b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf` | [`{ type: "feedback/message-put" }`](#persistence-type-sha256-b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf) |
| `event:feedback/record` | event | `b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8` | [`{ type: "feedback/record" }`](#persistence-type-sha256-b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8) |
@@ -58,13 +58,13 @@ The [format references](persistence-changes/historical-formats/README.md) cover
| `event:session-log-deepseek/delivery-accepted` | event | `d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9` | [`{ type: "session-log-deepseek/delivery-accepted" }`](#persistence-type-sha256-d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9) |
| `event:session/end-seed` | event | `5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e` | [`{ type: "session/end-seed" }`](#persistence-type-sha256-5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e) |
| `event:session/title` | event | `1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5` | [`{ type: "session/title" }`](#persistence-type-sha256-1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5) |
| `event:session/title-llm-request` | event | `5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260` | [`{ type: "session/title-llm-request" }`](#persistence-type-sha256-5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260) |
| `event:session/title-llm-request` | event | `1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545` | [`{ type: "session/title-llm-request" }`](#persistence-type-sha256-1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545) |
| `event:step/end` | event | `e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05` | [`{ type: "step/end" }`](#persistence-type-sha256-e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05) |
| `event:step/start` | event | `4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986` | [`{ type: "step/start" }`](#persistence-type-sha256-4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986) |
| `event:subagent/catalog` | event | `d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41` | [`{ type: "subagent/catalog" }`](#persistence-type-sha256-d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41) |
| `event:subagent/descriptor` | event | `b79ada42962cad0190a9d465805260567621fa3a4abd757eb31e6016b52d5ab5` | [`{ type: "subagent/descriptor" }`](#persistence-type-sha256-b79ada42962cad0190a9d465805260567621fa3a4abd757eb31e6016b52d5ab5) |
| `event:subagent/model-selection-policy` | event | `a6567ccb2e530606b775371eb4fa31468d72084339968e8b0440a516a23b39dc` | [`{ type: "subagent/model-selection-policy" }`](#persistence-type-sha256-a6567ccb2e530606b775371eb4fa31468d72084339968e8b0440a516a23b39dc) |
| `event:system/message` | event | `69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1` | [`{ type: "system/message" }`](#persistence-type-sha256-69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1) |
| `event:system/message` | event | `ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d` | [`{ type: "system/message" }`](#persistence-type-sha256-ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d) |
| `event:team/member` | event | `4fb59762612c3e3ac3a3bd4f84c9c148d3c3893bd422ba2b201cc039fabd49bc` | [`{ type: "team/member" }`](#persistence-type-sha256-4fb59762612c3e3ac3a3bd4f84c9c148d3c3893bd422ba2b201cc039fabd49bc) |
| `event:team/message/delivered` | event | `48f9c19417a1abbedfa59f4667bba36b93ac2db407adf5e84cb3ba0de30942cb` | [`{ type: "team/message/delivered" }`](#persistence-type-sha256-48f9c19417a1abbedfa59f4667bba36b93ac2db407adf5e84cb3ba0de30942cb) |
| `event:team/message/queued` | event | `21fb6a90d5068f6a0003b7ab316ed2f56342477146a65c00db0f13c4d8df667d` | [`{ type: "team/message/queued" }`](#persistence-type-sha256-21fb6a90d5068f6a0003b7ab316ed2f56342477146a65c00db0f13c4d8df667d) |
@@ -81,7 +81,7 @@ The [format references](persistence-changes/historical-formats/README.md) cover
| `event:tool/result` | event | `7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397` | [`{ type: "tool/result" }`](#persistence-type-sha256-7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397) |
| `event:turn/end` | event | `0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce` | [`{ type: "turn/end" }`](#persistence-type-sha256-0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce) |
| `event:turn/start` | event | `aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8` | [`{ type: "turn/start" }`](#persistence-type-sha256-aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8) |
| `event:user/message` | event | `3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a` | [`{ type: "user/message" }`](#persistence-type-sha256-3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a) |
| `event:user/message` | event | `8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950` | [`{ type: "user/message" }`](#persistence-type-sha256-8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950) |
| `event:web/deepseek-search-llm-request` | event | `0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52` | [`{ type: "web/deepseek-search-llm-request" }`](#persistence-type-sha256-0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52) |
| `event:working-directory/change` | event | `124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3` | [`{ type: "working-directory/change" }`](#persistence-type-sha256-124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3) |
| `event:workspace-root/change` | event | `025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc` | [`{ type: "workspace-root/change" }`](#persistence-type-sha256-025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc) |
@@ -162,7 +162,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
}[T]
```
Sources: [`packages/core/session/src/types.ts:443`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:451`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:474`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:510`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:440`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:448`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:471`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:507`](../packages/core/session/src/types.ts)
## Events
@@ -291,7 +291,7 @@ Source: [`packages/interaction/user-approval/src/index.ts:41`](../packages/inter
'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[] }
```
Source: [`packages/core/session/src/types.ts:367`](../packages/core/session/src/types.ts)
Source: [`packages/core/session/src/types.ts:364`](../packages/core/session/src/types.ts)
<a id="assistantmessage--surface"></a>
@@ -321,7 +321,7 @@ Source: [`packages/core/session/src/types.ts:367`](../packages/core/session/src/
Types: [TokenUsage](subsystems/llm-streaming.md)
Source: [`packages/core/session/src/types.ts:353`](../packages/core/session/src/types.ts)
Source: [`packages/core/session/src/types.ts:350`](../packages/core/session/src/types.ts)
### `command/*`
@@ -748,13 +748,13 @@ Source: [`packages/plan/plan-mode/src/index.ts:55`](../packages/plan/plan-mode/s
/**
* Route metadata for the next request, logged only when the route, capacity,
* or system prompt update mode changes. It does not participate in request
* reconstruction or header equality. Prompt admission uses the bound prepared
* call's capability, not this snapshot from an earlier request.
* reconstruction, header equality, or system-section admission. The bound
* prepared call's capabilities determine adapter representation.
*/
'request/context': RequestContext
```
Source: [`packages/core/session/src/types.ts:414`](../packages/core/session/src/types.ts)
Source: [`packages/core/session/src/types.ts:411`](../packages/core/session/src/types.ts)
<a id="requestheader--log-only"></a>
@@ -773,7 +773,7 @@ Source: [`packages/core/session/src/types.ts:414`](../packages/core/session/src/
}
```
Source: [`packages/core/session/src/types.ts:402`](../packages/core/session/src/types.ts)
Source: [`packages/core/session/src/types.ts:399`](../packages/core/session/src/types.ts)
### `sandbox/*`
@@ -850,7 +850,7 @@ Source: [`packages/schedule/schedule/src/types.ts:625`](../packages/schedule/sch
'session/end-seed': { inherited?: true }
```
Source: [`packages/core/session/src/types.ts:439`](../packages/core/session/src/types.ts)
Source: [`packages/core/session/src/types.ts:436`](../packages/core/session/src/types.ts)
<a id="sessiontitle--log-only"></a>
@@ -984,23 +984,20 @@ Source: [`packages/subagent/tool-subagent/src/model-selection-state.ts:12`](../p
```ts persistence-catalog
/**
* The rendered system prompt on the model-visible surface. The loop appends
* the first one as surface node 0 before the step's first `user/message`.
* A prepared in-history route can append nonempty changes in a continuing
* series. An incapable route, or a new series whose effective text differs,
* normalizes text to the first system node; a series start whose latest
* surviving node already holds the rendering leaves it in place.
* Normalization empties nonempty later nodes, then rewrites the head if
* needed, through logged per-node replacements. An empty rendering always
* clears all active system nodes, leaving no older instructions model-visible.
* Empty later nodes are dormant and project to no message; an empty head with
* no active later node records "no system prompt". Restored nonempty text follows
* the same route and series rule; empty nodes never restore older text.
* System instructions and notices on the model-visible surface. The first
* accepted assembly reserves node 0, even with empty content. Later admissions
* append new or changed sections independently of the route's capabilities.
* Source metadata identifies canonical text and notices; retired records remove
* a source from committed state. Empty active text withdraws its instructions
* while preserving the source. Earlier messages retain their positions.
* `source.reset` replaces committed state, including when compaction rebuilds
* the initial system node from current instructions.
* Empty system nodes remain in the surface but produce no model message.
*/
'system/message': { turn: number; step: number; message: SystemMessage }
```
Source: [`packages/core/session/src/types.ts:342`](../packages/core/session/src/types.ts)
Source: [`packages/core/session/src/types.ts:339`](../packages/core/session/src/types.ts)
### `team/*`
@@ -1104,7 +1101,7 @@ Source: [`packages/todo/tool-todo/src/types.ts:33`](../packages/todo/tool-todo/s
Types: [ToolCallId](subsystems/core.md)
Source: [`packages/core/session/src/types.ts:373`](../packages/core/session/src/types.ts)
Source: [`packages/core/session/src/types.ts:370`](../packages/core/session/src/types.ts)
<a id="toolptc-dispatch--log-only"></a>
@@ -1185,7 +1182,7 @@ Source: [`packages/core/tool-executor-ptc/src/types.ts:45`](../packages/core/too
}
```
Source: [`packages/core/session/src/types.ts:387`](../packages/core/session/src/types.ts)
Source: [`packages/core/session/src/types.ts:384`](../packages/core/session/src/types.ts)
### `tool-workflow/*`
@@ -2468,6 +2465,14 @@ SHA-256: `34d1ab5c5df378186d6054b1a1beea9a41e41965d6f336f0bc0025c441a82e66`
`"resume"`
<a id="persistence-type-sha256-4902846b72aabae5f4e20e8f518d7fbfd62f1fef44d180c56793e2edf2ef0903"></a>
### `"retired"`
SHA-256: `4902846b72aabae5f4e20e8f518d7fbfd62f1fef44d180c56793e2edf2ef0903`
`"retired"`
<a id="persistence-type-sha256-63ba8895cc09e4693cf0819fdcd18c084bef195febda5b6a23af279b3852be36"></a>
### `"retry"`
@@ -3275,7 +3280,7 @@ One of:
SHA-256: `fa87537f4a9c1e25602990a8bf686b383e9e00352ec8946e16ae24ba7c1625be`
Sources: [`packages/llm/llm/src/message.ts:166`](../packages/llm/llm/src/message.ts)
Sources: [`packages/llm/llm/src/message.ts:192`](../packages/llm/llm/src/message.ts)
| Property | Presence | Type |
|---|---|---|
@@ -3321,7 +3326,7 @@ Array of [`AssistantStreamRecord`](#persistence-type-sha256-33341aac09312300de5a
SHA-256: `ada310bf0bdb8fed51f3b56ea63f6ea6b18bbd587f04fccb63a14ab0b2a24e05`
Sources: [`packages/core/session/src/types.ts:199`](../packages/core/session/src/types.ts) · [`packages/interaction/commands/src/types.ts:75`](../packages/interaction/commands/src/types.ts) · [`packages/interaction/commands/src/types.ts:79`](../packages/interaction/commands/src/types.ts) · [`packages/llm/llm/src/message.ts:110`](../packages/llm/llm/src/message.ts) · [`packages/session/session-title/src/types.ts:35`](../packages/session/session-title/src/types.ts)
Sources: [`packages/core/session/src/types.ts:199`](../packages/core/session/src/types.ts) · [`packages/interaction/commands/src/types.ts:75`](../packages/interaction/commands/src/types.ts) · [`packages/interaction/commands/src/types.ts:79`](../packages/interaction/commands/src/types.ts) · [`packages/llm/llm/src/message.ts:136`](../packages/llm/llm/src/message.ts) · [`packages/session/session-title/src/types.ts:35`](../packages/session/session-title/src/types.ts)
| Property | Presence | Type |
|---|---|---|
@@ -3407,7 +3412,7 @@ Array of [`ContentBlock`](#persistence-type-sha256-8064c03c87c357fd1575cb9395ce8
SHA-256: `86e1e384495ee09ac2d60c9db3610f1f1fddac2d248f6f1d6000e78054680219`
Sources: [`packages/llm/llm/src/message.ts:69`](../packages/llm/llm/src/message.ts)
Sources: [`packages/llm/llm/src/message.ts:95`](../packages/llm/llm/src/message.ts)
| Property | Presence | Type |
|---|---|---|
@@ -3464,7 +3469,7 @@ Sources: [`packages/web/web-search-deepseek/src/provider.ts:56`](../packages/web
| `body` | required | [`{ max_tokens, messages, model, thinking?, … }`](#persistence-type-sha256-9c001ecb5e1d3c3894410db2a1e383842e5f8454fb52182338686158abc1b3ee) |
| `endpoint` | required | `string` |
<a id="persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7"></a>
<a id="persistence-type-sha256-7645031a0886c6fb99b759d13b08a52ceb55d37b853173213fbf87b240fb0088"></a>
<a id="persistence-type-developermessage"></a>
@@ -3472,16 +3477,16 @@ Sources: [`packages/web/web-search-deepseek/src/provider.ts:56`](../packages/web
### `DeveloperMessage`
SHA-256: `3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7`
SHA-256: `7645031a0886c6fb99b759d13b08a52ceb55d37b853173213fbf87b240fb0088`
Sources: [`packages/llm/llm/src/message.ts:156`](../packages/llm/llm/src/message.ts)
Sources: [`packages/llm/llm/src/message.ts:182`](../packages/llm/llm/src/message.ts)
| Property | Presence | Type |
|---|---|---|
| `content` | required | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | required | `string` |
| `role` | required | `"developer"` |
| `source` | required | [`MessageSource`](#persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b) |
| `source` | required | [`MessageSource`](#persistence-type-sha256-9c75043166543713427121c82ed73cec6edbeeaf94e35e3ef5055d52197b57d8) |
Source compatibility: `source` — `session-source-attribution` v1; `session.developer-message.source`; `kind`; `preserve`.
@@ -4180,7 +4185,7 @@ Sources: [`packages/llm/llm-retry/src/types.ts:43`](../packages/llm/llm-retry/sr
| `step` | required | `number` |
| `turn` | required | `number` |
<a id="persistence-type-sha256-d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7"></a>
<a id="persistence-type-sha256-e7f07198d10adc34e5b4ecc079f4e267b9a135de4a4a457e929dd40602c3203e"></a>
<a id="persistence-type-message"></a>
@@ -4188,16 +4193,16 @@ Sources: [`packages/llm/llm-retry/src/types.ts:43`](../packages/llm/llm-retry/sr
### `Message`
SHA-256: `d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7`
SHA-256: `e7f07198d10adc34e5b4ecc079f4e267b9a135de4a4a457e929dd40602c3203e`
Sources: [`packages/llm/llm/src/message.ts:195`](../packages/llm/llm/src/message.ts)
Sources: [`packages/llm/llm/src/message.ts:221`](../packages/llm/llm/src/message.ts)
One of:
- [`ToolResultMessage`](#persistence-type-sha256-4b259f7f8f0a44ad5e90b70a73553ced1df27012d126921d397ff403b6c86731)
- [`DeveloperMessage`](#persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7)
- [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499)
- [`SystemMessage`](#persistence-type-sha256-09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363)
- [`DeveloperMessage`](#persistence-type-sha256-7645031a0886c6fb99b759d13b08a52ceb55d37b853173213fbf87b240fb0088)
- [`UserMessage`](#persistence-type-sha256-daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d)
- [`SystemMessage`](#persistence-type-sha256-04c12e59a9ed4d7a59b642223a9bdd3b4303c1d27873c72c5e487760892bbb08)
- [`AssistantMessage`](#persistence-type-sha256-fa87537f4a9c1e25602990a8bf686b383e9e00352ec8946e16ae24ba7c1625be)
<a id="persistence-type-sha256-7c6129b6961cf4b2a030f36c78d2b0a5be38617651a9b81322e054ee512bee06"></a>
@@ -4273,7 +4278,7 @@ One of:
- `"negative"`
- `"positive"`
<a id="persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b"></a>
<a id="persistence-type-sha256-9c75043166543713427121c82ed73cec6edbeeaf94e35e3ef5055d52197b57d8"></a>
<a id="persistence-type-messagesource"></a>
@@ -4281,9 +4286,9 @@ One of:
### `MessageSource`
SHA-256: `7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b`
SHA-256: `9c75043166543713427121c82ed73cec6edbeeaf94e35e3ef5055d52197b57d8`
Sources: [`packages/llm/llm/src/message.ts:135`](../packages/llm/llm/src/message.ts)
Sources: [`packages/llm/llm/src/message.ts:161`](../packages/llm/llm/src/message.ts)
| kind | Form property | Other required fields | Full definition |
|---|---|---|---|
@@ -4362,7 +4367,7 @@ Sources: [`packages/llm/llm/src/message.ts:135`](../packages/llm/llm/src/message
| `skill-catalog` | `"catalog"` | `entries`: [`{ description, name }[]`](#persistence-type-sha256-aba175fb20ffc71112c55efe70458ff5d7dbfb83501892b4ba8d077f0ea5d7ba) | [`SkillCatalogSource`](#persistence-type-sha256-65d583e66518c5236015e0846470fb32efcf92375ed306aef14e50a9d2cd2099) |
| `skill-invocation` | `"instructions"` | `name`: `string` | [`SkillInvocationSource`](#persistence-type-sha256-672c4aa2a9b736e3d6e5da6346d2e2ed5e3573f2d0baafa18e7407c9f3fee3db) |
| `subagent-settled` | `"notice"` | `senderSessionId`: `string`; `summary`: `string` | [`SubagentSettledMessageSource`](#persistence-type-sha256-848639f8787f035b480ec53cb5686850897c5e8006d87ca231cd8a9ee8634936) |
| `system-prompt` | not declared | none | [`SystemPromptMessageSource`](#persistence-type-sha256-65a8400e451e667e5b6e34df72ceb81fca8c12330330fa72083ad40279b189ad) |
| `system-prompt` | not declared | none | [`SystemPromptMessageSource`](#persistence-type-sha256-3d1339bcc98cb53714bf31ac4a6e7c9ce15a412dd58451778a383627367a4666) |
| `team-message` | not declared | `messageId`: `string`; `senderId`: `string`; `senderName`: `string`; `teamId`: `string` | [`TeamMessageSource`](#persistence-type-sha256-2152caf1a71e588e4df2358a806dea24936c1c47131134f01a12939d12cdc0c0) |
| `time-context` | `"catalog"` | none | [`{ kind: "time-context", form: "catalog" }`](#persistence-type-sha256-85fe96bf15d5c7559eec3bae4d6cf1a76fda9f5be05a29c2830cff560cab0c0d) |
| `time-context` | `"instructions"` | none | [`{ kind: "time-context", form: "instructions" }`](#persistence-type-sha256-f6afe41e3926f422fe849debe90819fddd739f0f59e20be9c71018b9554a7f09) |
@@ -4409,13 +4414,13 @@ Sources: [`packages/llm/llm/src/message.ts:135`](../packages/llm/llm/src/message
| `webhook` | `"notice"` | `deliveryId`: `string`; `provider`: `string`; `ruleId`: `string`; `source`: `string`; `summary`: `string` | [`{ kind: "webhook", form: "notice" }`](#persistence-type-sha256-9edc162949abf93bd5ff049191b345454ba104f583937ce5580fb50f067d2b94) |
| `working-directory` | not declared | none | [`{ kind: "working-directory" }`](#persistence-type-sha256-2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5) |
<a id="persistence-type-sha256-02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a"></a>
<a id="persistence-type-sha256-be53b443539d32c2c7247e137da830a5cec2dda18dccaaf1db6e3e72d55c4deb"></a>
### `Message[]`
SHA-256: `02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a`
SHA-256: `be53b443539d32c2c7247e137da830a5cec2dda18dccaaf1db6e3e72d55c4deb`
Array of [`Message`](#persistence-type-sha256-d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7).
Array of [`Message`](#persistence-type-sha256-e7f07198d10adc34e5b4ecc079f4e267b9a135de4a4a457e929dd40602c3203e).
<a id="persistence-type-sha256-719c51f67074f97034a6c94297fe1f4b5d3c8d392c57586dab732aa5398c7a91"></a>
@@ -4783,7 +4788,7 @@ Sources: [`packages/session/session-title/src/types.ts:41`](../packages/session/
| `source` | required | [`SessionTitleSource`](#persistence-type-sha256-30d5a537b296685770b1241c4b4bbde19d5a31ff81aa23df73fab5e90b8fc65f) |
| `title` | required | `string` |
<a id="persistence-type-sha256-8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69"></a>
<a id="persistence-type-sha256-e90c7a2af8e7d05b9184c819ef8b84711c1821e862494ba701839bd2895fc888"></a>
<a id="persistence-type-packagessessionsession-title-llmsrcindextssessiontitlellmrequesteventdata"></a>
@@ -4791,7 +4796,7 @@ Sources: [`packages/session/session-title/src/types.ts:41`](../packages/session/
### `SessionTitleLlmRequestEventData`
SHA-256: `8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69`
SHA-256: `e90c7a2af8e7d05b9184c819ef8b84711c1821e862494ba701839bd2895fc888`
Sources: [`packages/session/session-title-llm/src/index.ts:43`](../packages/session/session-title-llm/src/index.ts)
@@ -4799,7 +4804,7 @@ Sources: [`packages/session/session-title-llm/src/index.ts:43`](../packages/sess
|---|---|---|
| `maxTokens` | required | `number` |
| `messageSeqs` | required | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
| `messages` | required | [`Message[]`](#persistence-type-sha256-02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a) |
| `messages` | required | [`Message[]`](#persistence-type-sha256-be53b443539d32c2c7247e137da830a5cec2dda18dccaaf1db6e3e72d55c4deb) |
| `reasoningEffort` | optional | `string` |
| `route` | required | [`SessionTitleModelIdentity`](#persistence-type-sha256-07e1a58c58b593f507b8e7f25723bb0aa42baae6e00f5ecfddf28cb1e64d3235) |
| `system` | required | `string` |
@@ -5000,14 +5005,14 @@ Sources: [`packages/subagent/subagent/src/continuation-messages.ts:29`](../packa
SHA-256: `335e242de1fcc17b6ca920fc420d71bec2d76e53e37955c00948b65ab77f05c5`
Sources: [`packages/core/session/src/types.ts:474`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:471`](../packages/core/session/src/types.ts)
One of:
- `"append"`
- [`{ endSeq, op, startSeq }`](#persistence-type-sha256-bcf0caf62d964b2fcf5404bd5c909cfa9a21c3f3c96e6b7e36d9e33565223825)
<a id="persistence-type-sha256-09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363"></a>
<a id="persistence-type-sha256-04c12e59a9ed4d7a59b642223a9bdd3b4303c1d27873c72c5e487760892bbb08"></a>
<a id="persistence-type-packagesllmllmsrcmessagetssystemmessage"></a>
@@ -5015,18 +5020,18 @@ One of:
### `SystemMessage`
SHA-256: `09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363`
SHA-256: `04c12e59a9ed4d7a59b642223a9bdd3b4303c1d27873c72c5e487760892bbb08`
Sources: [`packages/llm/llm/src/message.ts:150`](../packages/llm/llm/src/message.ts)
Sources: [`packages/llm/llm/src/message.ts:176`](../packages/llm/llm/src/message.ts)
| Property | Presence | Type |
|---|---|---|
| `content` | required | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | required | `string` |
| `role` | required | `"system"` |
| `source` | required | [`SystemPromptMessageSource`](#persistence-type-sha256-65a8400e451e667e5b6e34df72ceb81fca8c12330330fa72083ad40279b189ad) |
| `source` | required | [`SystemPromptMessageSource`](#persistence-type-sha256-3d1339bcc98cb53714bf31ac4a6e7c9ce15a412dd58451778a383627367a4666) |
<a id="persistence-type-sha256-65a8400e451e667e5b6e34df72ceb81fca8c12330330fa72083ad40279b189ad"></a>
<a id="persistence-type-sha256-3d1339bcc98cb53714bf31ac4a6e7c9ce15a412dd58451778a383627367a4666"></a>
<a id="persistence-type-packagesllmllmsrcmessagetssystempromptmessagesource"></a>
@@ -5034,13 +5039,41 @@ Sources: [`packages/llm/llm/src/message.ts:150`](../packages/llm/llm/src/message
### `SystemPromptMessageSource`
SHA-256: `65a8400e451e667e5b6e34df72ceb81fca8c12330330fa72083ad40279b189ad`
SHA-256: `3d1339bcc98cb53714bf31ac4a6e7c9ce15a412dd58451778a383627367a4666`
Sources: [`packages/llm/llm/src/message.ts:34`](../packages/llm/llm/src/message.ts)
Sources: [`packages/llm/llm/src/message.ts:54`](../packages/llm/llm/src/message.ts)
| Property | Presence | Type |
|---|---|---|
| `complete` | optional | `true` |
| `kind` | required | `"system-prompt"` |
| `reset` | optional | `true` |
| `sections` | optional | [`SystemPromptSectionState[]`](#persistence-type-sha256-8decd4949d9ee4adccbe0b436abac75d5bf1a9bced2fd142866bdc5ff122833d) |
<a id="persistence-type-sha256-5b7abd24d8a133e7d43f7d8a5824e841233f57ddd2288d9923d3443ffa245e16"></a>
<a id="persistence-type-packagesllmllmsrcmessagetssystempromptsectionstate"></a>
<a id="persistence-type-systempromptsectionstate"></a>
### `SystemPromptSectionState`
SHA-256: `5b7abd24d8a133e7d43f7d8a5824e841233f57ddd2288d9923d3443ffa245e16`
Sources: [`packages/llm/llm/src/message.ts:34`](../packages/llm/llm/src/message.ts)
One of:
- [`{ contentIndex, name, noticeIndex?, order, … }`](#persistence-type-sha256-792eb6cb1f6bed8331e25d90ebd3b84a5c2c3f0f346ac5f64c4fb1d077eb463b)
- [`{ name, noticeIndex?, state }`](#persistence-type-sha256-a408aa610f991ff3c5a60164145c756e551c38ef5c8faf136920738077fea7a7)
<a id="persistence-type-sha256-8decd4949d9ee4adccbe0b436abac75d5bf1a9bced2fd142866bdc5ff122833d"></a>
### `SystemPromptSectionState[]`
SHA-256: `8decd4949d9ee4adccbe0b436abac75d5bf1a9bced2fd142866bdc5ff122833d`
Array of [`SystemPromptSectionState`](#persistence-type-sha256-5b7abd24d8a133e7d43f7d8a5824e841233f57ddd2288d9923d3443ffa245e16).
<a id="persistence-type-sha256-dfce5db4aa42b7ebe0bb79eca92553587287e18c06b9eba85cbfb9d332e26acd"></a>
@@ -5326,7 +5359,7 @@ Sources: [`packages/core/tools/src/contracts.ts:395`](../packages/core/tools/src
SHA-256: `4b259f7f8f0a44ad5e90b70a73553ced1df27012d126921d397ff403b6c86731`
Sources: [`packages/llm/llm/src/message.ts:172`](../packages/llm/llm/src/message.ts)
Sources: [`packages/llm/llm/src/message.ts:198`](../packages/llm/llm/src/message.ts)
| Property | Presence | Type |
|---|---|---|
@@ -5478,7 +5511,7 @@ Sources: [`packages/core/session/src/types.ts:242`](../packages/core/session/src
| `interrupted` | not declared | none | [`{ kind: "interrupted" }`](#persistence-type-sha256-56b7c047694875a843ba020dfea3c8380d54ae4ff88ab349e72004dc21e07c23) |
| `max-tokens` | not declared | none | [`{ kind: "max-tokens" }`](#persistence-type-sha256-ab7ec5f9eb2c6dfacca5da4c37cf7ba85d04172053ee6b1ebf1709ffcd99c1a7) |
<a id="persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499"></a>
<a id="persistence-type-sha256-daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d"></a>
<a id="persistence-type-packagesllmllmsrcmessagetsusermessage"></a>
@@ -5486,28 +5519,28 @@ Sources: [`packages/core/session/src/types.ts:242`](../packages/core/session/src
### `UserMessage`
SHA-256: `120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499`
SHA-256: `daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d`
Sources: [`packages/llm/llm/src/message.ts:161`](../packages/llm/llm/src/message.ts)
Sources: [`packages/llm/llm/src/message.ts:187`](../packages/llm/llm/src/message.ts)
| Property | Presence | Type |
|---|---|---|
| `content` | required | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | required | `string` |
| `role` | required | `"user"` |
| `source` | required | [`MessageSource`](#persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b) |
| `source` | required | [`MessageSource`](#persistence-type-sha256-9c75043166543713427121c82ed73cec6edbeeaf94e35e3ef5055d52197b57d8) |
Source compatibility: `source` — `session-source-attribution` v1; `session.user-message.source`; `kind`; `preserve`.
Attribution-only additions: `action-cards`, `tmux-context`, `user-question-reply`, `working-directory`.
<a id="persistence-type-sha256-6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85"></a>
<a id="persistence-type-sha256-f9c2cb19607330d3579328475bd02ccdf6b9e3d647eb195bc98cc2519dec5f7f"></a>
### `UserMessage[]`
SHA-256: `6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85`
SHA-256: `f9c2cb19607330d3579328475bd02ccdf6b9e3d647eb195bc98cc2519dec5f7f`
Array of [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499).
Array of [`UserMessage`](#persistence-type-sha256-daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d).
<a id="persistence-type-sha256-c2deb7c9183735d4e0fffddf5c623f4e34daa1c8e96b111982e957dfcbbcf896"></a>
@@ -5959,7 +5992,7 @@ Sources: [`packages/interaction/commands/src/types.ts:105`](../packages/interact
SHA-256: `e4c18e294232c3ba6c9f1999f168263cc55956147cfe4121720899be8e52edd1`
Sources: [`packages/core/session/src/types.ts:373`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:370`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
@@ -6176,7 +6209,7 @@ Sources: [`packages/api/session-controller/src/types.ts:392`](../packages/api/se
SHA-256: `a81059ca06999da1e712414520c2c65e491d052fcf9640fae20aa38f0a5dc735`
Sources: [`packages/core/session/src/types.ts:395`](../packages/core/session/src/types.ts) · [`packages/core/tool-executor-ptc/src/types.ts:27`](../packages/core/tool-executor-ptc/src/types.ts)
Sources: [`packages/core/session/src/types.ts:392`](../packages/core/session/src/types.ts) · [`packages/core/tool-executor-ptc/src/types.ts:27`](../packages/core/tool-executor-ptc/src/types.ts)
| Property | Presence | Type |
|---|---|---|
@@ -6269,6 +6302,20 @@ Sources: [`packages/compaction/compaction/src/types.ts:24`](../packages/compacti
| `sourceCommandId` | optional | `string` |
| `turn` | required | [`OptionalSessionSeq`](#persistence-type-sha256-3bd652ebfa8726b3ce3937a4f1bd2759e02f86b3a08a20f9e41a8513656fbc5f) |
<a id="persistence-type-sha256-792eb6cb1f6bed8331e25d90ebd3b84a5c2c3f0f346ac5f64c4fb1d077eb463b"></a>
### `{ contentIndex, name, noticeIndex?, order, … }`
SHA-256: `792eb6cb1f6bed8331e25d90ebd3b84a5c2c3f0f346ac5f64c4fb1d077eb463b`
| Property | Presence | Type |
|---|---|---|
| `contentIndex` | required | `number` |
| `name` | required | `string` |
| `noticeIndex` | optional | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
| `order` | required | `number` |
| `state` | required | `"active"` |
<a id="persistence-type-sha256-da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582"></a>
### `{ cwd }`
@@ -6423,7 +6470,7 @@ Sources: [`packages/compaction/compaction/src/types.ts:38`](../packages/compacti
SHA-256: `bcf0caf62d964b2fcf5404bd5c909cfa9a21c3f3c96e6b7e36d9e33565223825`
Sources: [`packages/core/session/src/types.ts:476`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:473`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
@@ -6450,7 +6497,7 @@ Sources: [`packages/core/session/src/types.ts:222`](../packages/core/session/src
SHA-256: `5302e763151277614b97e77f00e3b326694c6c1247b916a20503c344dc970777`
Sources: [`packages/core/session/src/types.ts:387`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:384`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
@@ -6492,7 +6539,7 @@ Sources: [`packages/llm/llm/src/types.ts:168`](../packages/llm/llm/src/types.ts)
SHA-256: `ad0c38a0adb82a94c925456df41586d9b5f9202fca18593eae2213d4445b4585`
Sources: [`packages/core/session/src/types.ts:402`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:399`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
@@ -6500,18 +6547,18 @@ Sources: [`packages/core/session/src/types.ts:402`](../packages/core/session/src
| `reason` | required | [`RequestHeaderReason`](#persistence-type-sha256-530da6c0267813bb4511af72883cc518834e624e3b3220a7062955fd57a788a6) |
| `startsSeries` | optional | `true` |
<a id="persistence-type-sha256-27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44"></a>
<a id="persistence-type-sha256-34af242cde26fe0e35bdfc469935d74c7548f009305eaf553c2b2ef4de2a8a85"></a>
### `{ headerSeq?, message, step, turn }`
SHA-256: `27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44`
SHA-256: `34af242cde26fe0e35bdfc469935d74c7548f009305eaf553c2b2ef4de2a8a85`
Sources: [`packages/core/session/src/types.ts:321`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
| `headerSeq` | optional | `number` |
| `message` | required | [`DeveloperMessage`](#persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7) |
| `message` | required | [`DeveloperMessage`](#persistence-type-sha256-7645031a0886c6fb99b759d13b08a52ceb55d37b853173213fbf87b240fb0088) |
| `step` | required | `number` |
| `turn` | required | `number` |
@@ -6589,23 +6636,23 @@ SHA-256: `e3e77b26f0148755a505f5b8ea843a3be117827d4703bb5754d9dc8ddbef521f`
SHA-256: `17d1afb770d9941936130996da00dc86782cfef731d8d6526162c301256a4ac3`
Sources: [`packages/core/session/src/types.ts:439`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:436`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
| `inherited` | optional | `true` |
<a id="persistence-type-sha256-d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4"></a>
<a id="persistence-type-sha256-91b36ec2f96baa3ac3052fde19e712ffad812b6ca69036ffdde068bc7ab5eac0"></a>
### `{ inserted, outcome?, removedCount?, start, … }`
SHA-256: `d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4`
SHA-256: `91b36ec2f96baa3ac3052fde19e712ffad812b6ca69036ffdde068bc7ab5eac0`
Sources: [`packages/core/agent/src/types.ts:110`](../packages/core/agent/src/types.ts)
| Property | Presence | Type |
|---|---|---|
| `inserted` | required | [`UserMessage[]`](#persistence-type-sha256-6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85) |
| `inserted` | required | [`UserMessage[]`](#persistence-type-sha256-f9c2cb19607330d3579328475bd02ccdf6b9e3d647eb195bc98cc2519dec5f7f) |
| `outcome` | optional | `"canceled"` |
| `removedCount` | optional | `number` |
| `start` | required | `number` |
@@ -6617,7 +6664,7 @@ Sources: [`packages/core/agent/src/types.ts:110`](../packages/core/agent/src/typ
SHA-256: `1ccb56061942f5ccb0d30c9e4f2883b9d115ff906560029de637b61d3cde896d`
Sources: [`packages/core/session/src/types.ts:353`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:350`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
@@ -8050,17 +8097,17 @@ Sources: [`packages/team/agent-team/src/types.ts:179`](../packages/team/agent-te
| `teamId` | required | `string` |
| `version` | required | `2` |
<a id="persistence-type-sha256-6bc8e51124d0874bc89e1d0ceff381a9c3cd0fc240667d69f841ce4f60f65fe5"></a>
<a id="persistence-type-sha256-c460ea99c4124f01e9893c8febbcbd783cadb2d5b11f073ddcd8a9d7e5bf545d"></a>
### `{ message, step, turn }`
SHA-256: `6bc8e51124d0874bc89e1d0ceff381a9c3cd0fc240667d69f841ce4f60f65fe5`
SHA-256: `c460ea99c4124f01e9893c8febbcbd783cadb2d5b11f073ddcd8a9d7e5bf545d`
Sources: [`packages/core/session/src/types.ts:342`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:339`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
| `message` | required | [`SystemMessage`](#persistence-type-sha256-09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363) |
| `message` | required | [`SystemMessage`](#persistence-type-sha256-04c12e59a9ed4d7a59b642223a9bdd3b4303c1d27873c72c5e487760892bbb08) |
| `step` | required | `number` |
| `turn` | required | `number` |
@@ -8106,6 +8153,18 @@ Sources: [`packages/sandbox/sandbox-policy/src/session-mode.ts:33`](../packages/
| `mode` | required | [`SandboxMode`](#persistence-type-sha256-fab2bb09bc5e3b9db0685e8f5500b029af1a2b33e70bc703c1d5d0f596fbc1fd) |
| `source` | optional | `"delegation"` |
<a id="persistence-type-sha256-a408aa610f991ff3c5a60164145c756e551c38ef5c8faf136920738077fea7a7"></a>
### `{ name, noticeIndex?, state }`
SHA-256: `a408aa610f991ff3c5a60164145c756e551c38ef5c8faf136920738077fea7a7`
| Property | Presence | Type |
|---|---|---|
| `name` | required | `string` |
| `noticeIndex` | optional | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
| `state` | required | `"retired"` |
<a id="persistence-type-sha256-11f70b595aa76897fc4e25a352bfa718c659f44b799e5aa14e84e5a38fe72912"></a>
### `{ policy, source? }`
@@ -8191,7 +8250,7 @@ Sources: [`packages/compaction/compaction/src/types.ts:82`](../packages/compacti
SHA-256: `54f9276a1617d7c12594722c89cfe864bcbe4517e9a6f9c98bab14f199a135e0`
Sources: [`packages/core/session/src/types.ts:367`](../packages/core/session/src/types.ts)
Sources: [`packages/core/session/src/types.ts:364`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
@@ -8278,17 +8337,17 @@ SHA-256: `a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b`
| `time` | required | `number` |
| `type` | required | `"agent-preset/selected"` |
<a id="persistence-type-sha256-5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb"></a>
<a id="persistence-type-sha256-2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498"></a>
<a id="persistence-type-eventagentinboxspliced"></a>
### `{ type: "agent/inbox/spliced" }`
SHA-256: `5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb`
SHA-256: `2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498`
| Property | Presence | Type |
|---|---|---|
| `data` | required | [`{ inserted, outcome?, removedCount?, start, … }`](#persistence-type-sha256-d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4) |
| `data` | required | [`{ inserted, outcome?, removedCount?, start, … }`](#persistence-type-sha256-91b36ec2f96baa3ac3052fde19e712ffad812b6ca69036ffdde068bc7ab5eac0) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `time` | required | `number` |
@@ -8529,17 +8588,17 @@ SHA-256: `13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176`
| `time` | required | `number` |
| `type` | required | `"deliverables/presented"` |
<a id="persistence-type-sha256-53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e"></a>
<a id="persistence-type-sha256-ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4"></a>
<a id="persistence-type-eventdevelopermessage"></a>
### `{ type: "developer/message" }`
SHA-256: `53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e`
SHA-256: `ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4`
| Property | Presence | Type |
|---|---|---|
| `data` | required | [`{ headerSeq?, message, step, turn }`](#persistence-type-sha256-27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44) |
| `data` | required | [`{ headerSeq?, message, step, turn }`](#persistence-type-sha256-34af242cde26fe0e35bdfc469935d74c7548f009305eaf553c2b2ef4de2a8a85) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `sourceEventSeqs` | optional | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
@@ -8939,17 +8998,17 @@ SHA-256: `1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5`
| `time` | required | `number` |
| `type` | required | `"session/title"` |
<a id="persistence-type-sha256-5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260"></a>
<a id="persistence-type-sha256-1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545"></a>
<a id="persistence-type-eventsessiontitle-llm-request"></a>
### `{ type: "session/title-llm-request" }`
SHA-256: `5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260`
SHA-256: `1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545`
| Property | Presence | Type |
|---|---|---|
| `data` | required | [`SessionTitleLlmRequestEventData`](#persistence-type-sha256-8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69) |
| `data` | required | [`SessionTitleLlmRequestEventData`](#persistence-type-sha256-e90c7a2af8e7d05b9184c819ef8b84711c1821e862494ba701839bd2895fc888) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `time` | required | `number` |
@@ -9035,17 +9094,17 @@ SHA-256: `a6567ccb2e530606b775371eb4fa31468d72084339968e8b0440a516a23b39dc`
| `time` | required | `number` |
| `type` | required | `"subagent/model-selection-policy"` |
<a id="persistence-type-sha256-69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1"></a>
<a id="persistence-type-sha256-ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d"></a>
<a id="persistence-type-eventsystemmessage"></a>
### `{ type: "system/message" }`
SHA-256: `69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1`
SHA-256: `ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d`
| Property | Presence | Type |
|---|---|---|
| `data` | required | [`{ message, step, turn }`](#persistence-type-sha256-6bc8e51124d0874bc89e1d0ceff381a9c3cd0fc240667d69f841ce4f60f65fe5) |
| `data` | required | [`{ message, step, turn }`](#persistence-type-sha256-c460ea99c4124f01e9893c8febbcbd783cadb2d5b11f073ddcd8a9d7e5bf545d) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `sourceEventSeqs` | optional | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
@@ -9388,17 +9447,17 @@ Sources: [`packages/llm/llm/src/types.ts:502`](../packages/llm/llm/src/types.ts)
| `type` | required | `"usage"` |
| `usage` | required | [`TokenUsage`](#persistence-type-sha256-fec5442b9ee4122e10514d81d5a43648003fe8bfb7ee2ba50c0cdbdd383ed394) |
<a id="persistence-type-sha256-3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a"></a>
<a id="persistence-type-sha256-8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950"></a>
<a id="persistence-type-eventusermessage"></a>
### `{ type: "user/message" }`
SHA-256: `3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a`
SHA-256: `8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950`
| Property | Presence | Type |
|---|---|---|
| `data` | required | [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499) |
| `data` | required | [`UserMessage`](#persistence-type-sha256-daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `sourceEventSeqs` | optional | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
+159 -100
View File
@@ -25,7 +25,7 @@
| `JsonlHeaderLine` | header | `18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f` | [`HeaderLine`](#persistence-type-sha256-18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f) |
| `SessionEventEnvelope` | envelope | `5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc` | [`union (3 variants)`](#persistence-type-sha256-5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc) |
| `event:agent-preset/selected` | event | `a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b` | [`{ type: "agent-preset/selected" }`](#persistence-type-sha256-a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b) |
| `event:agent/inbox/spliced` | event | `5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb` | [`{ type: "agent/inbox/spliced" }`](#persistence-type-sha256-5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb) |
| `event:agent/inbox/spliced` | event | `2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498` | [`{ type: "agent/inbox/spliced" }`](#persistence-type-sha256-2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498) |
| `event:approval/asked` | event | `3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1` | [`{ type: "approval/asked" }`](#persistence-type-sha256-3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1) |
| `event:approval/decided` | event | `bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3` | [`{ type: "approval/decided" }`](#persistence-type-sha256-bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3) |
| `event:approval/policy` | event | `26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78` | [`{ type: "approval/policy" }`](#persistence-type-sha256-26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78) |
@@ -38,7 +38,7 @@
| `event:compaction/start` | event | `db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965` | [`{ type: "compaction/start" }`](#persistence-type-sha256-db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965) |
| `event:compaction/summary` | event | `e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602` | [`{ type: "compaction/summary" }`](#persistence-type-sha256-e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602) |
| `event:deliverables/presented` | event | `13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176` | [`{ type: "deliverables/presented" }`](#persistence-type-sha256-13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176) |
| `event:developer/message` | event | `53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e` | [`{ type: "developer/message" }`](#persistence-type-sha256-53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e) |
| `event:developer/message` | event | `ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4` | [`{ type: "developer/message" }`](#persistence-type-sha256-ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4) |
| `event:feedback/message-delete` | event | `3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796` | [`{ type: "feedback/message-delete" }`](#persistence-type-sha256-3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796) |
| `event:feedback/message-put` | event | `b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf` | [`{ type: "feedback/message-put" }`](#persistence-type-sha256-b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf) |
| `event:feedback/record` | event | `b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8` | [`{ type: "feedback/record" }`](#persistence-type-sha256-b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8) |
@@ -60,13 +60,13 @@
| `event:session-log-deepseek/delivery-accepted` | event | `d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9` | [`{ type: "session-log-deepseek/delivery-accepted" }`](#persistence-type-sha256-d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9) |
| `event:session/end-seed` | event | `5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e` | [`{ type: "session/end-seed" }`](#persistence-type-sha256-5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e) |
| `event:session/title` | event | `1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5` | [`{ type: "session/title" }`](#persistence-type-sha256-1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5) |
| `event:session/title-llm-request` | event | `5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260` | [`{ type: "session/title-llm-request" }`](#persistence-type-sha256-5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260) |
| `event:session/title-llm-request` | event | `1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545` | [`{ type: "session/title-llm-request" }`](#persistence-type-sha256-1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545) |
| `event:step/end` | event | `e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05` | [`{ type: "step/end" }`](#persistence-type-sha256-e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05) |
| `event:step/start` | event | `4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986` | [`{ type: "step/start" }`](#persistence-type-sha256-4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986) |
| `event:subagent/catalog` | event | `d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41` | [`{ type: "subagent/catalog" }`](#persistence-type-sha256-d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41) |
| `event:subagent/descriptor` | event | `b79ada42962cad0190a9d465805260567621fa3a4abd757eb31e6016b52d5ab5` | [`{ type: "subagent/descriptor" }`](#persistence-type-sha256-b79ada42962cad0190a9d465805260567621fa3a4abd757eb31e6016b52d5ab5) |
| `event:subagent/model-selection-policy` | event | `a6567ccb2e530606b775371eb4fa31468d72084339968e8b0440a516a23b39dc` | [`{ type: "subagent/model-selection-policy" }`](#persistence-type-sha256-a6567ccb2e530606b775371eb4fa31468d72084339968e8b0440a516a23b39dc) |
| `event:system/message` | event | `69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1` | [`{ type: "system/message" }`](#persistence-type-sha256-69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1) |
| `event:system/message` | event | `ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d` | [`{ type: "system/message" }`](#persistence-type-sha256-ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d) |
| `event:team/member` | event | `4fb59762612c3e3ac3a3bd4f84c9c148d3c3893bd422ba2b201cc039fabd49bc` | [`{ type: "team/member" }`](#persistence-type-sha256-4fb59762612c3e3ac3a3bd4f84c9c148d3c3893bd422ba2b201cc039fabd49bc) |
| `event:team/message/delivered` | event | `48f9c19417a1abbedfa59f4667bba36b93ac2db407adf5e84cb3ba0de30942cb` | [`{ type: "team/message/delivered" }`](#persistence-type-sha256-48f9c19417a1abbedfa59f4667bba36b93ac2db407adf5e84cb3ba0de30942cb) |
| `event:team/message/queued` | event | `21fb6a90d5068f6a0003b7ab316ed2f56342477146a65c00db0f13c4d8df667d` | [`{ type: "team/message/queued" }`](#persistence-type-sha256-21fb6a90d5068f6a0003b7ab316ed2f56342477146a65c00db0f13c4d8df667d) |
@@ -83,7 +83,7 @@
| `event:tool/result` | event | `7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397` | [`{ type: "tool/result" }`](#persistence-type-sha256-7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397) |
| `event:turn/end` | event | `0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce` | [`{ type: "turn/end" }`](#persistence-type-sha256-0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce) |
| `event:turn/start` | event | `aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8` | [`{ type: "turn/start" }`](#persistence-type-sha256-aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8) |
| `event:user/message` | event | `3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a` | [`{ type: "user/message" }`](#persistence-type-sha256-3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a) |
| `event:user/message` | event | `8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950` | [`{ type: "user/message" }`](#persistence-type-sha256-8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950) |
| `event:web/deepseek-search-llm-request` | event | `0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52` | [`{ type: "web/deepseek-search-llm-request" }`](#persistence-type-sha256-0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52) |
| `event:working-directory/change` | event | `124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3` | [`{ type: "working-directory/change" }`](#persistence-type-sha256-124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3) |
| `event:workspace-root/change` | event | `025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc` | [`{ type: "workspace-root/change" }`](#persistence-type-sha256-025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc) |
@@ -164,7 +164,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
}[T]
```
来源:[`packages/core/session/src/types.ts:443`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:451`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:474`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:510`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:440`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:448`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:471`](../packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:507`](../packages/core/session/src/types.ts)
## 事件
@@ -293,7 +293,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[] }
```
来源:[`packages/core/session/src/types.ts:367`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:364`](../packages/core/session/src/types.ts)
<a id="assistantmessage--surface"></a>
@@ -323,7 +323,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
类型:[TokenUsage](subsystems/llm-streaming.zh.md)
来源:[`packages/core/session/src/types.ts:353`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:350`](../packages/core/session/src/types.ts)
### `command/*`
@@ -750,13 +750,13 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
/**
* Route metadata for the next request, logged only when the route, capacity,
* or system prompt update mode changes. It does not participate in request
* reconstruction or header equality. Prompt admission uses the bound prepared
* call's capability, not this snapshot from an earlier request.
* reconstruction, header equality, or system-section admission. The bound
* prepared call's capabilities determine adapter representation.
*/
'request/context': RequestContext
```
来源:[`packages/core/session/src/types.ts:414`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:411`](../packages/core/session/src/types.ts)
<a id="requestheader--log-only"></a>
@@ -775,7 +775,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
}
```
来源:[`packages/core/session/src/types.ts:402`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:399`](../packages/core/session/src/types.ts)
### `sandbox/*`
@@ -852,7 +852,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
'session/end-seed': { inherited?: true }
```
来源:[`packages/core/session/src/types.ts:439`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:436`](../packages/core/session/src/types.ts)
<a id="sessiontitle--log-only"></a>
@@ -986,23 +986,20 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
```ts persistence-catalog
/**
* The rendered system prompt on the model-visible surface. The loop appends
* the first one as surface node 0 before the step's first `user/message`.
* A prepared in-history route can append nonempty changes in a continuing
* series. An incapable route, or a new series whose effective text differs,
* normalizes text to the first system node; a series start whose latest
* surviving node already holds the rendering leaves it in place.
* Normalization empties nonempty later nodes, then rewrites the head if
* needed, through logged per-node replacements. An empty rendering always
* clears all active system nodes, leaving no older instructions model-visible.
* Empty later nodes are dormant and project to no message; an empty head with
* no active later node records "no system prompt". Restored nonempty text follows
* the same route and series rule; empty nodes never restore older text.
* System instructions and notices on the model-visible surface. The first
* accepted assembly reserves node 0, even with empty content. Later admissions
* append new or changed sections independently of the route's capabilities.
* Source metadata identifies canonical text and notices; retired records remove
* a source from committed state. Empty active text withdraws its instructions
* while preserving the source. Earlier messages retain their positions.
* `source.reset` replaces committed state, including when compaction rebuilds
* the initial system node from current instructions.
* Empty system nodes remain in the surface but produce no model message.
*/
'system/message': { turn: number; step: number; message: SystemMessage }
```
来源:[`packages/core/session/src/types.ts:342`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:339`](../packages/core/session/src/types.ts)
### `team/*`
@@ -1106,7 +1103,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
类型:[ToolCallId](subsystems/core.zh.md)
来源:[`packages/core/session/src/types.ts:373`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:370`](../packages/core/session/src/types.ts)
<a id="toolptc-dispatch--log-only"></a>
@@ -1187,7 +1184,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
}
```
来源:[`packages/core/session/src/types.ts:387`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:384`](../packages/core/session/src/types.ts)
### `tool-workflow/*`
@@ -2470,6 +2467,14 @@ SHA-256: `34d1ab5c5df378186d6054b1a1beea9a41e41965d6f336f0bc0025c441a82e66`
`"resume"`
<a id="persistence-type-sha256-4902846b72aabae5f4e20e8f518d7fbfd62f1fef44d180c56793e2edf2ef0903"></a>
### `"retired"`
SHA-256: `4902846b72aabae5f4e20e8f518d7fbfd62f1fef44d180c56793e2edf2ef0903`
`"retired"`
<a id="persistence-type-sha256-63ba8895cc09e4693cf0819fdcd18c084bef195febda5b6a23af279b3852be36"></a>
### `"retry"`
@@ -3277,7 +3282,7 @@ SHA-256: `05d2ae1e0c7f8770f83f9a09047afb39a335d8ac986df3193659aa1e581472cf`
SHA-256: `fa87537f4a9c1e25602990a8bf686b383e9e00352ec8946e16ae24ba7c1625be`
来源:[`packages/llm/llm/src/message.ts:166`](../packages/llm/llm/src/message.ts)
来源:[`packages/llm/llm/src/message.ts:192`](../packages/llm/llm/src/message.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -3323,7 +3328,7 @@ SHA-256: `84bbfdce7d2eab5b0c53e72ff7406db856c8bfd621b965b72fd86598ba493bf7`
SHA-256: `ada310bf0bdb8fed51f3b56ea63f6ea6b18bbd587f04fccb63a14ab0b2a24e05`
来源:[`packages/core/session/src/types.ts:199`](../packages/core/session/src/types.ts) · [`packages/interaction/commands/src/types.ts:75`](../packages/interaction/commands/src/types.ts) · [`packages/interaction/commands/src/types.ts:79`](../packages/interaction/commands/src/types.ts) · [`packages/llm/llm/src/message.ts:110`](../packages/llm/llm/src/message.ts) · [`packages/session/session-title/src/types.ts:35`](../packages/session/session-title/src/types.ts)
来源:[`packages/core/session/src/types.ts:199`](../packages/core/session/src/types.ts) · [`packages/interaction/commands/src/types.ts:75`](../packages/interaction/commands/src/types.ts) · [`packages/interaction/commands/src/types.ts:79`](../packages/interaction/commands/src/types.ts) · [`packages/llm/llm/src/message.ts:136`](../packages/llm/llm/src/message.ts) · [`packages/session/session-title/src/types.ts:35`](../packages/session/session-title/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -3409,7 +3414,7 @@ SHA-256: `b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1`
SHA-256: `86e1e384495ee09ac2d60c9db3610f1f1fddac2d248f6f1d6000e78054680219`
来源:[`packages/llm/llm/src/message.ts:69`](../packages/llm/llm/src/message.ts)
来源:[`packages/llm/llm/src/message.ts:95`](../packages/llm/llm/src/message.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -3466,7 +3471,7 @@ SHA-256: `abd6ca62a5ab166553848324a23fef90eed7f59c8021bd63e7ea5bc6fd666b0c`
| `body` | 必需 | [`{ max_tokens, messages, model, thinking?, … }`](#persistence-type-sha256-9c001ecb5e1d3c3894410db2a1e383842e5f8454fb52182338686158abc1b3ee) |
| `endpoint` | 必需 | `string` |
<a id="persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7"></a>
<a id="persistence-type-sha256-7645031a0886c6fb99b759d13b08a52ceb55d37b853173213fbf87b240fb0088"></a>
<a id="persistence-type-developermessage"></a>
@@ -3474,16 +3479,16 @@ SHA-256: `abd6ca62a5ab166553848324a23fef90eed7f59c8021bd63e7ea5bc6fd666b0c`
### `DeveloperMessage`
SHA-256: `3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7`
SHA-256: `7645031a0886c6fb99b759d13b08a52ceb55d37b853173213fbf87b240fb0088`
来源:[`packages/llm/llm/src/message.ts:156`](../packages/llm/llm/src/message.ts)
来源:[`packages/llm/llm/src/message.ts:182`](../packages/llm/llm/src/message.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `content` | 必需 | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | 必需 | `string` |
| `role` | 必需 | `"developer"` |
| `source` | 必需 | [`MessageSource`](#persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b) |
| `source` | 必需 | [`MessageSource`](#persistence-type-sha256-9c75043166543713427121c82ed73cec6edbeeaf94e35e3ef5055d52197b57d8) |
消息源兼容策略:`source` — `session-source-attribution` v1; `session.developer-message.source`; `kind`; `preserve`.
@@ -4182,7 +4187,7 @@ SHA-256: `6f72ece8f317cd080c4f20a93f1bf709965f5b81ac4669528f5a023191cfcf20`
| `step` | 必需 | `number` |
| `turn` | 必需 | `number` |
<a id="persistence-type-sha256-d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7"></a>
<a id="persistence-type-sha256-e7f07198d10adc34e5b4ecc079f4e267b9a135de4a4a457e929dd40602c3203e"></a>
<a id="persistence-type-message"></a>
@@ -4190,16 +4195,16 @@ SHA-256: `6f72ece8f317cd080c4f20a93f1bf709965f5b81ac4669528f5a023191cfcf20`
### `Message`
SHA-256: `d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7`
SHA-256: `e7f07198d10adc34e5b4ecc079f4e267b9a135de4a4a457e929dd40602c3203e`
来源:[`packages/llm/llm/src/message.ts:195`](../packages/llm/llm/src/message.ts)
来源:[`packages/llm/llm/src/message.ts:221`](../packages/llm/llm/src/message.ts)
以下类型之一:
- [`ToolResultMessage`](#persistence-type-sha256-4b259f7f8f0a44ad5e90b70a73553ced1df27012d126921d397ff403b6c86731)
- [`DeveloperMessage`](#persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7)
- [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499)
- [`SystemMessage`](#persistence-type-sha256-09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363)
- [`DeveloperMessage`](#persistence-type-sha256-7645031a0886c6fb99b759d13b08a52ceb55d37b853173213fbf87b240fb0088)
- [`UserMessage`](#persistence-type-sha256-daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d)
- [`SystemMessage`](#persistence-type-sha256-04c12e59a9ed4d7a59b642223a9bdd3b4303c1d27873c72c5e487760892bbb08)
- [`AssistantMessage`](#persistence-type-sha256-fa87537f4a9c1e25602990a8bf686b383e9e00352ec8946e16ae24ba7c1625be)
<a id="persistence-type-sha256-7c6129b6961cf4b2a030f36c78d2b0a5be38617651a9b81322e054ee512bee06"></a>
@@ -4275,7 +4280,7 @@ SHA-256: `390eed1028aba02774f14408647acec10ec5516e97d4f15ecde2b9989d5a69f2`
- `"negative"`
- `"positive"`
<a id="persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b"></a>
<a id="persistence-type-sha256-9c75043166543713427121c82ed73cec6edbeeaf94e35e3ef5055d52197b57d8"></a>
<a id="persistence-type-messagesource"></a>
@@ -4283,9 +4288,9 @@ SHA-256: `390eed1028aba02774f14408647acec10ec5516e97d4f15ecde2b9989d5a69f2`
### `MessageSource`
SHA-256: `7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b`
SHA-256: `9c75043166543713427121c82ed73cec6edbeeaf94e35e3ef5055d52197b57d8`
来源:[`packages/llm/llm/src/message.ts:135`](../packages/llm/llm/src/message.ts)
来源:[`packages/llm/llm/src/message.ts:161`](../packages/llm/llm/src/message.ts)
| kind | form 属性 | 其他必需字段 | 完整定义 |
|---|---|---|---|
@@ -4364,7 +4369,7 @@ SHA-256: `7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b`
| `skill-catalog` | `"catalog"` | `entries`: [`{ description, name }[]`](#persistence-type-sha256-aba175fb20ffc71112c55efe70458ff5d7dbfb83501892b4ba8d077f0ea5d7ba) | [`SkillCatalogSource`](#persistence-type-sha256-65d583e66518c5236015e0846470fb32efcf92375ed306aef14e50a9d2cd2099) |
| `skill-invocation` | `"instructions"` | `name`: `string` | [`SkillInvocationSource`](#persistence-type-sha256-672c4aa2a9b736e3d6e5da6346d2e2ed5e3573f2d0baafa18e7407c9f3fee3db) |
| `subagent-settled` | `"notice"` | `senderSessionId`: `string`; `summary`: `string` | [`SubagentSettledMessageSource`](#persistence-type-sha256-848639f8787f035b480ec53cb5686850897c5e8006d87ca231cd8a9ee8634936) |
| `system-prompt` | 未声明 | 无 | [`SystemPromptMessageSource`](#persistence-type-sha256-65a8400e451e667e5b6e34df72ceb81fca8c12330330fa72083ad40279b189ad) |
| `system-prompt` | 未声明 | 无 | [`SystemPromptMessageSource`](#persistence-type-sha256-3d1339bcc98cb53714bf31ac4a6e7c9ce15a412dd58451778a383627367a4666) |
| `team-message` | 未声明 | `messageId`: `string`; `senderId`: `string`; `senderName`: `string`; `teamId`: `string` | [`TeamMessageSource`](#persistence-type-sha256-2152caf1a71e588e4df2358a806dea24936c1c47131134f01a12939d12cdc0c0) |
| `time-context` | `"catalog"` | 无 | [`{ kind: "time-context", form: "catalog" }`](#persistence-type-sha256-85fe96bf15d5c7559eec3bae4d6cf1a76fda9f5be05a29c2830cff560cab0c0d) |
| `time-context` | `"instructions"` | 无 | [`{ kind: "time-context", form: "instructions" }`](#persistence-type-sha256-f6afe41e3926f422fe849debe90819fddd739f0f59e20be9c71018b9554a7f09) |
@@ -4411,13 +4416,13 @@ SHA-256: `7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b`
| `webhook` | `"notice"` | `deliveryId`: `string`; `provider`: `string`; `ruleId`: `string`; `source`: `string`; `summary`: `string` | [`{ kind: "webhook", form: "notice" }`](#persistence-type-sha256-9edc162949abf93bd5ff049191b345454ba104f583937ce5580fb50f067d2b94) |
| `working-directory` | 未声明 | 无 | [`{ kind: "working-directory" }`](#persistence-type-sha256-2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5) |
<a id="persistence-type-sha256-02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a"></a>
<a id="persistence-type-sha256-be53b443539d32c2c7247e137da830a5cec2dda18dccaaf1db6e3e72d55c4deb"></a>
### `Message[]`
SHA-256: `02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a`
SHA-256: `be53b443539d32c2c7247e137da830a5cec2dda18dccaaf1db6e3e72d55c4deb`
[`Message`](#persistence-type-sha256-d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7) 的数组。
[`Message`](#persistence-type-sha256-e7f07198d10adc34e5b4ecc079f4e267b9a135de4a4a457e929dd40602c3203e) 的数组。
<a id="persistence-type-sha256-719c51f67074f97034a6c94297fe1f4b5d3c8d392c57586dab732aa5398c7a91"></a>
@@ -4785,7 +4790,7 @@ SHA-256: `b56f6a885da3dc394c69a3e3cc5c0cfc4da15601b63fda4989eee8f40efc5be4`
| `source` | 必需 | [`SessionTitleSource`](#persistence-type-sha256-30d5a537b296685770b1241c4b4bbde19d5a31ff81aa23df73fab5e90b8fc65f) |
| `title` | 必需 | `string` |
<a id="persistence-type-sha256-8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69"></a>
<a id="persistence-type-sha256-e90c7a2af8e7d05b9184c819ef8b84711c1821e862494ba701839bd2895fc888"></a>
<a id="persistence-type-packagessessionsession-title-llmsrcindextssessiontitlellmrequesteventdata"></a>
@@ -4793,7 +4798,7 @@ SHA-256: `b56f6a885da3dc394c69a3e3cc5c0cfc4da15601b63fda4989eee8f40efc5be4`
### `SessionTitleLlmRequestEventData`
SHA-256: `8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69`
SHA-256: `e90c7a2af8e7d05b9184c819ef8b84711c1821e862494ba701839bd2895fc888`
来源:[`packages/session/session-title-llm/src/index.ts:43`](../packages/session/session-title-llm/src/index.ts)
@@ -4801,7 +4806,7 @@ SHA-256: `8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69`
|---|---|---|
| `maxTokens` | 必需 | `number` |
| `messageSeqs` | 必需 | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
| `messages` | 必需 | [`Message[]`](#persistence-type-sha256-02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a) |
| `messages` | 必需 | [`Message[]`](#persistence-type-sha256-be53b443539d32c2c7247e137da830a5cec2dda18dccaaf1db6e3e72d55c4deb) |
| `reasoningEffort` | 可选 | `string` |
| `route` | 必需 | [`SessionTitleModelIdentity`](#persistence-type-sha256-07e1a58c58b593f507b8e7f25723bb0aa42baae6e00f5ecfddf28cb1e64d3235) |
| `system` | 必需 | `string` |
@@ -5002,14 +5007,14 @@ SHA-256: `848639f8787f035b480ec53cb5686850897c5e8006d87ca231cd8a9ee8634936`
SHA-256: `335e242de1fcc17b6ca920fc420d71bec2d76e53e37955c00948b65ab77f05c5`
来源:[`packages/core/session/src/types.ts:474`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:471`](../packages/core/session/src/types.ts)
以下类型之一:
- `"append"`
- [`{ endSeq, op, startSeq }`](#persistence-type-sha256-bcf0caf62d964b2fcf5404bd5c909cfa9a21c3f3c96e6b7e36d9e33565223825)
<a id="persistence-type-sha256-09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363"></a>
<a id="persistence-type-sha256-04c12e59a9ed4d7a59b642223a9bdd3b4303c1d27873c72c5e487760892bbb08"></a>
<a id="persistence-type-packagesllmllmsrcmessagetssystemmessage"></a>
@@ -5017,18 +5022,18 @@ SHA-256: `335e242de1fcc17b6ca920fc420d71bec2d76e53e37955c00948b65ab77f05c5`
### `SystemMessage`
SHA-256: `09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363`
SHA-256: `04c12e59a9ed4d7a59b642223a9bdd3b4303c1d27873c72c5e487760892bbb08`
来源:[`packages/llm/llm/src/message.ts:150`](../packages/llm/llm/src/message.ts)
来源:[`packages/llm/llm/src/message.ts:176`](../packages/llm/llm/src/message.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `content` | 必需 | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | 必需 | `string` |
| `role` | 必需 | `"system"` |
| `source` | 必需 | [`SystemPromptMessageSource`](#persistence-type-sha256-65a8400e451e667e5b6e34df72ceb81fca8c12330330fa72083ad40279b189ad) |
| `source` | 必需 | [`SystemPromptMessageSource`](#persistence-type-sha256-3d1339bcc98cb53714bf31ac4a6e7c9ce15a412dd58451778a383627367a4666) |
<a id="persistence-type-sha256-65a8400e451e667e5b6e34df72ceb81fca8c12330330fa72083ad40279b189ad"></a>
<a id="persistence-type-sha256-3d1339bcc98cb53714bf31ac4a6e7c9ce15a412dd58451778a383627367a4666"></a>
<a id="persistence-type-packagesllmllmsrcmessagetssystempromptmessagesource"></a>
@@ -5036,13 +5041,41 @@ SHA-256: `09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363`
### `SystemPromptMessageSource`
SHA-256: `65a8400e451e667e5b6e34df72ceb81fca8c12330330fa72083ad40279b189ad`
SHA-256: `3d1339bcc98cb53714bf31ac4a6e7c9ce15a412dd58451778a383627367a4666`
来源:[`packages/llm/llm/src/message.ts:34`](../packages/llm/llm/src/message.ts)
来源:[`packages/llm/llm/src/message.ts:54`](../packages/llm/llm/src/message.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `complete` | 可选 | `true` |
| `kind` | 必需 | `"system-prompt"` |
| `reset` | 可选 | `true` |
| `sections` | 可选 | [`SystemPromptSectionState[]`](#persistence-type-sha256-8decd4949d9ee4adccbe0b436abac75d5bf1a9bced2fd142866bdc5ff122833d) |
<a id="persistence-type-sha256-5b7abd24d8a133e7d43f7d8a5824e841233f57ddd2288d9923d3443ffa245e16"></a>
<a id="persistence-type-packagesllmllmsrcmessagetssystempromptsectionstate"></a>
<a id="persistence-type-systempromptsectionstate"></a>
### `SystemPromptSectionState`
SHA-256: `5b7abd24d8a133e7d43f7d8a5824e841233f57ddd2288d9923d3443ffa245e16`
来源:[`packages/llm/llm/src/message.ts:34`](../packages/llm/llm/src/message.ts)
以下类型之一:
- [`{ contentIndex, name, noticeIndex?, order, … }`](#persistence-type-sha256-792eb6cb1f6bed8331e25d90ebd3b84a5c2c3f0f346ac5f64c4fb1d077eb463b)
- [`{ name, noticeIndex?, state }`](#persistence-type-sha256-a408aa610f991ff3c5a60164145c756e551c38ef5c8faf136920738077fea7a7)
<a id="persistence-type-sha256-8decd4949d9ee4adccbe0b436abac75d5bf1a9bced2fd142866bdc5ff122833d"></a>
### `SystemPromptSectionState[]`
SHA-256: `8decd4949d9ee4adccbe0b436abac75d5bf1a9bced2fd142866bdc5ff122833d`
[`SystemPromptSectionState`](#persistence-type-sha256-5b7abd24d8a133e7d43f7d8a5824e841233f57ddd2288d9923d3443ffa245e16) 的数组。
<a id="persistence-type-sha256-dfce5db4aa42b7ebe0bb79eca92553587287e18c06b9eba85cbfb9d332e26acd"></a>
@@ -5328,7 +5361,7 @@ SHA-256: `3cfc3a56502da1f8c6153c2c56657bab4b749056968634dd0991d325ec1c919f`
SHA-256: `4b259f7f8f0a44ad5e90b70a73553ced1df27012d126921d397ff403b6c86731`
来源:[`packages/llm/llm/src/message.ts:172`](../packages/llm/llm/src/message.ts)
来源:[`packages/llm/llm/src/message.ts:198`](../packages/llm/llm/src/message.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -5480,7 +5513,7 @@ SHA-256: `f1687f982fa3d41ef29e159feed154ecd13af4dd209acaee16038f223f2e9402`
| `interrupted` | 未声明 | 无 | [`{ kind: "interrupted" }`](#persistence-type-sha256-56b7c047694875a843ba020dfea3c8380d54ae4ff88ab349e72004dc21e07c23) |
| `max-tokens` | 未声明 | 无 | [`{ kind: "max-tokens" }`](#persistence-type-sha256-ab7ec5f9eb2c6dfacca5da4c37cf7ba85d04172053ee6b1ebf1709ffcd99c1a7) |
<a id="persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499"></a>
<a id="persistence-type-sha256-daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d"></a>
<a id="persistence-type-packagesllmllmsrcmessagetsusermessage"></a>
@@ -5488,28 +5521,28 @@ SHA-256: `f1687f982fa3d41ef29e159feed154ecd13af4dd209acaee16038f223f2e9402`
### `UserMessage`
SHA-256: `120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499`
SHA-256: `daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d`
来源:[`packages/llm/llm/src/message.ts:161`](../packages/llm/llm/src/message.ts)
来源:[`packages/llm/llm/src/message.ts:187`](../packages/llm/llm/src/message.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `content` | 必需 | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | 必需 | `string` |
| `role` | 必需 | `"user"` |
| `source` | 必需 | [`MessageSource`](#persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b) |
| `source` | 必需 | [`MessageSource`](#persistence-type-sha256-9c75043166543713427121c82ed73cec6edbeeaf94e35e3ef5055d52197b57d8) |
消息源兼容策略:`source` — `session-source-attribution` v1; `session.user-message.source`; `kind`; `preserve`.
仅表示归属的新增 kind:`action-cards`, `tmux-context`, `user-question-reply`, `working-directory`.
<a id="persistence-type-sha256-6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85"></a>
<a id="persistence-type-sha256-f9c2cb19607330d3579328475bd02ccdf6b9e3d647eb195bc98cc2519dec5f7f"></a>
### `UserMessage[]`
SHA-256: `6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85`
SHA-256: `f9c2cb19607330d3579328475bd02ccdf6b9e3d647eb195bc98cc2519dec5f7f`
[`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499) 的数组。
[`UserMessage`](#persistence-type-sha256-daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d) 的数组。
<a id="persistence-type-sha256-c2deb7c9183735d4e0fffddf5c623f4e34daa1c8e96b111982e957dfcbbcf896"></a>
@@ -5961,7 +5994,7 @@ SHA-256: `a853902cfab417b8f08aa51ad6855fea46f34ed4588a74e47403035111d0fb86`
SHA-256: `e4c18e294232c3ba6c9f1999f168263cc55956147cfe4121720899be8e52edd1`
来源:[`packages/core/session/src/types.ts:373`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:370`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -6178,7 +6211,7 @@ SHA-256: `a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302`
SHA-256: `a81059ca06999da1e712414520c2c65e491d052fcf9640fae20aa38f0a5dc735`
来源:[`packages/core/session/src/types.ts:395`](../packages/core/session/src/types.ts) · [`packages/core/tool-executor-ptc/src/types.ts:27`](../packages/core/tool-executor-ptc/src/types.ts)
来源:[`packages/core/session/src/types.ts:392`](../packages/core/session/src/types.ts) · [`packages/core/tool-executor-ptc/src/types.ts:27`](../packages/core/tool-executor-ptc/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -6271,6 +6304,20 @@ SHA-256: `3e4e7683b0192c9f0e6a75c59076108f017892cdb302a98032c2632fd79c356f`
| `sourceCommandId` | 可选 | `string` |
| `turn` | 必需 | [`OptionalSessionSeq`](#persistence-type-sha256-3bd652ebfa8726b3ce3937a4f1bd2759e02f86b3a08a20f9e41a8513656fbc5f) |
<a id="persistence-type-sha256-792eb6cb1f6bed8331e25d90ebd3b84a5c2c3f0f346ac5f64c4fb1d077eb463b"></a>
### `{ contentIndex, name, noticeIndex?, order, … }`
SHA-256: `792eb6cb1f6bed8331e25d90ebd3b84a5c2c3f0f346ac5f64c4fb1d077eb463b`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `contentIndex` | 必需 | `number` |
| `name` | 必需 | `string` |
| `noticeIndex` | 可选 | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
| `order` | 必需 | `number` |
| `state` | 必需 | `"active"` |
<a id="persistence-type-sha256-da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582"></a>
### `{ cwd }`
@@ -6425,7 +6472,7 @@ SHA-256: `9e41386b3a0c9572b0d63078492ebb3997da7d3a830d44e0259418bd02f4bcb2`
SHA-256: `bcf0caf62d964b2fcf5404bd5c909cfa9a21c3f3c96e6b7e36d9e33565223825`
来源:[`packages/core/session/src/types.ts:476`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:473`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -6452,7 +6499,7 @@ SHA-256: `79650cfa10aa3c52440328d85e8a25f0ffadc8d7efd784e3c0819d8bb74a1985`
SHA-256: `5302e763151277614b97e77f00e3b326694c6c1247b916a20503c344dc970777`
来源:[`packages/core/session/src/types.ts:387`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:384`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -6494,7 +6541,7 @@ SHA-256: `693f4952fb5565da96c06bace8924b098ac2fbc915fde0ff8019701183abc057`
SHA-256: `ad0c38a0adb82a94c925456df41586d9b5f9202fca18593eae2213d4445b4585`
来源:[`packages/core/session/src/types.ts:402`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:399`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -6502,18 +6549,18 @@ SHA-256: `ad0c38a0adb82a94c925456df41586d9b5f9202fca18593eae2213d4445b4585`
| `reason` | 必需 | [`RequestHeaderReason`](#persistence-type-sha256-530da6c0267813bb4511af72883cc518834e624e3b3220a7062955fd57a788a6) |
| `startsSeries` | 可选 | `true` |
<a id="persistence-type-sha256-27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44"></a>
<a id="persistence-type-sha256-34af242cde26fe0e35bdfc469935d74c7548f009305eaf553c2b2ef4de2a8a85"></a>
### `{ headerSeq?, message, step, turn }`
SHA-256: `27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44`
SHA-256: `34af242cde26fe0e35bdfc469935d74c7548f009305eaf553c2b2ef4de2a8a85`
来源:[`packages/core/session/src/types.ts:321`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `headerSeq` | 可选 | `number` |
| `message` | 必需 | [`DeveloperMessage`](#persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7) |
| `message` | 必需 | [`DeveloperMessage`](#persistence-type-sha256-7645031a0886c6fb99b759d13b08a52ceb55d37b853173213fbf87b240fb0088) |
| `step` | 必需 | `number` |
| `turn` | 必需 | `number` |
@@ -6591,23 +6638,23 @@ SHA-256: `e3e77b26f0148755a505f5b8ea843a3be117827d4703bb5754d9dc8ddbef521f`
SHA-256: `17d1afb770d9941936130996da00dc86782cfef731d8d6526162c301256a4ac3`
来源:[`packages/core/session/src/types.ts:439`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:436`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `inherited` | 可选 | `true` |
<a id="persistence-type-sha256-d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4"></a>
<a id="persistence-type-sha256-91b36ec2f96baa3ac3052fde19e712ffad812b6ca69036ffdde068bc7ab5eac0"></a>
### `{ inserted, outcome?, removedCount?, start, … }`
SHA-256: `d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4`
SHA-256: `91b36ec2f96baa3ac3052fde19e712ffad812b6ca69036ffdde068bc7ab5eac0`
来源:[`packages/core/agent/src/types.ts:110`](../packages/core/agent/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `inserted` | 必需 | [`UserMessage[]`](#persistence-type-sha256-6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85) |
| `inserted` | 必需 | [`UserMessage[]`](#persistence-type-sha256-f9c2cb19607330d3579328475bd02ccdf6b9e3d647eb195bc98cc2519dec5f7f) |
| `outcome` | 可选 | `"canceled"` |
| `removedCount` | 可选 | `number` |
| `start` | 必需 | `number` |
@@ -6619,7 +6666,7 @@ SHA-256: `d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4`
SHA-256: `1ccb56061942f5ccb0d30c9e4f2883b9d115ff906560029de637b61d3cde896d`
来源:[`packages/core/session/src/types.ts:353`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:350`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -8052,17 +8099,17 @@ SHA-256: `b1ebd5cda47d90d980bb05bffc3f970c51537b9aff15b3bc3d639811727741b1`
| `teamId` | 必需 | `string` |
| `version` | 必需 | `2` |
<a id="persistence-type-sha256-6bc8e51124d0874bc89e1d0ceff381a9c3cd0fc240667d69f841ce4f60f65fe5"></a>
<a id="persistence-type-sha256-c460ea99c4124f01e9893c8febbcbd783cadb2d5b11f073ddcd8a9d7e5bf545d"></a>
### `{ message, step, turn }`
SHA-256: `6bc8e51124d0874bc89e1d0ceff381a9c3cd0fc240667d69f841ce4f60f65fe5`
SHA-256: `c460ea99c4124f01e9893c8febbcbd783cadb2d5b11f073ddcd8a9d7e5bf545d`
来源:[`packages/core/session/src/types.ts:342`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:339`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `message` | 必需 | [`SystemMessage`](#persistence-type-sha256-09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363) |
| `message` | 必需 | [`SystemMessage`](#persistence-type-sha256-04c12e59a9ed4d7a59b642223a9bdd3b4303c1d27873c72c5e487760892bbb08) |
| `step` | 必需 | `number` |
| `turn` | 必需 | `number` |
@@ -8108,6 +8155,18 @@ SHA-256: `9890113e97dd3541787bfe6704f2b223d3a890b5325ca0acae2b0398909b413e`
| `mode` | 必需 | [`SandboxMode`](#persistence-type-sha256-fab2bb09bc5e3b9db0685e8f5500b029af1a2b33e70bc703c1d5d0f596fbc1fd) |
| `source` | 可选 | `"delegation"` |
<a id="persistence-type-sha256-a408aa610f991ff3c5a60164145c756e551c38ef5c8faf136920738077fea7a7"></a>
### `{ name, noticeIndex?, state }`
SHA-256: `a408aa610f991ff3c5a60164145c756e551c38ef5c8faf136920738077fea7a7`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `name` | 必需 | `string` |
| `noticeIndex` | 可选 | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
| `state` | 必需 | `"retired"` |
<a id="persistence-type-sha256-11f70b595aa76897fc4e25a352bfa718c659f44b799e5aa14e84e5a38fe72912"></a>
### `{ policy, source? }`
@@ -8193,7 +8252,7 @@ SHA-256: `5dd766ccd1702a1142ad8b4bd44f2242f8e8a6752669ad3de0a5d224329b1438`
SHA-256: `54f9276a1617d7c12594722c89cfe864bcbe4517e9a6f9c98bab14f199a135e0`
来源:[`packages/core/session/src/types.ts:367`](../packages/core/session/src/types.ts)
来源:[`packages/core/session/src/types.ts:364`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -8280,17 +8339,17 @@ SHA-256: `a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b`
| `time` | 必需 | `number` |
| `type` | 必需 | `"agent-preset/selected"` |
<a id="persistence-type-sha256-5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb"></a>
<a id="persistence-type-sha256-2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498"></a>
<a id="persistence-type-eventagentinboxspliced"></a>
### `{ type: "agent/inbox/spliced" }`
SHA-256: `5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb`
SHA-256: `2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `data` | 必需 | [`{ inserted, outcome?, removedCount?, start, … }`](#persistence-type-sha256-d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4) |
| `data` | 必需 | [`{ inserted, outcome?, removedCount?, start, … }`](#persistence-type-sha256-91b36ec2f96baa3ac3052fde19e712ffad812b6ca69036ffdde068bc7ab5eac0) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `time` | 必需 | `number` |
@@ -8531,17 +8590,17 @@ SHA-256: `13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176`
| `time` | 必需 | `number` |
| `type` | 必需 | `"deliverables/presented"` |
<a id="persistence-type-sha256-53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e"></a>
<a id="persistence-type-sha256-ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4"></a>
<a id="persistence-type-eventdevelopermessage"></a>
### `{ type: "developer/message" }`
SHA-256: `53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e`
SHA-256: `ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `data` | 必需 | [`{ headerSeq?, message, step, turn }`](#persistence-type-sha256-27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44) |
| `data` | 必需 | [`{ headerSeq?, message, step, turn }`](#persistence-type-sha256-34af242cde26fe0e35bdfc469935d74c7548f009305eaf553c2b2ef4de2a8a85) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `sourceEventSeqs` | 可选 | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
@@ -8941,17 +9000,17 @@ SHA-256: `1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5`
| `time` | 必需 | `number` |
| `type` | 必需 | `"session/title"` |
<a id="persistence-type-sha256-5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260"></a>
<a id="persistence-type-sha256-1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545"></a>
<a id="persistence-type-eventsessiontitle-llm-request"></a>
### `{ type: "session/title-llm-request" }`
SHA-256: `5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260`
SHA-256: `1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `data` | 必需 | [`SessionTitleLlmRequestEventData`](#persistence-type-sha256-8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69) |
| `data` | 必需 | [`SessionTitleLlmRequestEventData`](#persistence-type-sha256-e90c7a2af8e7d05b9184c819ef8b84711c1821e862494ba701839bd2895fc888) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `time` | 必需 | `number` |
@@ -9037,17 +9096,17 @@ SHA-256: `a6567ccb2e530606b775371eb4fa31468d72084339968e8b0440a516a23b39dc`
| `time` | 必需 | `number` |
| `type` | 必需 | `"subagent/model-selection-policy"` |
<a id="persistence-type-sha256-69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1"></a>
<a id="persistence-type-sha256-ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d"></a>
<a id="persistence-type-eventsystemmessage"></a>
### `{ type: "system/message" }`
SHA-256: `69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1`
SHA-256: `ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `data` | 必需 | [`{ message, step, turn }`](#persistence-type-sha256-6bc8e51124d0874bc89e1d0ceff381a9c3cd0fc240667d69f841ce4f60f65fe5) |
| `data` | 必需 | [`{ message, step, turn }`](#persistence-type-sha256-c460ea99c4124f01e9893c8febbcbd783cadb2d5b11f073ddcd8a9d7e5bf545d) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `sourceEventSeqs` | 可选 | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
@@ -9390,17 +9449,17 @@ SHA-256: `f1a96afe7503ac1817de769cd0ba13d9b80111c7034c50106b3344ecc14cc515`
| `type` | 必需 | `"usage"` |
| `usage` | 必需 | [`TokenUsage`](#persistence-type-sha256-fec5442b9ee4122e10514d81d5a43648003fe8bfb7ee2ba50c0cdbdd383ed394) |
<a id="persistence-type-sha256-3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a"></a>
<a id="persistence-type-sha256-8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950"></a>
<a id="persistence-type-eventusermessage"></a>
### `{ type: "user/message" }`
SHA-256: `3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a`
SHA-256: `8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `data` | 必需 | [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499) |
| `data` | 必需 | [`UserMessage`](#persistence-type-sha256-daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `sourceEventSeqs` | 可选 | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
@@ -0,0 +1,28 @@
# Bilingual-pair consistency record for 2026-10-21-system-section-admissions.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/persistence-changes/2026-10-21-system-section-admissions.md
/:
en: 3d5a424ae7d7e46b
zh: c22a8e4a62d8cc1a
/2026-10-21-system-section-admissions:
en: 6f6beae2c67c81ec
zh: dcacfa025b526e1e
/2026-10-21-system-section-admissions/summary:
en: 7c64c47c91f32537
zh: 7954fdc3affffc39
/2026-10-21-system-section-admissions/table-of-contents:
en: 6cf314a069ceb451
zh: 9adff678e9ecab3b
/2026-10-21-system-section-admissions/declaration:
en: 6907136f28e48c90
zh: 02f8298485f3d8e7
/2026-10-21-system-section-admissions/compatibility:
en: 4dcd58bda904eabe
zh: 65054632ee1fc177
/2026-10-21-system-section-admissions/verification:
en: ed2f9203c285e23b
zh: bd72932af212d5e5
/2026-10-21-system-section-admissions/dev-note:
en: b75c8458928b72b9
zh: 003ba4e17b4b5269
@@ -0,0 +1,64 @@
---
description: "Records a persistence type transition and its compatibility acknowledgement."
kind: persistence-change
---
# 2026-10-21-system-section-admissions
English | [中文](2026-10-21-system-section-admissions.zh.md)
## Summary
System messages attribute canonical text and optional notices to source IDs. Active records carry order and contentIndex, including empty text; retirement records omit both. After compaction, the next model attempt clears later system messages and resets the initial system message through ordinary single-node replacements.
## Table of Contents
- [Declaration](#declaration)
- [Compatibility](#compatibility)
- [Verification](#verification)
- [Dev Note](#dev-note)
<a id="declaration"></a>
## Declaration
```yaml persistence-change
schemaVersion: 1
id: 2026-10-21-system-section-admissions
baseline: false
changes:
- root: "event:agent/inbox/spliced"
previous: "2026-11-09-sdk-prompt-time-zone"
after: "2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498"
decision: same-version
- root: "event:developer/message"
previous: "2026-11-09-sdk-prompt-time-zone"
after: "ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4"
decision: same-version
- root: "event:session/title-llm-request"
previous: "2026-11-09-sdk-prompt-time-zone"
after: "1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545"
decision: same-version
- root: "event:system/message"
previous: "2026-09-16-session-format-v4"
after: "ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d"
decision: same-version
- root: "event:user/message"
previous: "2026-11-09-sdk-prompt-time-zone"
after: "8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950"
decision: same-version
```
<a id="compatibility"></a>
## Compatibility
Existing unattributed messages remain readable. Section metadata preserves model-visible text for readers that do not interpret attribution. Deferred rebuilding uses existing system/message events inside an open step and existing single-node replacement operations. No additional event, message projection, or relationship-validation exception is required; the released V4 reader accepts the writes. Session format version remains V4. The system admission projection state version advances to recover pending compaction and the current head from the log. Retirement removes the named source without reading order; older retirement records containing order remain readable.
<a id="verification"></a>
## Verification
[Canonical-envelope tests](../../packages/core/session/tests/canonical-envelopes.spec.ts) cover source metadata validation. [JSONL admission tests](../../packages/session/session-persistence-jsonl/tests/system-rebuild-admission.spec.ts) verify plain and compressed native read/write, released V4 relationship checks, interrupted cleanup prefixes, and rejection of system replacements outside an open step. These focused suites pass locally.
<a id="dev-note"></a>
## Dev Note
None.
@@ -0,0 +1,274 @@
{
"formatVersion": 2,
"roots": [
{"key":"event:agent/inbox/spliced","kind":"event","event":"agent/inbox/spliced","surface":false,"digest":"2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498"},
{"key":"event:developer/message","kind":"event","event":"developer/message","surface":true,"digest":"ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4"},
{"key":"event:session/title-llm-request","kind":"event","event":"session/title-llm-request","surface":false,"digest":"1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545"},
{"key":"event:system/message","kind":"event","event":"system/message","surface":true,"digest":"ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d"},
{"key":"event:user/message","kind":"event","event":"user/message","surface":true,"digest":"8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950"}
],
"types": [],
"nodes": {
"0203243b72fc867a": {"kind":"object","properties":[{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"022623b9ef98ec47": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"02b2c23f2d94b028": {"kind":"object","properties":[{"name":"kind","type":"c5687b1313206a6f","optional":false}],"indices":[]},
"04c12e59a9ed4d7a": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"8af841fc9b265ade","optional":false},{"name":"source","type":"3d1339bcc98cb537","optional":false}],"indices":[]},
"05205074b24d8340": {"kind":"literal","value":"action-cards"},
"0657d3ca5ac4e7bf": {"kind":"primitive","type":"number"},
"07e1a58c58b593f5": {"kind":"object","properties":[{"name":"model","type":"4cd48f3e5108bd6e","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"09655b34d7f3cf1e": {"kind":"literal","value":"system-prompt"},
"0a92c5bdfa06c2e2": {"kind":"object","properties":[{"name":"displayName","type":"4cd48f3e5108bd6e","optional":true},{"name":"providerId","type":"4cd48f3e5108bd6e","optional":false},{"name":"subjectId","type":"4cd48f3e5108bd6e","optional":false},{"name":"tenantId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"0ed8d1108fe7a5e1": {"kind":"object","properties":[{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"0eeb17e1df89b1eb": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"0f46153645c29784": {"kind":"object","properties":[{"name":"height","type":"0657d3ca5ac4e7bf","optional":false},{"name":"width","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"0fe52387f6505270": {"kind":"literal","value":"plan-mode"},
"1127571148780ee1": {"kind":"object","properties":[{"name":"data","type":"e90c7a2af8e7d05b","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"587bb11da730e06a","optional":false}],"indices":[]},
"11638dc58a31496f": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"12d5808fac1996b9": {"kind":"object","properties":[{"name":"attachment","type":"b0b0eb1b16490f6b","optional":false},{"name":"offloaded","type":"dacf3d5f3e4ff619","optional":true},{"name":"type","type":"fb8b6a2e53cb9cf4","optional":false}],"indices":[]},
"1379f0b72275994d": {"kind":"literal","value":"developer/message"},
"16d0507cb94b4cfc": {"kind":"literal","value":"relay"},
"1922cd79a70806c1": {"kind":"literal","value":"skill-invocation"},
"1938c8c20f1cba7c": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"1c5a58f4599bd4a9": {"kind":"literal","value":"system/message"},
"1e0b0b66b6f0c53f": {"kind":"literal","value":"aborted"},
"1e709346005826eb": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"1ebc6f9ff3aa9e3a": {"kind":"literal","value":"completed"},
"1f0133217eeeffd8": {"kind":"literal","value":"tool-call"},
"1f1385dbc3e875c0": {"kind":"literal","value":"repeat-tool-reminder"},
"1fdad624334d3548": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"2152caf1a71e588e": {"kind":"object","properties":[{"name":"kind","type":"2e4debca12f2c449","optional":false},{"name":"messageId","type":"4cd48f3e5108bd6e","optional":false},{"name":"senderId","type":"4cd48f3e5108bd6e","optional":false},{"name":"senderName","type":"4cd48f3e5108bd6e","optional":false},{"name":"teamId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"2235d957bf4b7c6c": {"kind":"object","properties":[{"name":"kind","type":"7b1ce60193fa8b69","optional":false}],"indices":[]},
"224aa11d4d5f88c4": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"23af3759678a30de": {"kind":"literal","value":"dsh-session-title-llm"},
"24b10f7cdae64928": {"kind":"literal","value":"runtime-context"},
"24ce31aa528272e5": {"kind":"object","properties":[{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"260523b412c19ad8": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"2719cd69e8ef5794": {"kind":"object","properties":[{"name":"data","type":"91b36ec2f96baa3a","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"829a2fb3be6efd4b","optional":false}],"indices":[]},
"2765e9119edf5816": {"kind":"literal","value":"model"},
"277b61f9c6f81704": {"kind":"literal","value":"file"},
"28936c614bd4e7e2": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"290f32bfd81ff85a": {"kind":"object","properties":[{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"297fbd8067d7815a": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"2aad1179f9576314": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"2ab12a0e345658f9": {"kind":"array","element":"83da72c6857601c7"},
"2e4debca12f2c449": {"kind":"literal","value":"team-message"},
"2f1e6a7ebace43d7": {"kind":"union","types":["3f74ba74acd10644","58f94390b982f8a5","de30b1fa12c75f81","ebb768d85ec87fb6"]},
"2f3f201c8846e19c": {"kind":"literal","value":"tool-goal"},
"312aee2f0c42aabb": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"31907de956375182": {"kind":"object","properties":[{"name":"compactionId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"6b23ed9ce1b397e6","optional":false},{"name":"sourceCommandId","type":"4cd48f3e5108bd6e","optional":true}],"indices":[]},
"3247e566f4340029": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"335e242de1fcc17b": {"kind":"union","types":["bcf0caf62d964b2f","e438a9d4fb883b3e"]},
"34af242cde26fe0e": {"kind":"object","properties":[{"name":"headerSeq","type":"0657d3ca5ac4e7bf","optional":true},{"name":"message","type":"7645031a0886c6fb","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"383cf73ae4748e5b": {"kind":"literal","value":"recall"},
"3b04790e08b35241": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"3b4f2c9ef2c1217e": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"3bd652ebfa8726b3": {"kind":"union","types":["0657d3ca5ac4e7bf","938f7c7357bc403e"]},
"3bdb8dc6989655b0": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"3c2535ca0a2062f1": {"kind":"literal","value":"reasoning"},
"3d1339bcc98cb537": {"kind":"object","properties":[{"name":"complete","type":"dacf3d5f3e4ff619","optional":true},{"name":"kind","type":"09655b34d7f3cf1e","optional":false},{"name":"reset","type":"dacf3d5f3e4ff619","optional":true},{"name":"sections","type":"8decd4949d9ee4ad","optional":true}],"indices":[]},
"3e2ece4967cfebe9": {"kind":"literal","value":"next-step"},
"3f74ba74acd10644": {"kind":"literal","value":"image/jpeg"},
"408927267422a7b2": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"43e311235aa537df": {"kind":"object","properties":[{"name":"toolName","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"83d6916021eede8f","optional":false}],"indices":[]},
"45f005e6bbb76452": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"4902846b72aabae5": {"kind":"literal","value":"retired"},
"4991dfc415c9efeb": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"49dab019d00e8c26": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"4a561c111a78d452": {"kind":"literal","value":"refusal"},
"4a9bef9f27a94252": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"82470020b5bfcb1a","optional":false},{"name":"senderSessionId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"4b259f7f8f0a44ad": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"isError","type":"aa93010d0e521ad7","optional":true},{"name":"role","type":"a13d8f379222ece8","optional":false},{"name":"source","type":"d9c462b9f62fdd3e","optional":false},{"name":"toolCallId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"4cd48f3e5108bd6e": {"kind":"primitive","type":"string"},
"4d60dddaa65d3da8": {"kind":"object","properties":[{"name":"actor","type":"0a92c5bdfa06c2e2","optional":false},{"name":"kind","type":"6ba7edb6447b6a3e","optional":false},{"name":"shareId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"4e44c9118152f682": {"kind":"literal","value":"text"},
"4e88776858652856": {"kind":"object","properties":[{"name":"text","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"4e44c9118152f682","optional":false}],"indices":[]},
"4edec1b770e8ec4c": {"kind":"literal","value":"ptc-mode"},
"4f91f187baeabef5": {"kind":"object","properties":[{"name":"capturedFormatVersion","type":"0657d3ca5ac4e7bf","optional":true},{"name":"capturedThroughSeq","type":"3bd652ebfa8726b3","optional":false},{"name":"compacted","type":"aa93010d0e521ad7","optional":false},{"name":"inputIndex","type":"0657d3ca5ac4e7bf","optional":false},{"name":"label","type":"4cd48f3e5108bd6e","optional":false},{"name":"omittedBytes","type":"0657d3ca5ac4e7bf","optional":false},{"name":"omittedMessages","type":"0657d3ca5ac4e7bf","optional":false},{"name":"originalMessages","type":"0657d3ca5ac4e7bf","optional":false},{"name":"retainedMessages","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sessionId","type":"4cd48f3e5108bd6e","optional":false},{"name":"truncated","type":"aa93010d0e521ad7","optional":false}],"indices":[]},
"52c6113cb0e53f34": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"53cf1704ae0709c7": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"5654685d7557ec74": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"58015da1c1950a66": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"587bb11da730e06a": {"kind":"literal","value":"session/title-llm-request"},
"589d0d91239681f8": {"kind":"literal","value":"developer"},
"58f94390b982f8a5": {"kind":"literal","value":"image/png"},
"5b7abd24d8a133e7": {"kind":"union","types":["792eb6cb1f6bed83","a408aa610f991ff3"]},
"5bb69b88517f6214": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"5bc66269cfaf614c": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"5cdbf342b7748d15": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"5d03ba38734809bc": {"kind":"array","element":"0657d3ca5ac4e7bf"},
"5d7a64ed6aac5551": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"6085488d223aeffd": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"6292bcbedaa97fea": {"kind":"object","properties":[{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"62ecb62dc0fe1b5e": {"kind":"literal","value":"next-turn"},
"63ba8895cc09e469": {"kind":"literal","value":"retry"},
"65d583e66518c523": {"kind":"object","properties":[{"name":"entries","type":"aba175fb20ffc711","optional":false},{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"incomplete","type":"dacf3d5f3e4ff619","optional":true},{"name":"kind","type":"6ebcc2dbec9f2dab","optional":false},{"name":"update","type":"dacf3d5f3e4ff619","optional":true}],"indices":[]},
"672c4aa2a9b736e3": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"1922cd79a70806c1","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"68141cbe3994a5ff": {"kind":"literal","value":"max-tokens"},
"68f44f59e91c4139": {"kind":"literal","value":"user"},
"6b23ed9ce1b397e6": {"kind":"literal","value":"compact-checkpoint"},
"6ba7edb6447b6a3e": {"kind":"literal","value":"share-viewer"},
"6ccb6bc423fb3952": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"6ea608bdc8a7a63d": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"6ebcc2dbec9f2dab": {"kind":"literal","value":"skill-catalog"},
"6f22a9d02b9a1f11": {"kind":"object","properties":[{"name":"baseline","type":"dacf3d5f3e4ff619","optional":true},{"name":"baselineIdentity","type":"4cd48f3e5108bd6e","optional":true},{"name":"changes","type":"2ab12a0e345658f9","optional":false},{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"fbd2c74b346a1595","optional":false}],"indices":[]},
"6f44f32be9bcd9a8": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"6f9e00383836275e": {"kind":"literal","value":"snapshot"},
"719c51f67074f970": {"kind":"object","properties":[{"name":"kind","type":"2765e9119edf5816","optional":false},{"name":"model","type":"4cd48f3e5108bd6e","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false},{"name":"replayState","type":"bbc5696e3f13c758","optional":true}],"indices":[]},
"7382c4fc95fe8c5d": {"kind":"literal","value":"remove"},
"7554565be416b034": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"756b5e23a5cb2c7f": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"7645031a0886c6fb": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"589d0d91239681f8","optional":false},{"name":"source","type":"9c75043166543713","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.developer-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"78a9be340090b735": {"kind":"literal","value":"tmux-context"},
"792eb6cb1f6bed83": {"kind":"object","properties":[{"name":"contentIndex","type":"0657d3ca5ac4e7bf","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"noticeIndex","type":"5d03ba38734809bc","optional":true},{"name":"order","type":"0657d3ca5ac4e7bf","optional":false},{"name":"state","type":"c8e6f48878cc2a2f","optional":false}],"indices":[]},
"7b1ce60193fa8b69": {"kind":"literal","value":"working-directory"},
"7df62978a2b7de85": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"7eaef7a763ba5b94": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"7f13860ee89a2d35": {"kind":"literal","value":"session-reference"},
"7f959241c24128b4": {"kind":"object","properties":[{"name":"goalId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"b815d7b91cdd9fc6","optional":false},{"name":"revision","type":"0657d3ca5ac4e7bf","optional":false},{"name":"round","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"8064c03c87c357fd": {"kind":"union","types":["12d5808fac1996b9","43e311235aa537df","4e88776858652856","814d9434e1ddf907","8e611bf46821e500","c1f0f17b6493b85d","f2da0f27c1e6add5"]},
"80677c8c8b804189": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"8067b0d232c350f1": {"kind":"literal","value":"time-context"},
"814d9434e1ddf907": {"kind":"object","properties":[{"name":"text","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"3c2535ca0a2062f1","optional":false}],"indices":[]},
"82470020b5bfcb1a": {"kind":"literal","value":"agent-message"},
"824a4aad44a54e24": {"kind":"union","types":["4d60dddaa65d3da8","deebfc7c62177ea8"]},
"825ca23416b1ea9d": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"829a2fb3be6efd4b": {"kind":"literal","value":"agent/inbox/spliced"},
"83079c8a3f733ac3": {"kind":"object","properties":[{"name":"description","type":"4cd48f3e5108bd6e","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8338ee303e2bd448": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"83d6916021eede8f": {"kind":"literal","value":"tool-removal"},
"83da72c6857601c7": {"kind":"object","properties":[{"name":"action","type":"904bf499d98be4a3","optional":false},{"name":"digest","type":"4cd48f3e5108bd6e","optional":true},{"name":"path","type":"4cd48f3e5108bd6e","optional":false},{"name":"scope","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"848639f8787f035b": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"bf16d2e98a7f1389","optional":false},{"name":"senderSessionId","type":"4cd48f3e5108bd6e","optional":false},{"name":"stopReason","type":"866f7b2dbdc5b421","optional":true},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"854db3efdfb0cd39": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"85d6d96ff8842974": {"kind":"literal","value":"answered"},
"85f9b505b7bdff1f": {"kind":"literal","value":"tool-addition"},
"85fe96bf15d5c755": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"8620189c8e335827": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"866f7b2dbdc5b421": {"kind":"union","types":["1e0b0b66b6f0c53f","1ebc6f9ff3aa9e3a","4a561c111a78d452","68141cbe3994a5ff","a2be0f0cb59f0d4a"]},
"86e1e384495ee09a": {"kind":"object","properties":[{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"text","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"87b1a33564b9a4d6": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"88841202942c7683": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"8a046b52331959aa": {"kind":"object","properties":[{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"8af841fc9b265ade": {"kind":"literal","value":"system"},
"8c1c4f72755a78ea": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"8c627d7a45fa406c": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8decd4949d9ee4ad": {"kind":"array","element":"5b7abd24d8a133e7"},
"8e611bf46821e500": {"kind":"object","properties":[{"name":"tool","type":"fcf427290c6213c2","optional":true},{"name":"toolName","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"85f9b505b7bdff1f","optional":false}],"indices":[]},
"8f1062573ea91841": {"kind":"object","properties":[{"name":"clientTimeZone","type":"4cd48f3e5108bd6e","optional":true},{"name":"kind","type":"63ba8895cc09e469","optional":false},{"name":"principal","type":"824a4aad44a54e24","optional":true},{"name":"rpcId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8f324cea3916c051": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"8fc8f70451996be0": {"kind":"object","properties":[{"name":"data","type":"daffe1e8caaeaf76","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"de25352d2dc41963","optional":false}],"indices":[]},
"8fcb0b44a575e998": {"kind":"object","properties":[{"name":"kind","type":"a720757f704a2512","optional":false}],"indices":[]},
"904bf499d98be4a3": {"kind":"union","types":["7382c4fc95fe8c5d","b765ee31033cea46","f6cb462f808309e3"]},
"91b36ec2f96baa3a": {"kind":"object","properties":[{"name":"inserted","type":"f9c2cb19607330d3","optional":false},{"name":"outcome","type":"d4e4d575abeb4b72","optional":true},{"name":"removedCount","type":"0657d3ca5ac4e7bf","optional":true},{"name":"start","type":"0657d3ca5ac4e7bf","optional":false},{"name":"target","type":"96f4a9c81fc0f940","optional":false}],"indices":[]},
"938f7c7357bc403e": {"kind":"primitive","type":"null"},
"95a3ffccbf3c8afc": {"kind":"literal","value":"owner"},
"95c0e88fcf0bafb2": {"kind":"literal","value":"assistant"},
"9645cf93769a6dfb": {"kind":"literal","value":"user-question-reply"},
"96bfb916a727cd44": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"96f4a9c81fc0f940": {"kind":"union","types":["3e2ece4967cfebe9","62ecb62dc0fe1b5e"]},
"99135d8a39379779": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"99e7e7d7fed55ae6": {"kind":"literal","value":"tool-jobs"},
"99f0e98184709ad1": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"9ac52f0f84fec2eb": {"kind":"literal","value":"model-selection"},
"9c75043166543713": {"kind":"union","types":["0203243b72fc867a","022623b9ef98ec47","02b2c23f2d94b028","0ed8d1108fe7a5e1","0eeb17e1df89b1eb","11638dc58a31496f","1938c8c20f1cba7c","1e709346005826eb","1fdad624334d3548","2152caf1a71e588e","2235d957bf4b7c6c","224aa11d4d5f88c4","24ce31aa528272e5","260523b412c19ad8","28936c614bd4e7e2","290f32bfd81ff85a","297fbd8067d7815a","2aad1179f9576314","312aee2f0c42aabb","31907de956375182","3247e566f4340029","3b04790e08b35241","3b4f2c9ef2c1217e","3bdb8dc6989655b0","3d1339bcc98cb537","408927267422a7b2","45f005e6bbb76452","4991dfc415c9efeb","49dab019d00e8c26","4a9bef9f27a94252","52c6113cb0e53f34","53cf1704ae0709c7","5654685d7557ec74","58015da1c1950a66","5bb69b88517f6214","5bc66269cfaf614c","5cdbf342b7748d15","5d7a64ed6aac5551","6085488d223aeffd","6292bcbedaa97fea","65d583e66518c523","672c4aa2a9b736e3","6ccb6bc423fb3952","6ea608bdc8a7a63d","6f22a9d02b9a1f11","6f44f32be9bcd9a8","719c51f67074f970","7554565be416b034","756b5e23a5cb2c7f","7df62978a2b7de85","7eaef7a763ba5b94","7f959241c24128b4","80677c8c8b804189","825ca23416b1ea9d","8338ee303e2bd448","848639f8787f035b","854db3efdfb0cd39","85fe96bf15d5c755","8620189c8e335827","87b1a33564b9a4d6","88841202942c7683","8a046b52331959aa","8c1c4f72755a78ea","8c627d7a45fa406c","8f1062573ea91841","8f324cea3916c051","8fcb0b44a575e998","96bfb916a727cd44","99135d8a39379779","99f0e98184709ad1","9edc162949abf93b","9f65c43e340bba31","a15a19ef63cf5d1b","a16e567c8cd2c55c","a2066bd52f61218b","a3c6f1ea38e9a61d","a4afec59b75aad5d","aa2bf9e82b9fdeb9","aae343bc3d663c83","ada310bf0bdb8fed","ade057f4fdc387ae","b062078e899958f9","b2a5c8c008a31e3d","b3681c026a0b98e9","b4ec0af39fd52ed9","b613f83572fe2fbf","b6f94c17dd9bbd7c","b70f3e81fe11b7a5","b79641a9d25e7566","b8ed92a5ca59733f","ba2a1a8f194b1bb2","ba4c40b4381e0dcd","baccc97ec34be6c4","c5228b7a55498d84","c55827fba7018198","cb1c8959e1726f82","cda2345a9be9d139","d215701afb7aafbf","d85590a5675c6e2f","d9c462b9f62fdd3e","db06ef35b27a3842","dba54c09c6e7aafc","dd00cdccd0ba487b","dd5ee8762bd8a14b","dd6cc2bb2a8f2824","dde0cdf9d426768b","deaae5cd30987d4f","e7f4cbb3a57f4cbd","edbbfff1128099fd","ee577a0cc18664c9","f230c0b583e23b25","f29d63336e8266d8","f4a66f654996c093","f56c5b59ca016131","f6329fb30c7ea801","f6605d6c57933aea","f6afe41e3926f422","f7283223aacdc39b","f97f47b0eb87905e","fcf81d3c58c13593","fe1a7acdeed4d0f5"]},
"9edc162949abf93b": {"kind":"object","properties":[{"name":"deliveryId","type":"4cd48f3e5108bd6e","optional":false},{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"db6c5246911d47a7","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false},{"name":"ruleId","type":"4cd48f3e5108bd6e","optional":false},{"name":"source","type":"4cd48f3e5108bd6e","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"9f65c43e340bba31": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"a13d8f379222ece8": {"kind":"literal","value":"tool"},
"a15a19ef63cf5d1b": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"a16e567c8cd2c55c": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"a2066bd52f61218b": {"kind":"object","properties":[{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"a2be0f0cb59f0d4a": {"kind":"literal","value":"error"},
"a3c6f1ea38e9a61d": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"a408aa610f991ff3": {"kind":"object","properties":[{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"noticeIndex","type":"5d03ba38734809bc","optional":true},{"name":"state","type":"4902846b72aabae5","optional":false}],"indices":[]},
"a4afec59b75aad5d": {"kind":"object","properties":[{"name":"clientTimeZone","type":"4cd48f3e5108bd6e","optional":true},{"name":"kind","type":"68f44f59e91c4139","optional":false},{"name":"principal","type":"824a4aad44a54e24","optional":true},{"name":"rpcId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"a720757f704a2512": {"kind":"literal","value":"tool-registry"},
"a9059a81430b3207": {"kind":"literal","value":"hooks-claude-code"},
"aa2bf9e82b9fdeb9": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"aa93010d0e521ad7": {"kind":"primitive","type":"boolean"},
"aae343bc3d663c83": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"aba175fb20ffc711": {"kind":"array","element":"83079c8a3f733ac3"},
"ada310bf0bdb8fed": {"kind":"object","properties":[{"name":"kind","type":"68f44f59e91c4139","optional":false}],"indices":[]},
"ade057f4fdc387ae": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"aec150797b655c5f": {"kind":"literal","value":"catalog"},
"b062078e899958f9": {"kind":"object","properties":[{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"b0b0eb1b16490f6b": {"kind":"object","properties":[{"name":"attachmentId","type":"4cd48f3e5108bd6e","optional":false},{"name":"bytes","type":"0657d3ca5ac4e7bf","optional":false},{"name":"height","type":"0657d3ca5ac4e7bf","optional":false},{"name":"mediaType","type":"2f1e6a7ebace43d7","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":true},{"name":"originalDimensions","type":"0f46153645c29784","optional":true},{"name":"width","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"b2a5c8c008a31e3d": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"b3681c026a0b98e9": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"b4ec0af39fd52ed9": {"kind":"object","properties":[{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"b52f215a6cd69105": {"kind":"array","element":"8064c03c87c357fd"},
"b613f83572fe2fbf": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"b6f94c17dd9bbd7c": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"b70f3e81fe11b7a5": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"b765ee31033cea46": {"kind":"literal","value":"set"},
"b79641a9d25e7566": {"kind":"object","properties":[{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"b815d7b91cdd9fc6": {"kind":"literal","value":"goal"},
"b8ed92a5ca59733f": {"kind":"object","properties":[{"name":"clientTimeZone","type":"4cd48f3e5108bd6e","optional":true},{"name":"kind","type":"68f44f59e91c4139","optional":false}],"indices":[]},
"ba2a1a8f194b1bb2": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"ba4c40b4381e0dcd": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"baccc97ec34be6c4": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"bb94f3217aa56c88": {"kind":"literal","value":"hooks-codex"},
"bbc5696e3f13c758": {"kind":"opaque","reason":"unknown"},
"bcf0caf62d964b2f": {"kind":"object","properties":[{"name":"endSeq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"op","type":"f6cb462f808309e3","optional":false},{"name":"startSeq","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"be53b443539d32c2": {"kind":"array","element":"e7f07198d10adc34"},
"bf16d2e98a7f1389": {"kind":"literal","value":"subagent-settled"},
"c1f0f17b6493b85d": {"kind":"object","properties":[{"name":"arguments","type":"4cd48f3e5108bd6e","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"1f0133217eeeffd8","optional":false}],"indices":[]},
"c460ea99c4124f01": {"kind":"object","properties":[{"name":"message","type":"04c12e59a9ed4d7a","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"c5228b7a55498d84": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"c55827fba7018198": {"kind":"object","properties":[{"name":"callId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"9645cf93769a6dfb","optional":false},{"name":"outcome","type":"85d6d96ff8842974","optional":false}],"indices":[]},
"c5687b1313206a6f": {"kind":"literal","value":"cordis-host-runner"},
"c748fb42c80a1200": {"kind":"array","element":"86e1e384495ee09a"},
"c77ac037cb8af460": {"kind":"literal","value":"timeline-priority"},
"c8e6f48878cc2a2f": {"kind":"literal","value":"active"},
"cb1c8959e1726f82": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"cda2345a9be9d139": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"ce9404e050df9462": {"kind":"object","properties":[{"name":"data","type":"34af242cde26fe0e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1379f0b72275994d","optional":false}],"indices":[]},
"d215701afb7aafbf": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"c77ac037cb8af460","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"d4e4d575abeb4b72": {"kind":"literal","value":"canceled"},
"d85590a5675c6e2f": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"d9c462b9f62fdd3e": {"kind":"object","properties":[{"name":"callId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"a13d8f379222ece8","optional":false}],"indices":[]},
"d9edf1862e4471d6": {"kind":"literal","value":"schedule"},
"dacf3d5f3e4ff619": {"kind":"literal","value":true},
"daffe1e8caaeaf76": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"68f44f59e91c4139","optional":false},{"name":"source","type":"9c75043166543713","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.user-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"db06ef35b27a3842": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"db6c5246911d47a7": {"kind":"literal","value":"webhook"},
"dba54c09c6e7aafc": {"kind":"object","properties":[{"name":"kind","type":"4edec1b770e8ec4c","optional":false}],"indices":[]},
"dd00cdccd0ba487b": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"dd5ee8762bd8a14b": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"dd6cc2bb2a8f2824": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"dde0cdf9d426768b": {"kind":"object","properties":[{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"de25352d2dc41963": {"kind":"literal","value":"user/message"},
"de30b1fa12c75f81": {"kind":"literal","value":"image/gif"},
"deaae5cd30987d4f": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"deebfc7c62177ea8": {"kind":"object","properties":[{"name":"kind","type":"95a3ffccbf3c8afc","optional":false}],"indices":[]},
"df843efd87c78cf8": {"kind":"array","element":"4f91f187baeabef5"},
"e438a9d4fb883b3e": {"kind":"literal","value":"append"},
"e7f07198d10adc34": {"kind":"union","types":["04c12e59a9ed4d7a","4b259f7f8f0a44ad","7645031a0886c6fb","daffe1e8caaeaf76","fa87537f4a9c1e25"]},
"e7f4cbb3a57f4cbd": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"e8de0f457fed5b9f": {"kind":"literal","value":"notice"},
"e90c7a2af8e7d05b": {"kind":"object","properties":[{"name":"maxTokens","type":"0657d3ca5ac4e7bf","optional":false},{"name":"messageSeqs","type":"5d03ba38734809bc","optional":false},{"name":"messages","type":"be53b443539d32c2","optional":false},{"name":"reasoningEffort","type":"4cd48f3e5108bd6e","optional":true},{"name":"route","type":"07e1a58c58b593f5","optional":false},{"name":"system","type":"4cd48f3e5108bd6e","optional":false},{"name":"titleProvider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"ebb768d85ec87fb6": {"kind":"literal","value":"image/webp"},
"ed3b0ee800e0ef9a": {"kind":"object","properties":[{"name":"data","type":"c460ea99c4124f01","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1c5a58f4599bd4a9","optional":false}],"indices":[]},
"edbbfff1128099fd": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"ee577a0cc18664c9": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"f19bee84bf3d2090": {"kind":"object","properties":[{"name":"attachmentId","type":"4cd48f3e5108bd6e","optional":false},{"name":"bytes","type":"0657d3ca5ac4e7bf","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"f230c0b583e23b25": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"f29d63336e8266d8": {"kind":"object","properties":[{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"f2da0f27c1e6add5": {"kind":"object","properties":[{"name":"attachment","type":"f19bee84bf3d2090","optional":false},{"name":"type","type":"277b61f9c6f81704","optional":false}],"indices":[]},
"f4a66f654996c093": {"kind":"object","properties":[{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"f56c5b59ca016131": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"7f13860ee89a2d35","optional":false},{"name":"references","type":"df843efd87c78cf8","optional":false},{"name":"version","type":"f88f1b7b6bb733f6","optional":false}],"indices":[]},
"f6329fb30c7ea801": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"f6605d6c57933aea": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"f68c335306535a00": {"kind":"literal","value":"user-approval"},
"f6afe41e3926f422": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"f6cb462f808309e3": {"kind":"literal","value":"replace"},
"f7283223aacdc39b": {"kind":"object","properties":[{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"f88f1b7b6bb733f6": {"kind":"literal","value":1},
"f97f47b0eb87905e": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"f9c2cb19607330d3": {"kind":"array","element":"daffe1e8caaeaf76"},
"fa87537f4a9c1e25": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"95c0e88fcf0bafb2","optional":false},{"name":"source","type":"719c51f67074f970","optional":false}],"indices":[]},
"fb8b6a2e53cb9cf4": {"kind":"literal","value":"image"},
"fbd2c74b346a1595": {"kind":"literal","value":"agent-instructions"},
"fcf427290c6213c2": {"kind":"primitive","type":"never"},
"fcf81d3c58c13593": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"fe1a7acdeed4d0f5": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"fee1caf8ab6a65c1": {"kind":"literal","value":"instructions"}
}
}
@@ -0,0 +1,64 @@
---
description: "记录持久化类型更改及其兼容性确认。"
kind: persistence-change
---
# 2026-10-21-system-section-admissions
[English](2026-10-21-system-section-admissions.md) | 中文
## 概述
系统消息按来源 ID 标记规范文本及可选通知。活跃记录包含 order 和 contentIndex,包括空文本;退役记录省略这两个字段。压缩后,下一次模型尝试通过普通单节点替换清空后续系统消息并重置初始系统消息。
## 目录
- [声明](#declaration)
- [兼容性](#compatibility)
- [验证](#verification)
- [开发备注](#dev-note)
<a id="declaration"></a>
## 声明
```yaml persistence-change
schemaVersion: 1
id: 2026-10-21-system-section-admissions
baseline: false
changes:
- root: "event:agent/inbox/spliced"
previous: "2026-11-09-sdk-prompt-time-zone"
after: "2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498"
decision: same-version
- root: "event:developer/message"
previous: "2026-11-09-sdk-prompt-time-zone"
after: "ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4"
decision: same-version
- root: "event:session/title-llm-request"
previous: "2026-11-09-sdk-prompt-time-zone"
after: "1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545"
decision: same-version
- root: "event:system/message"
previous: "2026-09-16-session-format-v4"
after: "ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d"
decision: same-version
- root: "event:user/message"
previous: "2026-11-09-sdk-prompt-time-zone"
after: "8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950"
decision: same-version
```
<a id="compatibility"></a>
## 兼容性
已有未归属消息仍可读取。不解释来源归属的读取方仍可保留段元数据对应的模型可见文本。延迟重建使用开放步骤内已有的 system/message 事件和已有的单节点替换操作。不需要额外事件、消息投影或关系校验例外;已发布的 V4 读取方可以接受这些写入。Session 格式版本仍为 V4。系统准入投影状态版本递增,以从日志恢复待执行的压缩重建及当前头节点。 退役记录按名称移除来源,不读取 order;包含 order 的旧退役记录仍可读取。
<a id="verification"></a>
## 验证
[规范信封测试](../../packages/core/session/tests/canonical-envelopes.spec.ts)覆盖来源元数据校验。[JSONL 准入测试](../../packages/session/session-persistence-jsonl/tests/system-rebuild-admission.spec.ts)验证普通及压缩原生读写、已发布 V4 的关系校验、中断的清理前缀,以及拒绝开放步骤之外的系统替换。这些专项测试已在本地通过。
<a id="dev-note"></a>
## 开发备注
无。
@@ -15,8 +15,8 @@
en: 14c57f30e676f6e3
zh: b1a0ccf26fab3727
/session-persistence-formats/format-references:
en: 8d508263179b3354
zh: 2c75bdc2f433764a
en: a3657de592c12d02
zh: 034e327eb92a3121
/session-persistence-formats/scope-and-evidence:
en: 44ba17a168ec63ac
zh: c80a44bdbf17a174
@@ -32,7 +32,7 @@ The index is generated from validated snapshots and the current writer constant.
| 1 | PR #3349 | [V1](v1.md) | [JSON](v1.schema.json) | 54 / 415 |
| 2 | `dsh-v0.1.3-alpha.2` | [V2](v2.md) | [JSON](v2.schema.json) | 56 / 435 |
| 3 | PR #4320 | [V3](v3.md) | [JSON](v3.schema.json) | 60 / 467 |
| 4 | Current checkout | [Current catalog](../../persistence-catalog.md) | [JSON](../../persistence-schema.json) | 67 / 641 |
| 4 | Current checkout | [Current catalog](../../persistence-catalog.md) | [JSON](../../persistence-schema.json) | 67 / 646 |
<!-- persistence-format-index:end -->
@@ -32,7 +32,7 @@ description: "查找从 V0 到工作区写入器版本的每个 Session 格式
| 1 | PR #3349 | [V1](v1.zh.md) | [JSON](v1.schema.json) | 54 / 415 |
| 2 | `dsh-v0.1.3-alpha.2` | [V2](v2.zh.md) | [JSON](v2.schema.json) | 56 / 435 |
| 3 | PR #4320 | [V3](v3.zh.md) | [JSON](v3.schema.json) | 60 / 467 |
| 4 | 当前工作树 | [当前目录](../../persistence-catalog.zh.md) | [JSON](../../persistence-schema.json) | 67 / 641 |
| 4 | 当前工作树 | [当前目录](../../persistence-catalog.zh.md) | [JSON](../../persistence-schema.json) | 67 / 646 |
<!-- persistence-format-index:end -->
+62 -52
View File
@@ -5,7 +5,7 @@
{"key":"JsonlHeaderLine","kind":"header","digest":"18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f"},
{"key":"SessionEventEnvelope","kind":"envelope","digest":"5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc"},
{"key":"event:agent-preset/selected","kind":"event","event":"agent-preset/selected","surface":false,"digest":"a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b"},
{"key":"event:agent/inbox/spliced","kind":"event","event":"agent/inbox/spliced","surface":false,"digest":"5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb"},
{"key":"event:agent/inbox/spliced","kind":"event","event":"agent/inbox/spliced","surface":false,"digest":"2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498"},
{"key":"event:approval/asked","kind":"event","event":"approval/asked","surface":false,"digest":"3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1"},
{"key":"event:approval/decided","kind":"event","event":"approval/decided","surface":false,"digest":"bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3"},
{"key":"event:approval/policy","kind":"event","event":"approval/policy","surface":false,"digest":"26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78"},
@@ -18,7 +18,7 @@
{"key":"event:compaction/start","kind":"event","event":"compaction/start","surface":false,"digest":"db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965"},
{"key":"event:compaction/summary","kind":"event","event":"compaction/summary","surface":false,"digest":"e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602"},
{"key":"event:deliverables/presented","kind":"event","event":"deliverables/presented","surface":false,"digest":"13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176"},
{"key":"event:developer/message","kind":"event","event":"developer/message","surface":true,"digest":"53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e"},
{"key":"event:developer/message","kind":"event","event":"developer/message","surface":true,"digest":"ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4"},
{"key":"event:feedback/message-delete","kind":"event","event":"feedback/message-delete","surface":false,"digest":"3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796"},
{"key":"event:feedback/message-put","kind":"event","event":"feedback/message-put","surface":false,"digest":"b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf"},
{"key":"event:feedback/record","kind":"event","event":"feedback/record","surface":false,"digest":"b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8"},
@@ -40,13 +40,13 @@
{"key":"event:session-log-deepseek/delivery-accepted","kind":"event","event":"session-log-deepseek/delivery-accepted","surface":false,"digest":"d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9"},
{"key":"event:session/end-seed","kind":"event","event":"session/end-seed","surface":false,"digest":"5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e"},
{"key":"event:session/title","kind":"event","event":"session/title","surface":false,"digest":"1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5"},
{"key":"event:session/title-llm-request","kind":"event","event":"session/title-llm-request","surface":false,"digest":"5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260"},
{"key":"event:session/title-llm-request","kind":"event","event":"session/title-llm-request","surface":false,"digest":"1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545"},
{"key":"event:step/end","kind":"event","event":"step/end","surface":false,"digest":"e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05"},
{"key":"event:step/start","kind":"event","event":"step/start","surface":false,"digest":"4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986"},
{"key":"event:subagent/catalog","kind":"event","event":"subagent/catalog","surface":false,"digest":"d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41"},
{"key":"event:subagent/descriptor","kind":"event","event":"subagent/descriptor","surface":false,"digest":"b79ada42962cad0190a9d465805260567621fa3a4abd757eb31e6016b52d5ab5"},
{"key":"event:subagent/model-selection-policy","kind":"event","event":"subagent/model-selection-policy","surface":false,"digest":"a6567ccb2e530606b775371eb4fa31468d72084339968e8b0440a516a23b39dc"},
{"key":"event:system/message","kind":"event","event":"system/message","surface":true,"digest":"69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1"},
{"key":"event:system/message","kind":"event","event":"system/message","surface":true,"digest":"ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d"},
{"key":"event:team/member","kind":"event","event":"team/member","surface":false,"digest":"4fb59762612c3e3ac3a3bd4f84c9c148d3c3893bd422ba2b201cc039fabd49bc"},
{"key":"event:team/message/delivered","kind":"event","event":"team/message/delivered","surface":false,"digest":"48f9c19417a1abbedfa59f4667bba36b93ac2db407adf5e84cb3ba0de30942cb"},
{"key":"event:team/message/queued","kind":"event","event":"team/message/queued","surface":false,"digest":"21fb6a90d5068f6a0003b7ab316ed2f56342477146a65c00db0f13c4d8df667d"},
@@ -63,7 +63,7 @@
{"key":"event:tool/result","kind":"event","event":"tool/result","surface":true,"digest":"7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397"},
{"key":"event:turn/end","kind":"event","event":"turn/end","surface":false,"digest":"0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce"},
{"key":"event:turn/start","kind":"event","event":"turn/start","surface":false,"digest":"aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8"},
{"key":"event:user/message","kind":"event","event":"user/message","surface":true,"digest":"3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a"},
{"key":"event:user/message","kind":"event","event":"user/message","surface":true,"digest":"8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950"},
{"key":"event:web/deepseek-search-llm-request","kind":"event","event":"web/deepseek-search-llm-request","surface":false,"digest":"0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52"},
{"key":"event:working-directory/change","kind":"event","event":"working-directory/change","surface":false,"digest":"124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3"},
{"key":"event:workspace-root/change","kind":"event","event":"workspace-root/change","surface":false,"digest":"025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc"},
@@ -72,12 +72,12 @@
"types": [
{"digest":"0116b1f89c05221d56b0ba35c83d302bf4857bc7277d247e9bbaf74b27d2c66e","names":[],"sources":[]},
{"digest":"0203243b72fc867afc81aff5f4cf2167e564ed342534eb612fc92f295cf07789","names":[],"sources":[]},
{"digest":"02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a","names":[],"sources":[]},
{"digest":"022623b9ef98ec47ec3c3bae0c51027c70d2601141c5e92e26a0d83d1b4cef06","names":[],"sources":[]},
{"digest":"023a355b2be0d688fb6e4df8388dadb942761d46cfe96d0f499aae9631a159d4","names":[],"sources":["packages/core/session/src/types.ts:215"]},
{"digest":"025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc","names":[],"sources":[]},
{"digest":"02b2c23f2d94b028c9588a8faace3fce1217405db346da3389368b495457bf79","names":[],"sources":["packages/extensions/cordis-host-runner/src/index.ts:15"]},
{"digest":"0341d4c3dfcd53253cdc1e789d9130d3cd848b6f8b0706bf92f313a68b39ff23","names":[],"sources":[]},
{"digest":"04c12e59a9ed4d7a59b642223a9bdd3b4303c1d27873c72c5e487760892bbb08","names":["packages/llm/llm/src/message.ts#SystemMessage"],"sources":["packages/llm/llm/src/message.ts:176"]},
{"digest":"05205074b24d8340cfd7995f6cb64779c7f1241490954700115601e264178877","names":[],"sources":[]},
{"digest":"058fc9a6b4fbd5d43437c3a64170002070dfc98e18d87de294b564ae446ca8ae","names":["packages/subagent/subagent/src/catalog.ts#SubagentCatalogEvent"],"sources":["packages/subagent/subagent/src/catalog.ts:32"]},
{"digest":"05a2796621b1ee6c03ef7abe560b25116bb4da4d592312117242a78415a32b04","names":[],"sources":[]},
@@ -86,7 +86,6 @@
{"digest":"07e1a58c58b593f507b8e7f25723bb0aa42baae6e00f5ecfddf28cb1e64d3235","names":["packages/session/session-title/src/types.ts#SessionTitleModelIdentity","packages/subagent/tool-subagent/src/model-selection.ts#AllowedModelRoute"],"sources":["packages/session/session-title/src/types.ts:20","packages/subagent/tool-subagent/src/model-selection.ts:12"]},
{"digest":"07eccc9ea2f9b5439d76cc77d5e062936677d43f07a23da749819b0a22ee36b7","names":[],"sources":[]},
{"digest":"09655b34d7f3cf1e9005974de2357de2d4a60deea165d16dac1eadaa6ec539a8","names":[],"sources":[]},
{"digest":"09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363","names":["packages/llm/llm/src/message.ts#SystemMessage"],"sources":["packages/llm/llm/src/message.ts:150"]},
{"digest":"0a30c3be336cdd4f8f34e66543a3d46d611c43986edd9b3ce6cbb9b721d3b5d3","names":[],"sources":["packages/core/session/src/types.ts:213"]},
{"digest":"0a8a062bc9c3c0d97fd97742262f2ea53dd32297f834e81114870d38ac3dc6da","names":[],"sources":[]},
{"digest":"0a92c5bdfa06c2e2615b777728f3aa95f408d43b9012e7b754568311251db623","names":[],"sources":["packages/experimental/liveshare/src/host/viewer-principal.ts:29"]},
@@ -109,10 +108,10 @@
{"digest":"0fe52387f65052702ed9d7cd59db826468936595d1b3eec207e7a823adc719db","names":[],"sources":[]},
{"digest":"1033093edd0db80ff410e00830b523405e00bb0c7684948e531ff65095799625","names":[],"sources":[]},
{"digest":"10e386801903f9d424602c31d3ff837a94aef623c8b391376d8d9e253525fabe","names":[],"sources":[]},
{"digest":"1127571148780ee147ee31292fb43e0637b8e035e88f8759036458dfaae06545","names":[],"sources":[]},
{"digest":"11638dc58a31496fb6706ced3e23e3a2db1f3b2a8845968c810827a72b5fc811","names":[],"sources":[]},
{"digest":"119abe2b9c0b2f46ecb31d82b9acba4d4b30e049f655e2475e8b4ae12d5a9e25","names":[],"sources":["packages/experimental/hook-protocol/src/types.ts:19"]},
{"digest":"11f70b595aa76897fc4e25a352bfa718c659f44b799e5aa14e84e5a38fe72912","names":[],"sources":["packages/interaction/user-approval/src/index.ts:41"]},
{"digest":"120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499","names":["packages/llm/llm/src/message.ts#UserMessage"],"sources":["packages/llm/llm/src/message.ts:161"]},
{"digest":"124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3","names":[],"sources":[]},
{"digest":"12a0cfa619ac4a5fc6c3e8e359c8dae15769edc61497a575935c78d5842f8e42","names":[],"sources":[]},
{"digest":"12d5808fac1996b9b3c2afa806e03022252ba2d7b88f835862ae1896591f60c7","names":["packages/llm/llm/src/types.ts#ImageBlock"],"sources":["packages/llm/llm/src/types.ts:86"]},
@@ -128,7 +127,7 @@
{"digest":"15d5dfdd822aa35e115afd74a8982825a493880457774e6850bc1520b50875e4","names":[],"sources":[]},
{"digest":"16d0507cb94b4cfc84a87446b1ba7652d6ec1d65ee1684789e747e30d542800e","names":[],"sources":[]},
{"digest":"17aae616ef020b8b9f011ec398ec935450fb06d3e2a0722c456f63aeaf5ff728","names":[],"sources":[]},
{"digest":"17d1afb770d9941936130996da00dc86782cfef731d8d6526162c301256a4ac3","names":[],"sources":["packages/core/session/src/types.ts:439"]},
{"digest":"17d1afb770d9941936130996da00dc86782cfef731d8d6526162c301256a4ac3","names":[],"sources":["packages/core/session/src/types.ts:436"]},
{"digest":"18dc21f12bbac8ade8377e6fbb54179e20c3d955d73fba3244c57fb6bf001df0","names":["packages/schedule/schedule/src/types.ts#ScheduleDeleteChange"],"sources":["packages/schedule/schedule/src/types.ts:206"]},
{"digest":"18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f","names":["packages/session/session-persistence-jsonl/src/format.ts#HeaderLine"],"sources":["packages/session/session-persistence-jsonl/src/format.ts:83"]},
{"digest":"18fcdd273a2f2f9d813a3be5e71df5903a963a5c88e46b90b14de6e2db890da0","names":[],"sources":[]},
@@ -143,7 +142,7 @@
{"digest":"1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5","names":[],"sources":[]},
{"digest":"1c2686c0682e7bc51d61117b2652bd4a80707e331aa276d6ef915ae32534a330","names":[],"sources":[]},
{"digest":"1c5a58f4599bd4a9711712551ffe2442a5e5fcd0758bafe630cc4ead850bdaa7","names":[],"sources":[]},
{"digest":"1ccb56061942f5ccb0d30c9e4f2883b9d115ff906560029de637b61d3cde896d","names":[],"sources":["packages/core/session/src/types.ts:353"]},
{"digest":"1ccb56061942f5ccb0d30c9e4f2883b9d115ff906560029de637b61d3cde896d","names":[],"sources":["packages/core/session/src/types.ts:350"]},
{"digest":"1cde1bedde79c5e8a56aee9c05c8e0a579cf5bc611deb85b93fa331a16ca978f","names":["packages/compaction/compaction-image-offload/src/projection.ts#ImageOffloadTarget"],"sources":["packages/compaction/compaction-image-offload/src/projection.ts:9"]},
{"digest":"1d5f04a03ea75fc8eeece544129eba0f49f0c82046e9c404461920390135c7b2","names":[],"sources":[]},
{"digest":"1d76406cbb2ddadb0dbbb51e9d8bc6cf678fed455cf8eb512f36f7c86d37a62f","names":[],"sources":["packages/llm/llm/src/types.ts:164"]},
@@ -174,9 +173,9 @@
{"digest":"260523b412c19ad8c2bb00093b07f64245ff8ba6b2f76c5b545303772ac9704c","names":[],"sources":[]},
{"digest":"26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78","names":[],"sources":[]},
{"digest":"26c879bdd130e8b8683a6ce588414fad2244783d6573ca399fa0de184a2b0bb1","names":[],"sources":[]},
{"digest":"2719cd69e8ef5794adcb6ff3df522c33eff0b2677a122a0568d207a8e0147498","names":[],"sources":[]},
{"digest":"2765e9119edf5816ac1ab4c95c5ee32c90403f3742962eff11544f7752d59d2e","names":[],"sources":[]},
{"digest":"277b61f9c6f8170425fa6ffe06cfa14376757a896a4749cb82a687d7364c4fc9","names":[],"sources":[]},
{"digest":"27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44","names":[],"sources":["packages/core/session/src/types.ts:321"]},
{"digest":"287211846beea1eccb5f9acee00d20388a38fcb2e95858fa2332d6f58529379a","names":[],"sources":["packages/llm/llm/src/types.ts:165"]},
{"digest":"28936c614bd4e7e2774806edcbb3cbfd3ee643ac1cbf0bbdff43d915505a8fe3","names":[],"sources":[]},
{"digest":"290f32bfd81ff85a8095886a8066fae06e885942b63a8bcd6a8d66d328445808","names":[],"sources":[]},
@@ -202,8 +201,9 @@
{"digest":"326a9bfda27dda5882fb3cbe6e715df41dae2298fdae3d66437457268a665693","names":["packages/llm/llm/src/call-config.ts#LlmCallConfigAdapterDefaults"],"sources":["packages/llm/llm/src/call-config.ts:53"]},
{"digest":"3305a4bb6b6c29b482ba91d59c60b47e8f98282d3dacc8c29e4a4c2712209bdd","names":[],"sources":[]},
{"digest":"33341aac09312300de5a178e6cc6f6544a4876f7f710cfea55eda473c8d329ef","names":["packages/llm/llm/src/assistant-stream.ts#AssistantStreamRecord"],"sources":["packages/llm/llm/src/assistant-stream.ts:19"]},
{"digest":"335e242de1fcc17b6ca920fc420d71bec2d76e53e37955c00948b65ab77f05c5","names":["packages/core/session/src/types.ts#SurfaceOp"],"sources":["packages/core/session/src/types.ts:474"]},
{"digest":"335e242de1fcc17b6ca920fc420d71bec2d76e53e37955c00948b65ab77f05c5","names":["packages/core/session/src/types.ts#SurfaceOp"],"sources":["packages/core/session/src/types.ts:471"]},
{"digest":"347de3380f2da308d0c74e08821f9e85559f55af4c5010795b110d00f7fc9dbd","names":[],"sources":[]},
{"digest":"34af242cde26fe0e35bdfc469935d74c7548f009305eaf553c2b2ef4de2a8a85","names":[],"sources":["packages/core/session/src/types.ts:321"]},
{"digest":"34d1ab5c5df378186d6054b1a1beea9a41e41965d6f336f0bc0025c441a82e66","names":[],"sources":[]},
{"digest":"35203ba7ad5ef6f97d556b85df20ae98f04f09c65748cecdf8eefdb8b6405ffc","names":[],"sources":[]},
{"digest":"36d6a9a871d949ea4f3edd919d81d66aa69218bebef38899d2a1282c39420a1f","names":[],"sources":[]},
@@ -216,11 +216,9 @@
{"digest":"3860b4757d512a2869be833acb0faf834335b1b056bf3f83df5474dce95f8fa6","names":[],"sources":["packages/llm/llm/src/assistant-stream.ts:34"]},
{"digest":"390eed1028aba02774f14408647acec10ec5516e97d4f15ecde2b9989d5a69f2","names":["packages/feedback/message-feedback/src/types.ts#MessageFeedbackRating"],"sources":["packages/feedback/message-feedback/src/types.ts:17"]},
{"digest":"39cf2d3ff8bac81c62d49ac2ba38a095b18e80f3ad700819fa1f650a4e60197f","names":["packages/jobs/jobs/src/types.ts#JobToolCall"],"sources":["packages/jobs/jobs/src/types.ts:16"]},
{"digest":"3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a","names":[],"sources":[]},
{"digest":"3b04790e08b35241ffa0d38f6d7e4f8788aa921341f6c0d7574a329397c59408","names":[],"sources":[]},
{"digest":"3b1be838223869fe0a08210db85bf773796ed3f2373ac16555dff227cade0c48","names":[],"sources":[]},
{"digest":"3b4f2c9ef2c1217eac596c7b070173cb7896e2fae09e729bc7c56c801e56bb29","names":[],"sources":[]},
{"digest":"3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7","names":["packages/llm/llm/src/message.ts#DeveloperMessage"],"sources":["packages/llm/llm/src/message.ts:156"]},
{"digest":"3bc287e765d58dc3a22672a0495a6cfd561220dd38fbaecef80aa95b96caed79","names":[],"sources":[]},
{"digest":"3bd652ebfa8726b3ce3937a4f1bd2759e02f86b3a08a20f9e41a8513656fbc5f","names":["packages/core/session/src/types.ts#OptionalSessionSeq"],"sources":["packages/core/session/src/types.ts:66"]},
{"digest":"3bdb8dc6989655b0d4ec361edafb8e2629bc263e1ea591819414fdafc1a413b3","names":[],"sources":[]},
@@ -228,6 +226,7 @@
{"digest":"3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1","names":[],"sources":[]},
{"digest":"3c2535ca0a2062f172f15344f8040755002b5ac506cf94fc4ebaa822b15feb8c","names":[],"sources":[]},
{"digest":"3cfc3a56502da1f8c6153c2c56657bab4b749056968634dd0991d325ec1c919f","names":["packages/core/tools/src/contracts.ts#ToolRestriction"],"sources":["packages/core/tools/src/contracts.ts:395"]},
{"digest":"3d1339bcc98cb53714bf31ac4a6e7c9ce15a412dd58451778a383627367a4666","names":["packages/llm/llm/src/message.ts#SystemPromptMessageSource"],"sources":["packages/llm/llm/src/message.ts:54"]},
{"digest":"3d7d07060a7be77984feb651ea2bf1925d3e0477911d9d3ed86330d1e8ca6182","names":["packages/feedback/message-feedback/src/types.ts#MessageFeedbackItem"],"sources":["packages/feedback/message-feedback/src/types.ts:20"]},
{"digest":"3e0eff5946255ff05d88a10839c60305135801f97794ea48d409f8503303317e","names":[],"sources":[]},
{"digest":"3e2ece4967cfebe95f450a93f45523dff99d6749f6269f2f60f84dfecfcf3693","names":[],"sources":[]},
@@ -252,6 +251,7 @@
{"digest":"487b65c37bfedb8b72088c4107a0a90a6249701f6b26745f6d98f9b8a22b07c7","names":[],"sources":["packages/llm/llm/src/assistant-stream.ts:43"]},
{"digest":"48e5c9861f16ac07e78cb7b5ae9dabdf7bb85c58baed5a51b4ad275050ea58e3","names":[],"sources":[]},
{"digest":"48f9c19417a1abbedfa59f4667bba36b93ac2db407adf5e84cb3ba0de30942cb","names":[],"sources":[]},
{"digest":"4902846b72aabae5f4e20e8f518d7fbfd62f1fef44d180c56793e2edf2ef0903","names":[],"sources":[]},
{"digest":"4991dfc415c9efebc36fa6969e1798c7d2e42396cc1e6e0ac7d7c89c5c5c4aea","names":[],"sources":[]},
{"digest":"49dab019d00e8c26f27ad2ccff7b604d69e323ae4d17e0d2a7b6b8a830b1ade2","names":[],"sources":[]},
{"digest":"4a561c111a78d4520e850c93795369ea169ff86abd082aee86c8fd38121a65aa","names":[],"sources":[]},
@@ -259,7 +259,7 @@
{"digest":"4ae007ed190a72c92138b22d059b83208079c7551ca13fb59ae8cf5e23693964","names":[],"sources":[]},
{"digest":"4aed17ec726b5397c29f6cb4bcd7905dc1a12bb6140f1657f073cd24380f2af8","names":[],"sources":[]},
{"digest":"4b1e632e05776982a2d21c25a50c7c04c199d311c5675218fa73ff9fe30d22cd","names":["packages/schedule/schedule/src/types.ts#LegacyScheduleRecord"],"sources":["packages/schedule/schedule/src/types.ts:185"]},
{"digest":"4b259f7f8f0a44ad5e90b70a73553ced1df27012d126921d397ff403b6c86731","names":["packages/llm/llm/src/message.ts#ToolResultMessage"],"sources":["packages/llm/llm/src/message.ts:172"]},
{"digest":"4b259f7f8f0a44ad5e90b70a73553ced1df27012d126921d397ff403b6c86731","names":["packages/llm/llm/src/message.ts#ToolResultMessage"],"sources":["packages/llm/llm/src/message.ts:198"]},
{"digest":"4b7ddaf3710b88ff9b8df66304f5f97bf03688fd19730eedc2e9535203c820ea","names":[],"sources":[]},
{"digest":"4bb451330ff699f36b45539ceb0eb2606ead72084e2c5bb637c36cc80e2252db","names":[],"sources":["packages/core/session/src/types.ts:202"]},
{"digest":"4cd48f3e5108bd6ebedf7301c3638839b8b2b9db8dbd493974177fbdeb91a01b","names":["packages/api/session-controller/src/types.ts#SessionRequestId","packages/attachment/attachment/src/brand.ts#AttachmentId","packages/compaction/compaction/src/brand.ts#CompactionId","packages/core/session/src/types.ts#SessionId","packages/experimental/webhook/src/brand.ts#WebhookDeliveryId","packages/experimental/webhook/src/brand.ts#WebhookRuleId","packages/experimental/webhook/src/brand.ts#WebhookSourceId","packages/feedback/message-feedback/src/types.ts#MessageFeedbackVersion","packages/goal/goal/src/types.ts#GoalId","packages/interaction/commands/src/brand.ts#CommandId","packages/interaction/user-approval/src/types.ts#ApprovalRequestId","packages/jobs/jobs/src/brand.ts#JobId","packages/llm/llm-retry/src/brand.ts#RetryId","packages/llm/llm/src/brand.ts#MessageId","packages/llm/llm/src/brand.ts#ProviderRequestId","packages/llm/llm/src/brand.ts#ReasoningEffortId","packages/llm/llm/src/brand.ts#ToolCallId","packages/schedule/schedule/src/types.ts#ScheduleId","packages/session/session-title/src/types.ts#SessionTitleProviderId","packages/team/agent-team/src/types.ts#TeamId","packages/team/agent-team/src/types.ts#TeamMessageId","packages/team/agent-team/src/types.ts#TeamTaskId","packages/workflow/workflow/src/types.ts#WorkflowRunId"],"sources":["packages/api/session-controller/src/types.ts:383","packages/attachment/attachment/src/brand.ts:6","packages/compaction/compaction/src/brand.ts:4","packages/core/session/src/types.ts:21","packages/experimental/webhook/src/brand.ts:12","packages/experimental/webhook/src/brand.ts:6","packages/experimental/webhook/src/brand.ts:9","packages/feedback/message-feedback/src/types.ts:14","packages/goal/goal/src/types.ts:17","packages/interaction/commands/src/brand.ts:22","packages/interaction/user-approval/src/types.ts:17","packages/jobs/jobs/src/brand.ts:9","packages/llm/llm-retry/src/brand.ts:4","packages/llm/llm/src/brand.ts:16","packages/llm/llm/src/brand.ts:31","packages/llm/llm/src/brand.ts:43","packages/llm/llm/src/brand.ts:67","packages/schedule/schedule/src/types.ts:14","packages/session/session-title/src/types.ts:17","packages/team/agent-team/src/types.ts:20","packages/team/agent-team/src/types.ts:32","packages/team/agent-team/src/types.ts:8","packages/workflow/workflow/src/types.ts:14"]},
@@ -277,12 +277,10 @@
{"digest":"525254db03b1d1e6b74cf55aced52817568331ac1f96c0818728910b6692e336","names":[],"sources":[]},
{"digest":"529e0ccd0e34079ab4ff21ed87f810cee0388246263bf22e8aba5986b56fae05","names":[],"sources":["packages/util/values/src/index.ts:4"]},
{"digest":"52c6113cb0e53f345324bf84f01928bea5d5df57ee80bc0dd65407b8bc5a3734","names":[],"sources":[]},
{"digest":"5302e763151277614b97e77f00e3b326694c6c1247b916a20503c344dc970777","names":[],"sources":["packages/core/session/src/types.ts:387"]},
{"digest":"5302e763151277614b97e77f00e3b326694c6c1247b916a20503c344dc970777","names":[],"sources":["packages/core/session/src/types.ts:384"]},
{"digest":"530da6c0267813bb4511af72883cc518834e624e3b3220a7062955fd57a788a6","names":["packages/core/session/src/types.ts#RequestHeaderReason"],"sources":["packages/core/session/src/types.ts:283"]},
{"digest":"53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e","names":[],"sources":[]},
{"digest":"53cf1704ae0709c7678bcf070c83c619fc48ca1b5c173b74cfa8702f22a8e492","names":[],"sources":[]},
{"digest":"54f9276a1617d7c12594722c89cfe864bcbe4517e9a6f9c98bab14f199a135e0","names":[],"sources":["packages/core/session/src/types.ts:367"]},
{"digest":"5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb","names":[],"sources":[]},
{"digest":"54f9276a1617d7c12594722c89cfe864bcbe4517e9a6f9c98bab14f199a135e0","names":[],"sources":["packages/core/session/src/types.ts:364"]},
{"digest":"557e148d30b79ee48645850832b30c717d7c3b64641deb5d6133b8b4e91ee0b8","names":[],"sources":[]},
{"digest":"5654685d7557ec747e74887237065e626a5bdfa426ca43f7fbb0b6fee9b0916c","names":[],"sources":[]},
{"digest":"56b7c047694875a843ba020dfea3c8380d54ae4ff88ab349e72004dc21e07c23","names":[],"sources":["packages/core/session/src/types.ts:231"]},
@@ -298,6 +296,7 @@
{"digest":"5abab3a27fd2736660ecddd94b28d6bbf114986dd894880153bd1be3ccacb563","names":[],"sources":[]},
{"digest":"5b232a9b9bfcc0fc6794dab7865bcf203a65785c5de5aa647a51228bff628413","names":[],"sources":[]},
{"digest":"5b6fb1f226ff56402db08a6aae82af76100b14056271875f69ec526a1ae05d51","names":[],"sources":["packages/interaction/commands/src/types.ts:112"]},
{"digest":"5b7abd24d8a133e7d43f7d8a5824e841233f57ddd2288d9923d3443ffa245e16","names":["packages/llm/llm/src/message.ts#SystemPromptSectionState"],"sources":["packages/llm/llm/src/message.ts:34"]},
{"digest":"5bb69b88517f6214f2af4d1a6d2b771e271ad3ad695cc9c2c272069ae698c9bc","names":[],"sources":[]},
{"digest":"5bc66269cfaf614c0ecda8ecb469f23101a7609793fc2b693ac23c4aecdb575e","names":[],"sources":[]},
{"digest":"5bd310104cfe448e530beb11422d2f791e2e32e8e95fdc528a15f9ca693dae75","names":[],"sources":[]},
@@ -308,7 +307,6 @@
{"digest":"5d17f27a1ef9f7026c0232714adf7573961536d75f3303ca97973975f5af170e","names":[],"sources":[]},
{"digest":"5d542ac7bdf13310c46e1a884dec9fb18ad8c6e153cff207e639cd7bf9d7e694","names":[],"sources":[]},
{"digest":"5d7a64ed6aac5551ebf998dc25e1e7b48a144769913f89702840180e61dc3995","names":[],"sources":[]},
{"digest":"5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260","names":[],"sources":[]},
{"digest":"5dd766ccd1702a1142ad8b4bd44f2242f8e8a6752669ad3de0a5d224329b1438","names":[],"sources":["packages/compaction/compaction/src/types.ts:82"]},
{"digest":"5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e","names":[],"sources":[]},
{"digest":"5ebce1317eacd2c148456627a09668e927ee15c204f0643f5ea76b46b54a2647","names":[],"sources":[]},
@@ -326,7 +324,6 @@
{"digest":"63ba8895cc09e4693cf0819fdcd18c084bef195febda5b6a23af279b3852be36","names":[],"sources":[]},
{"digest":"6487b10ba7542f3c447b1e41a1c6a590b7bfafe0b9b66b49f34028da85bb970f","names":["packages/subagent/subagent/src/descriptor.ts#ContinuableSubagentDescriptorData"],"sources":["packages/subagent/subagent/src/descriptor.ts:72"]},
{"digest":"6598cd6da253948d6b207c6374a45335804c79b576866d6215649c2d1bc85e25","names":["packages/team/agent-team/src/types.ts#TeamMemberSnapshot"],"sources":["packages/team/agent-team/src/types.ts:50"]},
{"digest":"65a8400e451e667e5b6e34df72ceb81fca8c12330330fa72083ad40279b189ad","names":["packages/llm/llm/src/message.ts#SystemPromptMessageSource"],"sources":["packages/llm/llm/src/message.ts:34"]},
{"digest":"65d583e66518c5236015e0846470fb32efcf92375ed306aef14e50a9d2cd2099","names":["packages/skill/tool-skill/src/index.ts#SkillCatalogSource"],"sources":["packages/skill/tool-skill/src/index.ts:36"]},
{"digest":"66ba70f6f068da443f969a0b947a013c3addd776b9b60a0a393759c19825e9a2","names":["packages/llm/llm/src/types.ts#ToolSchema"],"sources":["packages/llm/llm/src/types.ts:517"]},
{"digest":"672c4aa2a9b736e3d6e5da6346d2e2ed5e3573f2d0baafa18e7407c9f3fee3db","names":["packages/skill/skill/src/index.ts#SkillInvocationSource"],"sources":["packages/skill/skill/src/index.ts:149"]},
@@ -334,16 +331,13 @@
{"digest":"68141cbe3994a5ffcd064c07c75996538437fd9dbf77ce8a2927e89ec577fabe","names":[],"sources":[]},
{"digest":"688e853dc149f0d30b31765c12ec7e3be74169bdf1a4c6463a10b945d50cc1b8","names":[],"sources":[]},
{"digest":"68f44f59e91c41395076cb77265981a601680ec8a381bbbeb6ab754ffdc94573","names":[],"sources":[]},
{"digest":"69081694be231d56fd9580ba14645fd5e35373202605d5c5c841a9435b5fa3b1","names":[],"sources":[]},
{"digest":"693f4952fb5565da96c06bace8924b098ac2fbc915fde0ff8019701183abc057","names":[],"sources":["packages/llm/llm/src/types.ts:168"]},
{"digest":"69d238a6e9b08d67f601b1825962963d8d3523cb69ebf6208c697dc5d058c199","names":[],"sources":[]},
{"digest":"6ab45ac76839722df912f3ba50f1c6b41f2d614bde11f1aabfae04117ccdc80d","names":[],"sources":[]},
{"digest":"6b23ed9ce1b397e602788dbe033693bf97642a69e23fcab1cc45bf6f13b6d619","names":[],"sources":[]},
{"digest":"6ba7edb6447b6a3e7947dddf5e4116c1526000c4e62882a6d65edc67ba797c2c","names":[],"sources":[]},
{"digest":"6bbe793f6a93dc8d50a4d4d3fbb6f8ed15650bcb7e151d28669628f7b7c3fc25","names":["packages/goal/goal/src/types.ts#GoalSnapshot"],"sources":["packages/goal/goal/src/types.ts:60"]},
{"digest":"6bc8e51124d0874bc89e1d0ceff381a9c3cd0fc240667d69f841ce4f60f65fe5","names":[],"sources":["packages/core/session/src/types.ts:342"]},
{"digest":"6c03546143cdf6ae88f1745ac98c5139efa1588d1415249bbc5f3104d32ab800","names":[],"sources":["packages/core/session/src/types.ts:200"]},
{"digest":"6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85","names":[],"sources":[]},
{"digest":"6c1cccb433ddc153facb380c7dda956237ba5c31f8a532a69142dc277890cc9b","names":[],"sources":[]},
{"digest":"6c5a37d42ebdb12db4410699259335f1e149e3a0260425684c00b153afc8990d","names":[],"sources":["packages/core/session/src/types.ts:201"]},
{"digest":"6ccb6bc423fb3952458abf9c1b1c3284208b7e660344b612cc55da773d61afe4","names":[],"sources":[]},
@@ -369,8 +363,10 @@
{"digest":"756b5e23a5cb2c7f486f366a828f7461c88902af21125bd6810881f4ccbff6cc","names":[],"sources":[]},
{"digest":"7624ca28c61ca0eaa4f015140f3cea6e0c16cce2f2960fab5f531203d253903e","names":[],"sources":[]},
{"digest":"763c8a20af487263a0080548274f7437ef4a86e0ba8769127d1ced10a72c664d","names":[],"sources":[]},
{"digest":"7645031a0886c6fb99b759d13b08a52ceb55d37b853173213fbf87b240fb0088","names":["packages/llm/llm/src/message.ts#DeveloperMessage"],"sources":["packages/llm/llm/src/message.ts:182"]},
{"digest":"76632533f67879dcb346fcae640540dbc89b2472b0bce88c59f7e48fc5c0e668","names":[],"sources":[]},
{"digest":"78a9be340090b735a39980e7222ce730c972fbcf1de7c9e0aef2125884b7caee","names":[],"sources":[]},
{"digest":"792eb6cb1f6bed8331e25d90ebd3b84a5c2c3f0f346ac5f64c4fb1d077eb463b","names":[],"sources":[]},
{"digest":"79650cfa10aa3c52440328d85e8a25f0ffadc8d7efd784e3c0819d8bb74a1985","names":[],"sources":["packages/core/session/src/types.ts:222"]},
{"digest":"79ddc907312f97cf9553d4841e8b3fc937097bd8d97900a790efad3c05255e99","names":[],"sources":["packages/todo/tool-todo/src/types.ts:33"]},
{"digest":"7a651f3b672c52fb615f22c0ce9cb3cc5b22aad92e6bbeefb0808fd7b9233a50","names":[],"sources":[]},
@@ -378,7 +374,6 @@
{"digest":"7b1ce60193fa8b69292e5843858d9cee7dc565dcb40d33c136e5d7e8b8d4296a","names":[],"sources":[]},
{"digest":"7c6129b6961cf4b2a030f36c78d2b0a5be38617651a9b81322e054ee512bee06","names":["packages/feedback/message-feedback/src/types.ts#MessageFeedbackDelete"],"sources":["packages/feedback/message-feedback/src/types.ts:46"]},
{"digest":"7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397","names":[],"sources":[]},
{"digest":"7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b","names":["packages/llm/llm/src/message.ts#MessageSource"],"sources":["packages/llm/llm/src/message.ts:135"]},
{"digest":"7d226b9fd95b4ba213d4237c22e930a91c3c769c95ca7f92977b9d625ba13438","names":["packages/goal/goal/src/domain.ts#GoalChangeMeta"],"sources":["packages/goal/goal/src/domain.ts:44"]},
{"digest":"7d54a5a5e629e2e7783bfac72683bcc5e969e9f43426b9289826aaf294ff6344","names":["packages/feedback/command-feedback/src/types.ts#FeedbackRecord"],"sources":["packages/feedback/command-feedback/src/types.ts:27"]},
{"digest":"7d65acf0a3a43a8f445ce5d3320b42eca492739fc931b2a7516bfb8368dc2c68","names":["packages/llm/llm/src/types.ts#ContentBlockType"],"sources":["packages/llm/llm/src/types.ts:155"]},
@@ -412,7 +407,7 @@
{"digest":"8620189c8e33582708ece48fd2d20dc4d57912486a17bdbb9aea4c44f7018062","names":[],"sources":[]},
{"digest":"866f7b2dbdc5b421eab3e629312d1c839b75c259633b4b43b50d23bac44d92a0","names":[],"sources":[]},
{"digest":"86d1d0e9cfebb240421187e3dc37fb71cc38a1501885cf32f8f9adef7b0a2bde","names":["packages/subagent/subagent/src/descriptor.ts#SubagentDescriptorData"],"sources":["packages/subagent/subagent/src/descriptor.ts:89"]},
{"digest":"86e1e384495ee09ac2d60c9db3610f1f1fddac2d248f6f1d6000e78054680219","names":["packages/llm/llm/src/message.ts#ContextSnapshotSection"],"sources":["packages/llm/llm/src/message.ts:69"]},
{"digest":"86e1e384495ee09ac2d60c9db3610f1f1fddac2d248f6f1d6000e78054680219","names":["packages/llm/llm/src/message.ts#ContextSnapshotSection"],"sources":["packages/llm/llm/src/message.ts:95"]},
{"digest":"871bfd6f7bb91061246768d3377f3fd58d6b8ea7c31f44c714ae7ab215650d62","names":[],"sources":[]},
{"digest":"87b1a33564b9a4d63b00988a524c12259243953aebb9c9a05127d87b27464df9","names":[],"sources":[]},
{"digest":"88841202942c7683b3b7e5ea6a796047ec326b6701ac23e58cc236d85613b9fa","names":[],"sources":[]},
@@ -426,7 +421,7 @@
{"digest":"8c1c4f72755a78ea163523a46565316e36e9b644382eb48e6635c71a6f412dd2","names":[],"sources":[]},
{"digest":"8c627d7a45fa406cea879a3922105e27ed4c3c7966e264afaf11ea7a330f2dd1","names":[],"sources":[]},
{"digest":"8cdd3fdd295cee53035de16a1b23411716f75e9f994fe9510cac5d7fef605c76","names":[],"sources":[]},
{"digest":"8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69","names":["packages/session/session-title-llm/src/index.ts#SessionTitleLlmRequestEventData"],"sources":["packages/session/session-title-llm/src/index.ts:43"]},
{"digest":"8decd4949d9ee4adccbe0b436abac75d5bf1a9bced2fd142866bdc5ff122833d","names":[],"sources":[]},
{"digest":"8e31bb958e9b015e6f8407eaade32217068159e816f3cc99c3ad76eb889732e0","names":[],"sources":["packages/llm/llm/src/types.ts:167"]},
{"digest":"8e611bf46821e5003a1605a73560a6f56388295149d449dfe2142d5ec335f29c","names":["packages/llm/llm/src/types.ts#ToolAdditionBlock"],"sources":["packages/llm/llm/src/types.ts:122"]},
{"digest":"8e8155594e07812356b67d732196dda894b0f9c91a5969d51612cf490b0a016d","names":[],"sources":[]},
@@ -435,8 +430,10 @@
{"digest":"8f324cea3916c0517261e88167def8efb3a9994c1135e23d40ed9fd48f8c7bd4","names":[],"sources":[]},
{"digest":"8f6d609794bf5afc01d7ccf3e03811d32f4b8047f58a2c9a98db0154c2ad7cb9","names":[],"sources":[]},
{"digest":"8faed5b52ab2d2df40b94a926d0f0faa75280bddcc4b17b6bdd9c8bfed7c34b5","names":[],"sources":[]},
{"digest":"8fc8f70451996be0a0d33a548f23562ccb258fd7fed18c8e51b380e8d6777950","names":[],"sources":[]},
{"digest":"8fcb0b44a575e998665c053643d1ab04c82f39253ebd190ac0c975b78e40b543","names":[],"sources":["packages/core/tools/src/index.ts:28"]},
{"digest":"904bf499d98be4a3a5f836fcac533b6c4899569b018071e6604e1d32657d00fd","names":[],"sources":[]},
{"digest":"91b36ec2f96baa3ac3052fde19e712ffad812b6ca69036ffdde068bc7ab5eac0","names":[],"sources":["packages/core/agent/src/types.ts:110"]},
{"digest":"920d87e22b7409bcc7224f8b1dc7f5101c33574c75627c65baab12b85cc96e75","names":[],"sources":[]},
{"digest":"930c1cd289def119d443e19dd90008916bf035f0a4d23e07241e7f050f2b89b7","names":["packages/interaction/user-approval/src/types.ts#ApprovalOutcome"],"sources":["packages/interaction/user-approval/src/types.ts:32"]},
{"digest":"935c8d486292b13c87b57ca280eb8c58b5b2f5239be86fcd4334c33fdeb87682","names":[],"sources":[]},
@@ -464,6 +461,7 @@
{"digest":"9acbe713f3f641921dd3333b240aa72e176d795327c24e8d9db9b68b16771b49","names":[],"sources":[]},
{"digest":"9b4fd974c124c83743efe030ba4e1250e087505f3f74588716a521fb8d453267","names":[],"sources":[]},
{"digest":"9c001ecb5e1d3c3894410db2a1e383842e5f8454fb52182338686158abc1b3ee","names":[],"sources":["packages/web/web-search-deepseek/src/provider.ts:62"]},
{"digest":"9c75043166543713427121c82ed73cec6edbeeaf94e35e3ef5055d52197b57d8","names":["packages/llm/llm/src/message.ts#MessageSource"],"sources":["packages/llm/llm/src/message.ts:161"]},
{"digest":"9d80129e13edfb6feb03ed327e6085c6ef60b97ad074244b2f5fd4667424a6a4","names":[],"sources":[]},
{"digest":"9e07693fd7cd9babe0688c22c986e4d519ae1c0e40eeea13b2dc583bed2abc86","names":[],"sources":[]},
{"digest":"9e2c06d8653585b33d72d5c1a80da79c8a24a88c284409bca15cc0f0ead5ebfb","names":[],"sources":[]},
@@ -484,6 +482,7 @@
{"digest":"a3a259a1aa5401af786ce08c4a8419681d3000d73467991b5fc563389bc4ebd2","names":[],"sources":[]},
{"digest":"a3c6f1ea38e9a61d7a9706057ba65aabe02dfe6d9dd90d4736aa62325d874531","names":[],"sources":[]},
{"digest":"a3edd1efd1fef21b72c55e213c8a8b24196b091abde2b89db52be0b2aaae3cfa","names":[],"sources":[]},
{"digest":"a408aa610f991ff3c5a60164145c756e551c38ef5c8faf136920738077fea7a7","names":[],"sources":[]},
{"digest":"a43327a1739c3fa477f32981071fef7d8ba6ae5f32a84fd70f547b2eee59e93e","names":[],"sources":[]},
{"digest":"a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302","names":[],"sources":["packages/api/session-controller/src/types.ts:392"]},
{"digest":"a6567ccb2e530606b775371eb4fa31468d72084339968e8b0440a516a23b39dc","names":[],"sources":[]},
@@ -491,7 +490,7 @@
{"digest":"a6da9ad5d42ae83a6833a8288b076688e8e0801633ea36cbdd8a30a6d9f3160c","names":["packages/workflow/tool-workflow/src/types.ts#ToolWorkflowRunStartData"],"sources":["packages/workflow/tool-workflow/src/types.ts:14"]},
{"digest":"a720757f704a2512e9d2f20da4a093e582472176236a75ab8b8eb7aaff17d85a","names":[],"sources":[]},
{"digest":"a7cf43ce7c2a4c038feed1885cd7a00d5c6ee2d90a7e0d56b46f78a3e1ca327f","names":[],"sources":[]},
{"digest":"a81059ca06999da1e712414520c2c65e491d052fcf9640fae20aa38f0a5dc735","names":[],"sources":["packages/core/session/src/types.ts:395","packages/core/tool-executor-ptc/src/types.ts:27"]},
{"digest":"a81059ca06999da1e712414520c2c65e491d052fcf9640fae20aa38f0a5dc735","names":[],"sources":["packages/core/session/src/types.ts:392","packages/core/tool-executor-ptc/src/types.ts:27"]},
{"digest":"a853902cfab417b8f08aa51ad6855fea46f34ed4588a74e47403035111d0fb86","names":[],"sources":["packages/interaction/commands/src/types.ts:105"]},
{"digest":"a8a2b9011fc067862df7ce40748868467e5778283d7ac193c13f77684a914c57","names":[],"sources":[]},
{"digest":"a9059a81430b320792bbb7c2ee1f8f6c77ff71e40ee44c18aec72e157c522694","names":[],"sources":[]},
@@ -508,11 +507,11 @@
{"digest":"ab7ec5f9eb2c6dfacca5da4c37cf7ba85d04172053ee6b1ebf1709ffcd99c1a7","names":[],"sources":["packages/core/session/src/types.ts:224","packages/llm/llm/src/types.ts:166"]},
{"digest":"aba175fb20ffc71112c55efe70458ff5d7dbfb83501892b4ba8d077f0ea5d7ba","names":[],"sources":[]},
{"digest":"abd6ca62a5ab166553848324a23fef90eed7f59c8021bd63e7ea5bc6fd666b0c","names":["packages/web/web-search-deepseek/src/provider.ts#DeepSeekSearchLlmRequest"],"sources":["packages/web/web-search-deepseek/src/provider.ts:56"]},
{"digest":"ad0c38a0adb82a94c925456df41586d9b5f9202fca18593eae2213d4445b4585","names":[],"sources":["packages/core/session/src/types.ts:402"]},
{"digest":"ad0c38a0adb82a94c925456df41586d9b5f9202fca18593eae2213d4445b4585","names":[],"sources":["packages/core/session/src/types.ts:399"]},
{"digest":"ad22a5ca5bbaab2e1440779cd3648e85ddfc6f73b5207394eda699555cf31430","names":[],"sources":[]},
{"digest":"ad3b56aa2fc1ad4250e7399295d34a8eae592e1907e85852e2291b2e498a30bc","names":[],"sources":[]},
{"digest":"ad92f473a03ae72599ff26c86e897c25e16269519ad2a87340f0bea946517af8","names":[],"sources":[]},
{"digest":"ada310bf0bdb8fed51f3b56ea63f6ea6b18bbd587f04fccb63a14ab0b2a24e05","names":["packages/interaction/commands/src/types.ts#CommandSource"],"sources":["packages/core/session/src/types.ts:199","packages/interaction/commands/src/types.ts:75","packages/interaction/commands/src/types.ts:79","packages/llm/llm/src/message.ts:110","packages/session/session-title/src/types.ts:35"]},
{"digest":"ada310bf0bdb8fed51f3b56ea63f6ea6b18bbd587f04fccb63a14ab0b2a24e05","names":["packages/interaction/commands/src/types.ts#CommandSource"],"sources":["packages/core/session/src/types.ts:199","packages/interaction/commands/src/types.ts:75","packages/interaction/commands/src/types.ts:79","packages/llm/llm/src/message.ts:136","packages/session/session-title/src/types.ts:35"]},
{"digest":"ade057f4fdc387aec6426f48704a1f9359cfc6fee13f27735b07f9b215ec16ca","names":[],"sources":[]},
{"digest":"ae63d9d1080ed8945031594d93f8d96651d7101b848719cc3e1475875cd3d649","names":[],"sources":[]},
{"digest":"aec150797b655c5f15ebb7a501454b0c208fbaccec9ace49d7de2171fc02f47d","names":[],"sources":[]},
@@ -566,8 +565,9 @@
{"digest":"bb94f3217aa56c8876bbff0b8460d6a73cbead545659abb29e76cd0cf2cb92d6","names":[],"sources":[]},
{"digest":"bbc5696e3f13c758237b316e3cf08cda0b9fd51ffe672539883457769faa185d","names":[],"sources":[]},
{"digest":"bca0f9cb63d8620b6954bb045b07bb07cb557513a7f0e2e177f5e87f704e7ba7","names":[],"sources":[]},
{"digest":"bcf0caf62d964b2fcf5404bd5c909cfa9a21c3f3c96e6b7e36d9e33565223825","names":[],"sources":["packages/core/session/src/types.ts:476"]},
{"digest":"bcf0caf62d964b2fcf5404bd5c909cfa9a21c3f3c96e6b7e36d9e33565223825","names":[],"sources":["packages/core/session/src/types.ts:473"]},
{"digest":"bd499eac047efe091a4df7382eadd06d25cf0cb31fee3981e8b24d85762841cd","names":[],"sources":[]},
{"digest":"be53b443539d32c2c7247e137da830a5cec2dda18dccaaf1db6e3e72d55c4deb","names":[],"sources":[]},
{"digest":"bf16d2e98a7f13894ded2cffe5ce857bf473954a0e3c0ed9bc7739e2e1c7b78a","names":[],"sources":[]},
{"digest":"c0ea97bc89dfc46fa94eab956f5c3ee6af2f964aa7db6327cb18b451f207bef7","names":["packages/workflow/tool-workflow/src/types.ts#ToolWorkflowAgentEndData"],"sources":["packages/workflow/tool-workflow/src/types.ts:29"]},
{"digest":"c170da8ab7c37635b10867b2571811d9e317ac3ec394e8ff8efe53f902fc41c1","names":["packages/llm/llm-retry/src/types.ts#LlmRetryEventData"],"sources":["packages/llm/llm-retry/src/types.ts:16"]},
@@ -578,6 +578,7 @@
{"digest":"c2deb7c9183735d4e0fffddf5c623f4e34daa1c8e96b111982e957dfcbbcf896","names":["packages/workflow/workflow/src/types.ts#WorkflowAgentOutcome"],"sources":["packages/workflow/workflow/src/types.ts:116"]},
{"digest":"c2f49004d9ae38a964e80850c87bc6849d6a872091a1d43e99eedf00c641e2a3","names":[],"sources":[]},
{"digest":"c43b119ce579b3e9983a0d3adc4ba402ebb9ba773d89738a2dab01ecf5813943","names":[],"sources":[]},
{"digest":"c460ea99c4124f01e9893c8febbcbd783cadb2d5b11f073ddcd8a9d7e5bf545d","names":[],"sources":["packages/core/session/src/types.ts:339"]},
{"digest":"c5228b7a55498d84f529591744a0ab26e0b93ade18a70a26db1377a1ecfa6b49","names":[],"sources":[]},
{"digest":"c55827fba7018198772c50e37cb7d3f60a3d8bb6e94b07de72dee0d9f8968005","names":[],"sources":["packages/interaction/user-questions/src/types.ts:134"]},
{"digest":"c5687b1313206a6ff334066047b6a0681611467dc4df8c5a8e71d0b6df39311f","names":[],"sources":[]},
@@ -596,6 +597,7 @@
{"digest":"cda2345a9be9d139df49ccbd16dcba716f3440178bf20ff8b801fda1f5eb77dc","names":[],"sources":[]},
{"digest":"cdca80b8dad24d4e7b1d5a288a8475ba8d8d46be385bd2da85f122ee836f1670","names":[],"sources":[]},
{"digest":"cdee10e87dbed8440d8b6935888624884878efc7af95402e94171b29f173dced","names":[],"sources":["packages/llm/llm-retry/src/types.ts:17"]},
{"digest":"ce9404e050df94628d8c18d9dbae6e26503a072a7a3ddcff0a43e87f0ec8b6f4","names":[],"sources":[]},
{"digest":"cef171adf021a1867d244618a3dbbaafc22beb17c7f3df3ee203393271c8c6f6","names":["packages/core/tool-executor-ptc/src/types.ts#PtcDispatchEventData"],"sources":["packages/core/tool-executor-ptc/src/types.ts:21"]},
{"digest":"cffcdc19881ab61ec0a9ce18743996f7ac44ac8889f34dfac36ae745574aa22f","names":["packages/goal/goal/src/domain.ts#GoalClearChangeMeta"],"sources":["packages/goal/goal/src/domain.ts:35"]},
{"digest":"d0fbb0ca1bbba059830826f33f801da1aced35a2504376d61e020bdfec8d50c0","names":[],"sources":[]},
@@ -608,8 +610,6 @@
{"digest":"d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9","names":[],"sources":[]},
{"digest":"d66e11dddf5dfa3c71547e2cbd7b0608824cd8d6243fc16f532017ff28e8fba5","names":[],"sources":[]},
{"digest":"d6e654b88b584fcdf290a56802b1730bc7b9847ae86baa4265ab7769eb48990c","names":[],"sources":[]},
{"digest":"d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7","names":["packages/llm/llm/src/message.ts#Message"],"sources":["packages/llm/llm/src/message.ts:195"]},
{"digest":"d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4","names":[],"sources":["packages/core/agent/src/types.ts:110"]},
{"digest":"d85590a5675c6e2fd8164e5792a6cceac714605b8ac228adae5ee668facb1490","names":[],"sources":[]},
{"digest":"d8a476d2c6fd30df6ec0e799f91716d1518c780d23b4121dce545abfcfb7c5a5","names":[],"sources":[]},
{"digest":"d9196086e41e4dd5c2ce87f5c25529c8112a1731d258cf0728747d41a9ee3241","names":[],"sources":[]},
@@ -617,6 +617,7 @@
{"digest":"d9edf1862e4471d6ad8a106a3f4160e0643874368707d50ecd8e27e5ee7a2567","names":[],"sources":[]},
{"digest":"da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582","names":[],"sources":["packages/session/working-directory/src/index.ts:62","packages/session/working-directory/src/index.ts:67"]},
{"digest":"dacf3d5f3e4ff619c1320e64a48dec5e7ecd7870bece65fbd449a0e63adfa521","names":[],"sources":[]},
{"digest":"daffe1e8caaeaf76a68171c697341eb8c6d93121e6f4c50aa0389f5e811fef9d","names":["packages/llm/llm/src/message.ts#UserMessage"],"sources":["packages/llm/llm/src/message.ts:187"]},
{"digest":"db06ef35b27a38425046b2228fa6bce9582abe140d781d363137eb2f4d233a1c","names":[],"sources":[]},
{"digest":"db6c5246911d47a7969f6b4cb47c7d0dbbde75c402710b22ace3672fa97bebe0","names":[],"sources":[]},
{"digest":"db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965","names":[],"sources":[]},
@@ -646,7 +647,7 @@
{"digest":"e42b0f40b5d0b628c6e1c44a8fb9eda0780037a81959e1b93d2dfb47b46b0e87","names":[],"sources":[]},
{"digest":"e438a9d4fb883b3e4a8d9fc8913aa1550ed50eb384bfbf943100a5605b537498","names":[],"sources":[]},
{"digest":"e481c46af3813e0010558e93f578b2986acd658404cec2d1679e3ac2a6c48654","names":[],"sources":["packages/core/session/src/types.ts:307"]},
{"digest":"e4c18e294232c3ba6c9f1999f168263cc55956147cfe4121720899be8e52edd1","names":[],"sources":["packages/core/session/src/types.ts:373"]},
{"digest":"e4c18e294232c3ba6c9f1999f168263cc55956147cfe4121720899be8e52edd1","names":[],"sources":["packages/core/session/src/types.ts:370"]},
{"digest":"e4cac694f8b6e1d52e48c699464f1c4c26111ef87e558f7931040d00fdc8d486","names":[],"sources":[]},
{"digest":"e5d3828df1ec3e2a66879de0659e0f4866d9cfffc00825ee731a66f8a0c03d98","names":[],"sources":[]},
{"digest":"e6063d0451dc02026fd9b54ad3f77c7b1b6392ad3e872a7737ac84e13ca72344","names":["packages/schedule/schedule/src/types.ts#EveryScheduleDispatchChange"],"sources":["packages/schedule/schedule/src/types.ts:220"]},
@@ -656,14 +657,17 @@
{"digest":"e7ce49f12953583fad217bf80fb9f1463acff2c3e9471a823782661675fb124c","names":[],"sources":[]},
{"digest":"e7e154d47d5fbc5366330fb4dade1f108c6dfe4335044d21ded14b7bf1dce084","names":[],"sources":[]},
{"digest":"e7e8f1318170b8284f16ab45a557afd4675c96071c0f2a456636481dab20b427","names":[],"sources":[]},
{"digest":"e7f07198d10adc34e5b4ecc079f4e267b9a135de4a4a457e929dd40602c3203e","names":["packages/llm/llm/src/message.ts#Message"],"sources":["packages/llm/llm/src/message.ts:221"]},
{"digest":"e7f4cbb3a57f4cbdb61ea41e95bcba626ad1fff6bb9b1e063b1d50a32da6e864","names":[],"sources":[]},
{"digest":"e8de0f457fed5b9ff94dc4950b59ef75fd8ba8af665cc7899485924a62653367","names":[],"sources":[]},
{"digest":"e90c7a2af8e7d05b9184c819ef8b84711c1821e862494ba701839bd2895fc888","names":["packages/session/session-title-llm/src/index.ts#SessionTitleLlmRequestEventData"],"sources":["packages/session/session-title-llm/src/index.ts:43"]},
{"digest":"e95f957154b2b1b58692af53d4131180b6dd19e2264869f876dbaa959991494e","names":[],"sources":[]},
{"digest":"ea08ec1df0c33108fd03345b9af199cf04dea450aa045d3c683f216311403403","names":[],"sources":["packages/team/agent-team/src/types.ts:183"]},
{"digest":"eaa71be0fbf0f702df8ea6c11d0aa2f9782263d45a10d0fb14eda662f4bfe04c","names":[],"sources":["packages/core/session/src/types.ts:205"]},
{"digest":"ebb768d85ec87fb68e42fc14fd7d8535b5ac11791b14d04c6770180f0a719bf8","names":[],"sources":[]},
{"digest":"ec38b5949af8eacaf00df002f4acbe344f934f8a061e9cdc65a52a48e5f6dd93","names":[],"sources":[]},
{"digest":"ec8b5ff7c77ca6893ac7ba5a0c5b2aefeb52f12c64450b7359660c2a7e8a53d7","names":[],"sources":["packages/core/session/src/types.ts:238"]},
{"digest":"ed3b0ee800e0ef9ab6ddd10cb18ac8ea2e866f624e599a5201ff7ddc74780c5d","names":[],"sources":[]},
{"digest":"edbbfff1128099fda7b792c56330d2cb04debc9790988e66d1c3f4026e813e0e","names":[],"sources":[]},
{"digest":"edd37b1e4974af648633014435572089b1e8fb71910468a0767a7e28fdd22abf","names":[],"sources":[]},
{"digest":"ee577a0cc18664c9daee50e9455153321155604f8f1817362f8f4a4b6fb9e1ad","names":[],"sources":[]},
@@ -696,8 +700,9 @@
{"digest":"f88f1b7b6bb733f685f5fb6a8744a5db9199fa53c90463ea1a33bad51153671d","names":[],"sources":[]},
{"digest":"f90eb4ab2d3897bc20c521a038e3119d581f791ec974b1a0004f63a8ab9e232d","names":[],"sources":["packages/core/session/src/types.ts:298","packages/deliverables/workspace-changes/src/types.ts:106"]},
{"digest":"f97f47b0eb87905ed77cc27c5e4ed75ef805cb372c98905253709de1aab9b63c","names":[],"sources":[]},
{"digest":"f9c2cb19607330d3579328475bd02ccdf6b9e3d647eb195bc98cc2519dec5f7f","names":[],"sources":[]},
{"digest":"f9cfc89e8fe085b4fcc9cd32b74b6f103608c54d7d8cd97b47c01de34f252ba3","names":[],"sources":[]},
{"digest":"fa87537f4a9c1e25602990a8bf686b383e9e00352ec8946e16ae24ba7c1625be","names":["packages/llm/llm/src/message.ts#AssistantMessage"],"sources":["packages/llm/llm/src/message.ts:166"]},
{"digest":"fa87537f4a9c1e25602990a8bf686b383e9e00352ec8946e16ae24ba7c1625be","names":["packages/llm/llm/src/message.ts#AssistantMessage"],"sources":["packages/llm/llm/src/message.ts:192"]},
{"digest":"fab2bb09bc5e3b9db0685e8f5500b029af1a2b33e70bc703c1d5d0f596fbc1fd","names":["packages/sandbox/sandbox/src/index.ts#SandboxMode"],"sources":["packages/sandbox/sandbox/src/index.ts:38"]},
{"digest":"fab35c4520883c0d69e42d079c9f543fc5ac7a2d15b537b5572fcd99059c7018","names":[],"sources":[]},
{"digest":"fb5e0517050d2c6d40e5b8145db1f7c5ca7044d5d50fada6ff80e0b22c6ca973","names":[],"sources":[]},
@@ -715,12 +720,12 @@
"nodes": {
"0116b1f89c05221d": {"kind":"literal","value":"web_search_20250305"},
"0203243b72fc867a": {"kind":"object","properties":[{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"02193e4f882eee79": {"kind":"array","element":"d73dbb5105041633"},
"022623b9ef98ec47": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"023a355b2be0d688": {"kind":"object","properties":[{"name":"kind","type":"254dce209e735f9c","optional":false}],"indices":[]},
"025f11632cd02aae": {"kind":"object","properties":[{"name":"data","type":"da60ed58a8fa23d7","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"5f22f22ce033e6ce","optional":false}],"indices":[]},
"02b2c23f2d94b028": {"kind":"object","properties":[{"name":"kind","type":"c5687b1313206a6f","optional":false}],"indices":[]},
"0341d4c3dfcd5325": {"kind":"literal","value":"product-interaction"},
"04c12e59a9ed4d7a": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"8af841fc9b265ade","optional":false},{"name":"source","type":"3d1339bcc98cb537","optional":false}],"indices":[]},
"05205074b24d8340": {"kind":"literal","value":"action-cards"},
"058fc9a6b4fbd5d4": {"kind":"union","types":["0e10d7c096b47e61","5d542ac7bdf13310","8faed5b52ab2d2df","a0f25b5aeeebf2bf","a43327a1739c3fa4","b6896938660a1dfe","cbbe8377ee744964","e2ad8f5bcd813f26"]},
"05a2796621b1ee6c": {"kind":"literal","value":"unknown"},
@@ -729,7 +734,6 @@
"07e1a58c58b593f5": {"kind":"object","properties":[{"name":"model","type":"4cd48f3e5108bd6e","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"07eccc9ea2f9b543": {"kind":"literal","value":"security-privacy-permission"},
"09655b34d7f3cf1e": {"kind":"literal","value":"system-prompt"},
"09f3f8dc417f2782": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"8af841fc9b265ade","optional":false},{"name":"source","type":"65a8400e451e667e","optional":false}],"indices":[]},
"0a30c3be336cdd4f": {"kind":"object","properties":[{"name":"kind","type":"1e0b0b66b6f0c53f","optional":false},{"name":"reason","type":"1f8c126cfab3df81","optional":false}],"indices":[]},
"0a8a062bc9c3c0d9": {"kind":"literal","value":"subagent/model-selection-policy"},
"0a92c5bdfa06c2e2": {"kind":"object","properties":[{"name":"displayName","type":"4cd48f3e5108bd6e","optional":true},{"name":"providerId","type":"4cd48f3e5108bd6e","optional":false},{"name":"subjectId","type":"4cd48f3e5108bd6e","optional":false},{"name":"tenantId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
@@ -752,10 +756,10 @@
"0fe52387f6505270": {"kind":"literal","value":"plan-mode"},
"1033093edd0db80f": {"kind":"object","properties":[{"name":"data","type":"1ccb56061942f5cc","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"6ab45ac76839722d","optional":false}],"indices":[]},
"10e386801903f9d4": {"kind":"literal","value":"compaction/prune"},
"1127571148780ee1": {"kind":"object","properties":[{"name":"data","type":"e90c7a2af8e7d05b","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"587bb11da730e06a","optional":false}],"indices":[]},
"11638dc58a31496f": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"119abe2b9c0b2f46": {"kind":"object","properties":[{"name":"dialect","type":"a6b41f5bede8094d","optional":false},{"name":"handlerId","type":"4cd48f3e5108bd6e","optional":false},{"name":"matcher","type":"4cd48f3e5108bd6e","optional":true},{"name":"point","type":"4cd48f3e5108bd6e","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"11f70b595aa76897": {"kind":"object","properties":[{"name":"policy","type":"05d2ae1e0c7f8770","optional":false},{"name":"source","type":"76632533f67879dc","optional":true}],"indices":[]},
"120eda1d93010166": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"68f44f59e91c4139","optional":false},{"name":"source","type":"7ce6b3aae88d0154","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.user-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"124aa62078ca3311": {"kind":"object","properties":[{"name":"data","type":"da60ed58a8fa23d7","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"d4c799e3d51cae10","optional":false}],"indices":[]},
"12a0cfa619ac4a5f": {"kind":"literal","value":"read-only"},
"12d5808fac1996b9": {"kind":"object","properties":[{"name":"attachment","type":"b0b0eb1b16490f6b","optional":false},{"name":"offloaded","type":"dacf3d5f3e4ff619","optional":true},{"name":"type","type":"fb8b6a2e53cb9cf4","optional":false}],"indices":[]},
@@ -817,9 +821,9 @@
"260523b412c19ad8": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"26718e15e7e395bc": {"kind":"object","properties":[{"name":"data","type":"11f70b595aa76897","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"36d6a9a871d949ea","optional":false}],"indices":[]},
"26c879bdd130e8b8": {"kind":"literal","value":"dispatch"},
"2719cd69e8ef5794": {"kind":"object","properties":[{"name":"data","type":"91b36ec2f96baa3a","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"829a2fb3be6efd4b","optional":false}],"indices":[]},
"2765e9119edf5816": {"kind":"literal","value":"model"},
"277b61f9c6f81704": {"kind":"literal","value":"file"},
"27f8b01d8292dda6": {"kind":"object","properties":[{"name":"headerSeq","type":"0657d3ca5ac4e7bf","optional":true},{"name":"message","type":"3b64001bcf263052","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"287211846beea1ec": {"kind":"object","properties":[{"name":"kind","type":"6c1cccb433ddc153","optional":false}],"indices":[]},
"28936c614bd4e7e2": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"290f32bfd81ff85a": {"kind":"object","properties":[{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
@@ -847,6 +851,7 @@
"33341aac09312300": {"kind":"union","types":["3860b4757d512a28","487b65c37bfedb8b","71bb3254ec8f1e49","e72269f931559e90"]},
"335e242de1fcc17b": {"kind":"union","types":["bcf0caf62d964b2f","e438a9d4fb883b3e"]},
"347de3380f2da308": {"kind":"literal","value":"job/settled"},
"34af242cde26fe0e": {"kind":"object","properties":[{"name":"headerSeq","type":"0657d3ca5ac4e7bf","optional":true},{"name":"message","type":"7645031a0886c6fb","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"34d1ab5c5df37818": {"kind":"literal","value":"resume"},
"35203ba7ad5ef6f9": {"kind":"object","properties":[{"name":"data","type":"f09e5e7acf5ff5cc","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1d5f04a03ea75fc8","optional":false}],"indices":[]},
"36d6a9a871d949ea": {"kind":"literal","value":"approval/policy"},
@@ -859,11 +864,9 @@
"3860b4757d512a28": {"kind":"object","properties":[{"name":"args","type":"93c33d9687613293","optional":false},{"name":"dt","type":"5d03ba38734809bc","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"index","type":"0657d3ca5ac4e7bf","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":true},{"name":"time0","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"616f93a5047de668","optional":false}],"indices":[]},
"390eed1028aba027": {"kind":"union","types":["b1f62380f6746fed","df5d9709b7db2a72"]},
"39cf2d3ff8bac81c": {"kind":"object","properties":[{"name":"callId","type":"4cd48f3e5108bd6e","optional":false},{"name":"rootCallId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"3a34ff4c0c404f4b": {"kind":"object","properties":[{"name":"data","type":"120eda1d93010166","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"de25352d2dc41963","optional":false}],"indices":[]},
"3b04790e08b35241": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"3b1be838223869fe": {"kind":"object","properties":[{"name":"data","type":"e4c18e294232c3ba","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"c589e938cc0e4989","optional":false}],"indices":[]},
"3b4f2c9ef2c1217e": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"3b64001bcf263052": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"589d0d91239681f8","optional":false},{"name":"source","type":"7ce6b3aae88d0154","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.developer-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"3bc287e765d58dc3": {"kind":"literal","value":"normal"},
"3bd652ebfa8726b3": {"kind":"union","types":["0657d3ca5ac4e7bf","938f7c7357bc403e"]},
"3bdb8dc6989655b0": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
@@ -871,6 +874,7 @@
"3bfeb47b58606f46": {"kind":"object","properties":[{"name":"data","type":"45f2a07ea9457312","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"cd186c309e2bef30","optional":false}],"indices":[]},
"3c2535ca0a2062f1": {"kind":"literal","value":"reasoning"},
"3cfc3a56502da1f8": {"kind":"object","properties":[{"name":"allow","type":"93c33d9687613293","optional":true},{"name":"deny","type":"93c33d9687613293","optional":true}],"indices":[]},
"3d1339bcc98cb537": {"kind":"object","properties":[{"name":"complete","type":"dacf3d5f3e4ff619","optional":true},{"name":"kind","type":"09655b34d7f3cf1e","optional":false},{"name":"reset","type":"dacf3d5f3e4ff619","optional":true},{"name":"sections","type":"8decd4949d9ee4ad","optional":true}],"indices":[]},
"3d7d07060a7be779": {"kind":"object","properties":[{"name":"category","type":"3305a4bb6b6c29b4","optional":true},{"name":"createdAt","type":"0657d3ca5ac4e7bf","optional":false},{"name":"messageId","type":"4cd48f3e5108bd6e","optional":false},{"name":"note","type":"4cd48f3e5108bd6e","optional":true},{"name":"rating","type":"390eed1028aba027","optional":false},{"name":"updatedAt","type":"0657d3ca5ac4e7bf","optional":false},{"name":"version","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"3e0eff5946255ff0": {"kind":"literal","value":"request/header"},
"3e2ece4967cfebe9": {"kind":"literal","value":"next-step"},
@@ -895,6 +899,7 @@
"487b65c37bfedb8b": {"kind":"object","properties":[{"name":"chunk","type":"47e9095591ae36e7","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"14230f9b8b5797bb","optional":false}],"indices":[]},
"48e5c9861f16ac07": {"kind":"object","properties":[{"name":"data","type":"6f72ece8f317cd08","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"4ae007ed190a72c9","optional":false}],"indices":[]},
"48f9c19417a1abbe": {"kind":"object","properties":[{"name":"data","type":"0bcfaf5566d27102","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"a8a2b9011fc06786","optional":false}],"indices":[]},
"4902846b72aabae5": {"kind":"literal","value":"retired"},
"4991dfc415c9efeb": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"49dab019d00e8c26": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"4a561c111a78d452": {"kind":"literal","value":"refusal"},
@@ -922,10 +927,8 @@
"52c6113cb0e53f34": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"5302e76315127761": {"kind":"object","properties":[{"name":"error","type":"a81059ca06999da1","optional":true},{"name":"message","type":"4b259f7f8f0a44ad","optional":false},{"name":"meta","type":"c592ce75aab73fca","optional":true},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"530da6c0267813bb": {"kind":"union","types":["34d1ab5c5df37818","4f507598cf476214","e7ce49f12953583f","f789af5ab844827e"]},
"53538b9e2b974a81": {"kind":"object","properties":[{"name":"data","type":"27f8b01d8292dda6","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1379f0b72275994d","optional":false}],"indices":[]},
"53cf1704ae0709c7": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"54f9276a1617d7c1": {"kind":"object","properties":[{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"stream","type":"84bbfdce7d2eab5b","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"5509e694e7b11c54": {"kind":"object","properties":[{"name":"data","type":"d7c6a501b0381f8e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"829a2fb3be6efd4b","optional":false}],"indices":[]},
"557e148d30b79ee4": {"kind":"literal","value":"agent-preset/selected"},
"5654685d7557ec74": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"56b7c047694875a8": {"kind":"object","properties":[{"name":"kind","type":"69d238a6e9b08d67","optional":false}],"indices":[]},
@@ -941,6 +944,7 @@
"5abab3a27fd27366": {"kind":"literal","value":"text-delta"},
"5b232a9b9bfcc0fc": {"kind":"literal","value":"after"},
"5b6fb1f226ff5640": {"kind":"object","properties":[{"name":"commandId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"1ab2ef1296f157ba","optional":false},{"name":"sourceEventSeq","type":"0657d3ca5ac4e7bf","optional":true},{"name":"text","type":"4cd48f3e5108bd6e","optional":true}],"indices":[]},
"5b7abd24d8a133e7": {"kind":"union","types":["792eb6cb1f6bed83","a408aa610f991ff3"]},
"5bb69b88517f6214": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"5bc66269cfaf614c": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"5bd310104cfe448e": {"kind":"literal","value":"resource-cost"},
@@ -951,7 +955,6 @@
"5d17f27a1ef9f702": {"kind":"literal","value":"tool-workflow/agent-end"},
"5d542ac7bdf13310": {"kind":"object","properties":[{"name":"childCreatedAt","type":"0657d3ca5ac4e7bf","optional":false},{"name":"childId","type":"4cd48f3e5108bd6e","optional":false},{"name":"label","type":"4cd48f3e5108bd6e","optional":true},{"name":"mode","type":"d28765f87d6b6ab4","optional":false},{"name":"version","type":"93d38436347f67c9","optional":false}],"indices":[]},
"5d7a64ed6aac5551": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"5d8b5283839b9337": {"kind":"object","properties":[{"name":"data","type":"8e0a3b4e470f634c","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"587bb11da730e06a","optional":false}],"indices":[]},
"5dd766ccd1702a11": {"kind":"object","properties":[{"name":"shadowedRange","type":"9e41386b3a0c9572","optional":false},{"name":"shadowedSeqs","type":"5d03ba38734809bc","optional":false},{"name":"shadowedTokenCount","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"5e6db6e24948d4a8": {"kind":"object","properties":[{"name":"data","type":"17d1afb770d99419","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1c2686c0682e7bc5","optional":false}],"indices":[]},
"5ebce1317eacd2c1": {"kind":"literal","value":"subagent/descriptor"},
@@ -969,7 +972,6 @@
"63ba8895cc09e469": {"kind":"literal","value":"retry"},
"6487b10ba7542f3c": {"kind":"object","properties":[{"name":"agentModel","type":"4cd48f3e5108bd6e","optional":true},{"name":"agentProvider","type":"4cd48f3e5108bd6e","optional":true},{"name":"agentReasoningEffort","type":"4cd48f3e5108bd6e","optional":true},{"name":"label","type":"4cd48f3e5108bd6e","optional":false},{"name":"mode","type":"e5d3828df1ec3e2a","optional":false},{"name":"persona","type":"4cd48f3e5108bd6e","optional":true},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false},{"name":"toolFilter","type":"3cfc3a56502da1f8","optional":true},{"name":"version","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"6598cd6da253948d": {"kind":"object","properties":[{"name":"context","type":"50cf02d875f8a1f1","optional":false},{"name":"description","type":"4cd48f3e5108bd6e","optional":false},{"name":"error","type":"4cd48f3e5108bd6e","optional":true},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"phase","type":"dfce5db4aa42b7eb","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"65a8400e451e667e": {"kind":"object","properties":[{"name":"kind","type":"09655b34d7f3cf1e","optional":false}],"indices":[]},
"65d583e66518c523": {"kind":"object","properties":[{"name":"entries","type":"aba175fb20ffc711","optional":false},{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"incomplete","type":"dacf3d5f3e4ff619","optional":true},{"name":"kind","type":"6ebcc2dbec9f2dab","optional":false},{"name":"update","type":"dacf3d5f3e4ff619","optional":true}],"indices":[]},
"66ba70f6f068da44": {"kind":"object","properties":[{"name":"deferLoading","type":"dacf3d5f3e4ff619","optional":true},{"name":"description","type":"4cd48f3e5108bd6e","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"parameters","type":"0aa62ab51b36c0e6","optional":false}],"indices":[]},
"672c4aa2a9b736e3": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"1922cd79a70806c1","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
@@ -977,16 +979,13 @@
"68141cbe3994a5ff": {"kind":"literal","value":"max-tokens"},
"688e853dc149f0d3": {"kind":"literal","value":"reasoning-chunks"},
"68f44f59e91c4139": {"kind":"literal","value":"user"},
"69081694be231d56": {"kind":"object","properties":[{"name":"data","type":"6bc8e51124d0874b","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1c5a58f4599bd4a9","optional":false}],"indices":[]},
"693f4952fb5565da": {"kind":"object","properties":[{"name":"failure","type":"5f2117d1856a5ab4","optional":false},{"name":"kind","type":"a2be0f0cb59f0d4a","optional":false}],"indices":[]},
"69d238a6e9b08d67": {"kind":"literal","value":"interrupted"},
"6ab45ac76839722d": {"kind":"literal","value":"assistant/message"},
"6b23ed9ce1b397e6": {"kind":"literal","value":"compact-checkpoint"},
"6ba7edb6447b6a3e": {"kind":"literal","value":"share-viewer"},
"6bbe793f6a93dc8d": {"kind":"object","properties":[{"name":"blockedReason","type":"84ac8c1a66ffc697","optional":true},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"maxGoalRounds","type":"0657d3ca5ac4e7bf","optional":false},{"name":"objective","type":"4cd48f3e5108bd6e","optional":false},{"name":"phase","type":"b8327af7ee576795","optional":false},{"name":"revision","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"6bc8e51124d0874b": {"kind":"object","properties":[{"name":"message","type":"09f3f8dc417f2782","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"6c03546143cdf6ae": {"kind":"object","properties":[{"name":"kind","type":"e6411b09c1d982f7","optional":false}],"indices":[]},
"6c0f8aded45d4b31": {"kind":"array","element":"120eda1d93010166"},
"6c1cccb433ddc153": {"kind":"literal","value":"tool-calls"},
"6c5a37d42ebdb12d": {"kind":"object","properties":[{"name":"kind","type":"dbdafceb9a900183","optional":false},{"name":"reason","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"6ccb6bc423fb3952": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
@@ -1012,8 +1011,10 @@
"756b5e23a5cb2c7f": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"7624ca28c61ca0ea": {"kind":"literal","value":"create"},
"763c8a20af487263": {"kind":"object","properties":[{"name":"data","type":"7d226b9fd95b4ba2","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"237c004c73b6b288","optional":false}],"indices":[]},
"7645031a0886c6fb": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"589d0d91239681f8","optional":false},{"name":"source","type":"9c75043166543713","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.developer-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"76632533f67879dc": {"kind":"literal","value":"delegation"},
"78a9be340090b735": {"kind":"literal","value":"tmux-context"},
"792eb6cb1f6bed83": {"kind":"object","properties":[{"name":"contentIndex","type":"0657d3ca5ac4e7bf","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"noticeIndex","type":"5d03ba38734809bc","optional":true},{"name":"order","type":"0657d3ca5ac4e7bf","optional":false},{"name":"state","type":"c8e6f48878cc2a2f","optional":false}],"indices":[]},
"79650cfa10aa3c52": {"kind":"object","properties":[{"name":"error","type":"5f2117d1856a5ab4","optional":false},{"name":"kind","type":"a2be0f0cb59f0d4a","optional":false}],"indices":[]},
"79ddc907312f97cf": {"kind":"object","properties":[{"name":"todos","type":"4b7ddaf3710b88ff","optional":false}],"indices":[]},
"7a651f3b672c52fb": {"kind":"literal","value":"session/title"},
@@ -1021,7 +1022,6 @@
"7b1ce60193fa8b69": {"kind":"literal","value":"working-directory"},
"7c6129b6961cf4b2": {"kind":"object","properties":[{"name":"messageId","type":"4cd48f3e5108bd6e","optional":false},{"name":"sessionId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"7c9f44e90a0058f4": {"kind":"object","properties":[{"name":"data","type":"5302e76315127761","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"570e850224346133","optional":false}],"indices":[]},
"7ce6b3aae88d0154": {"kind":"union","types":["0203243b72fc867a","022623b9ef98ec47","02b2c23f2d94b028","0ed8d1108fe7a5e1","0eeb17e1df89b1eb","11638dc58a31496f","1938c8c20f1cba7c","1e709346005826eb","1fdad624334d3548","2152caf1a71e588e","2235d957bf4b7c6c","224aa11d4d5f88c4","24ce31aa528272e5","260523b412c19ad8","28936c614bd4e7e2","290f32bfd81ff85a","297fbd8067d7815a","2aad1179f9576314","312aee2f0c42aabb","31907de956375182","3247e566f4340029","3b04790e08b35241","3b4f2c9ef2c1217e","3bdb8dc6989655b0","408927267422a7b2","45f005e6bbb76452","4991dfc415c9efeb","49dab019d00e8c26","4a9bef9f27a94252","52c6113cb0e53f34","53cf1704ae0709c7","5654685d7557ec74","58015da1c1950a66","5bb69b88517f6214","5bc66269cfaf614c","5cdbf342b7748d15","5d7a64ed6aac5551","6085488d223aeffd","6292bcbedaa97fea","65a8400e451e667e","65d583e66518c523","672c4aa2a9b736e3","6ccb6bc423fb3952","6ea608bdc8a7a63d","6f22a9d02b9a1f11","6f44f32be9bcd9a8","719c51f67074f970","7554565be416b034","756b5e23a5cb2c7f","7df62978a2b7de85","7eaef7a763ba5b94","7f959241c24128b4","80677c8c8b804189","825ca23416b1ea9d","8338ee303e2bd448","848639f8787f035b","854db3efdfb0cd39","85fe96bf15d5c755","8620189c8e335827","87b1a33564b9a4d6","88841202942c7683","8a046b52331959aa","8c1c4f72755a78ea","8c627d7a45fa406c","8f1062573ea91841","8f324cea3916c051","8fcb0b44a575e998","96bfb916a727cd44","99135d8a39379779","99f0e98184709ad1","9edc162949abf93b","9f65c43e340bba31","a15a19ef63cf5d1b","a16e567c8cd2c55c","a2066bd52f61218b","a3c6f1ea38e9a61d","a4afec59b75aad5d","aa2bf9e82b9fdeb9","aae343bc3d663c83","ada310bf0bdb8fed","ade057f4fdc387ae","b062078e899958f9","b2a5c8c008a31e3d","b3681c026a0b98e9","b4ec0af39fd52ed9","b613f83572fe2fbf","b6f94c17dd9bbd7c","b70f3e81fe11b7a5","b79641a9d25e7566","b8ed92a5ca59733f","ba2a1a8f194b1bb2","ba4c40b4381e0dcd","baccc97ec34be6c4","c5228b7a55498d84","c55827fba7018198","cb1c8959e1726f82","cda2345a9be9d139","d215701afb7aafbf","d85590a5675c6e2f","d9c462b9f62fdd3e","db06ef35b27a3842","dba54c09c6e7aafc","dd00cdccd0ba487b","dd5ee8762bd8a14b","dd6cc2bb2a8f2824","dde0cdf9d426768b","deaae5cd30987d4f","e7f4cbb3a57f4cbd","edbbfff1128099fd","ee577a0cc18664c9","f230c0b583e23b25","f29d63336e8266d8","f4a66f654996c093","f56c5b59ca016131","f6329fb30c7ea801","f6605d6c57933aea","f6afe41e3926f422","f7283223aacdc39b","f97f47b0eb87905e","fcf81d3c58c13593","fe1a7acdeed4d0f5"]},
"7d226b9fd95b4ba2": {"kind":"union","types":["1df34a6c086866ff","cffcdc19881ab61e"]},
"7d54a5a5e629e2e7": {"kind":"object","properties":[{"name":"category","type":"3305a4bb6b6c29b4","optional":true},{"name":"text","type":"4cd48f3e5108bd6e","optional":true}],"indices":[]},
"7d65acf0a3a43a8f": {"kind":"union","types":["1f0133217eeeffd8","277b61f9c6f81704","3c2535ca0a2062f1","4e44c9118152f682","83d6916021eede8f","85f9b505b7bdff1f","fb8b6a2e53cb9cf4"]},
@@ -1069,7 +1069,7 @@
"8c1c4f72755a78ea": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"8c627d7a45fa406c": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8cdd3fdd295cee53": {"kind":"literal","value":"command/done"},
"8e0a3b4e470f634c": {"kind":"object","properties":[{"name":"maxTokens","type":"0657d3ca5ac4e7bf","optional":false},{"name":"messageSeqs","type":"5d03ba38734809bc","optional":false},{"name":"messages","type":"02193e4f882eee79","optional":false},{"name":"reasoningEffort","type":"4cd48f3e5108bd6e","optional":true},{"name":"route","type":"07e1a58c58b593f5","optional":false},{"name":"system","type":"4cd48f3e5108bd6e","optional":false},{"name":"titleProvider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8decd4949d9ee4ad": {"kind":"array","element":"5b7abd24d8a133e7"},
"8e31bb958e9b015e": {"kind":"object","properties":[{"name":"failure","type":"5f2117d1856a5ab4","optional":false},{"name":"kind","type":"1e0b0b66b6f0c53f","optional":false}],"indices":[]},
"8e611bf46821e500": {"kind":"object","properties":[{"name":"tool","type":"fcf427290c6213c2","optional":true},{"name":"toolName","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"85f9b505b7bdff1f","optional":false}],"indices":[]},
"8e8155594e078123": {"kind":"literal","value":"workspace/changes"},
@@ -1078,8 +1078,10 @@
"8f324cea3916c051": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"8f6d609794bf5afc": {"kind":"tuple","elements":[{"type":"4e88776858652856","optional":false,"rest":false}]},
"8faed5b52ab2d2df": {"kind":"object","properties":[{"name":"childCreatedAt","type":"0657d3ca5ac4e7bf","optional":false},{"name":"childId","type":"4cd48f3e5108bd6e","optional":false},{"name":"label","type":"4cd48f3e5108bd6e","optional":false},{"name":"mode","type":"e5d3828df1ec3e2a","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"version","type":"137ac60e26bcb192","optional":false}],"indices":[]},
"8fc8f70451996be0": {"kind":"object","properties":[{"name":"data","type":"daffe1e8caaeaf76","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"de25352d2dc41963","optional":false}],"indices":[]},
"8fcb0b44a575e998": {"kind":"object","properties":[{"name":"kind","type":"a720757f704a2512","optional":false}],"indices":[]},
"904bf499d98be4a3": {"kind":"union","types":["7382c4fc95fe8c5d","b765ee31033cea46","f6cb462f808309e3"]},
"91b36ec2f96baa3a": {"kind":"object","properties":[{"name":"inserted","type":"f9c2cb19607330d3","optional":false},{"name":"outcome","type":"d4e4d575abeb4b72","optional":true},{"name":"removedCount","type":"0657d3ca5ac4e7bf","optional":true},{"name":"start","type":"0657d3ca5ac4e7bf","optional":false},{"name":"target","type":"96f4a9c81fc0f940","optional":false}],"indices":[]},
"920d87e22b7409bc": {"kind":"object","properties":[{"name":"data","type":"c2a13242efc3bea4","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"d8a476d2c6fd30df","optional":false}],"indices":[]},
"930c1cd289def119": {"kind":"union","types":["2142e391b9ccb60d","2c4c21f19f426a58","811229eedcec5797","fab35c4520883c0d"]},
"935c8d486292b13c": {"kind":"literal","value":"web_search"},
@@ -1107,6 +1109,7 @@
"9acbe713f3f64192": {"kind":"literal","value":"image/offload"},
"9b4fd974c124c837": {"kind":"literal","value":"tool-call-delta"},
"9c001ecb5e1d3c38": {"kind":"object","properties":[{"name":"max_tokens","type":"0657d3ca5ac4e7bf","optional":false},{"name":"messages","type":"b993441f8ce7d27b","optional":false},{"name":"model","type":"4cd48f3e5108bd6e","optional":false},{"name":"thinking","type":"37ff65426bcf130f","optional":true},{"name":"tools","type":"4aed17ec726b5397","optional":false}],"indices":[]},
"9c75043166543713": {"kind":"union","types":["0203243b72fc867a","022623b9ef98ec47","02b2c23f2d94b028","0ed8d1108fe7a5e1","0eeb17e1df89b1eb","11638dc58a31496f","1938c8c20f1cba7c","1e709346005826eb","1fdad624334d3548","2152caf1a71e588e","2235d957bf4b7c6c","224aa11d4d5f88c4","24ce31aa528272e5","260523b412c19ad8","28936c614bd4e7e2","290f32bfd81ff85a","297fbd8067d7815a","2aad1179f9576314","312aee2f0c42aabb","31907de956375182","3247e566f4340029","3b04790e08b35241","3b4f2c9ef2c1217e","3bdb8dc6989655b0","3d1339bcc98cb537","408927267422a7b2","45f005e6bbb76452","4991dfc415c9efeb","49dab019d00e8c26","4a9bef9f27a94252","52c6113cb0e53f34","53cf1704ae0709c7","5654685d7557ec74","58015da1c1950a66","5bb69b88517f6214","5bc66269cfaf614c","5cdbf342b7748d15","5d7a64ed6aac5551","6085488d223aeffd","6292bcbedaa97fea","65d583e66518c523","672c4aa2a9b736e3","6ccb6bc423fb3952","6ea608bdc8a7a63d","6f22a9d02b9a1f11","6f44f32be9bcd9a8","719c51f67074f970","7554565be416b034","756b5e23a5cb2c7f","7df62978a2b7de85","7eaef7a763ba5b94","7f959241c24128b4","80677c8c8b804189","825ca23416b1ea9d","8338ee303e2bd448","848639f8787f035b","854db3efdfb0cd39","85fe96bf15d5c755","8620189c8e335827","87b1a33564b9a4d6","88841202942c7683","8a046b52331959aa","8c1c4f72755a78ea","8c627d7a45fa406c","8f1062573ea91841","8f324cea3916c051","8fcb0b44a575e998","96bfb916a727cd44","99135d8a39379779","99f0e98184709ad1","9edc162949abf93b","9f65c43e340bba31","a15a19ef63cf5d1b","a16e567c8cd2c55c","a2066bd52f61218b","a3c6f1ea38e9a61d","a4afec59b75aad5d","aa2bf9e82b9fdeb9","aae343bc3d663c83","ada310bf0bdb8fed","ade057f4fdc387ae","b062078e899958f9","b2a5c8c008a31e3d","b3681c026a0b98e9","b4ec0af39fd52ed9","b613f83572fe2fbf","b6f94c17dd9bbd7c","b70f3e81fe11b7a5","b79641a9d25e7566","b8ed92a5ca59733f","ba2a1a8f194b1bb2","ba4c40b4381e0dcd","baccc97ec34be6c4","c5228b7a55498d84","c55827fba7018198","cb1c8959e1726f82","cda2345a9be9d139","d215701afb7aafbf","d85590a5675c6e2f","d9c462b9f62fdd3e","db06ef35b27a3842","dba54c09c6e7aafc","dd00cdccd0ba487b","dd5ee8762bd8a14b","dd6cc2bb2a8f2824","dde0cdf9d426768b","deaae5cd30987d4f","e7f4cbb3a57f4cbd","edbbfff1128099fd","ee577a0cc18664c9","f230c0b583e23b25","f29d63336e8266d8","f4a66f654996c093","f56c5b59ca016131","f6329fb30c7ea801","f6605d6c57933aea","f6afe41e3926f422","f7283223aacdc39b","f97f47b0eb87905e","fcf81d3c58c13593","fe1a7acdeed4d0f5"]},
"9d80129e13edfb6f": {"kind":"literal","value":"other"},
"9e07693fd7cd9bab": {"kind":"literal","value":"ask"},
"9e2c06d8653585b3": {"kind":"array","element":"1cde1bedde79c5e8"},
@@ -1127,6 +1130,7 @@
"a3a259a1aa5401af": {"kind":"literal","value":"hook/result"},
"a3c6f1ea38e9a61d": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"a3edd1efd1fef21b": {"kind":"literal","value":"workspace-write"},
"a408aa610f991ff3": {"kind":"object","properties":[{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"noticeIndex","type":"5d03ba38734809bc","optional":true},{"name":"state","type":"4902846b72aabae5","optional":false}],"indices":[]},
"a43327a1739c3fa4": {"kind":"object","properties":[{"name":"childCreatedAt","type":"0657d3ca5ac4e7bf","optional":false},{"name":"childId","type":"4cd48f3e5108bd6e","optional":false},{"name":"label","type":"4cd48f3e5108bd6e","optional":true},{"name":"mode","type":"fc351843b8ecbd05","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"version","type":"137ac60e26bcb192","optional":false}],"indices":[]},
"a4afec59b75aad5d": {"kind":"object","properties":[{"name":"clientTimeZone","type":"4cd48f3e5108bd6e","optional":true},{"name":"kind","type":"68f44f59e91c4139","optional":false},{"name":"principal","type":"824a4aad44a54e24","optional":true},{"name":"rpcId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"a6567ccb2e530606": {"kind":"object","properties":[{"name":"data","type":"0d47a8f3d847243c","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"0a8a062bc9c3c0d9","optional":false}],"indices":[]},
@@ -1211,6 +1215,7 @@
"bca0f9cb63d8620b": {"kind":"object","properties":[{"name":"data","type":"a9427866376b691a","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"b57ae1b37e52bee0","optional":false}],"indices":[]},
"bcf0caf62d964b2f": {"kind":"object","properties":[{"name":"endSeq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"op","type":"f6cb462f808309e3","optional":false},{"name":"startSeq","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"bd499eac047efe09": {"kind":"literal","value":"finish"},
"be53b443539d32c2": {"kind":"array","element":"e7f07198d10adc34"},
"bf16d2e98a7f1389": {"kind":"literal","value":"subagent-settled"},
"c0ea97bc89dfc46f": {"kind":"object","properties":[{"name":"outcome","type":"c2deb7c9183735d4","optional":false},{"name":"runId","type":"4cd48f3e5108bd6e","optional":false},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"c170da8ab7c37635": {"kind":"union","types":["374fdd68aee5ff84","cdee10e87dbed844"]},
@@ -1221,6 +1226,7 @@
"c2deb7c9183735d4": {"kind":"union","types":["1ebc6f9ff3aa9e3a","2142e391b9ccb60d","b57a2889408de36e"]},
"c2f49004d9ae38a9": {"kind":"union","types":["1ebc6f9ff3aa9e3a","b57a2889408de36e","ef226a90ddac6cd8"]},
"c43b119ce579b3e9": {"kind":"literal","value":"paused"},
"c460ea99c4124f01": {"kind":"object","properties":[{"name":"message","type":"04c12e59a9ed4d7a","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"c5228b7a55498d84": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"c55827fba7018198": {"kind":"object","properties":[{"name":"callId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"9645cf93769a6dfb","optional":false},{"name":"outcome","type":"85d6d96ff8842974","optional":false}],"indices":[]},
"c5687b1313206a6f": {"kind":"literal","value":"cordis-host-runner"},
@@ -1239,6 +1245,7 @@
"cda2345a9be9d139": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"cdca80b8dad24d4e": {"kind":"literal","value":"tool-workflow/run-start"},
"cdee10e87dbed844": {"kind":"object","properties":[{"name":"delayMs","type":"0657d3ca5ac4e7bf","optional":false},{"name":"failure","type":"5f2117d1856a5ab4","optional":false},{"name":"maxRetries","type":"0657d3ca5ac4e7bf","optional":false},{"name":"mode","type":"3bc287e765d58dc3","optional":false},{"name":"policyKey","type":"4cd48f3e5108bd6e","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false},{"name":"retry","type":"0657d3ca5ac4e7bf","optional":false},{"name":"retryId","type":"4cd48f3e5108bd6e","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"ce9404e050df9462": {"kind":"object","properties":[{"name":"data","type":"34af242cde26fe0e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1379f0b72275994d","optional":false}],"indices":[]},
"cef171adf021a186": {"kind":"object","properties":[{"name":"arguments","type":"bbc5696e3f13c758","optional":false},{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"error","type":"a81059ca06999da1","optional":true},{"name":"isError","type":"aa93010d0e521ad7","optional":false},{"name":"meta","type":"c592ce75aab73fca","optional":true},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"parentCallId","type":"4cd48f3e5108bd6e","optional":false},{"name":"rootCallId","type":"4cd48f3e5108bd6e","optional":false},{"name":"subCallId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"cffcdc19881ab61e": {"kind":"object","properties":[{"name":"cleared","type":"0b6d718c693fdf7f","optional":false},{"name":"clearedAt","type":"0657d3ca5ac4e7bf","optional":false},{"name":"kind","type":"237c004c73b6b288","optional":false},{"name":"operation","type":"e7e154d47d5fbc53","optional":false},{"name":"version","type":"f88f1b7b6bb733f6","optional":false}],"indices":[]},
"d0fbb0ca1bbba059": {"kind":"literal","value":"delete"},
@@ -1251,8 +1258,6 @@
"d63b8b8ffad9c02f": {"kind":"object","properties":[{"name":"data","type":"8bb8c3751a6ce64b","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"47e5d84f1a93450a","optional":false}],"indices":[]},
"d66e11dddf5dfa3c": {"kind":"object","properties":[{"name":"data","type":"cef171adf021a186","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"fb5e0517050d2c6d","optional":false}],"indices":[]},
"d6e654b88b584fcd": {"kind":"literal","value":"fallback"},
"d73dbb5105041633": {"kind":"union","types":["09f3f8dc417f2782","120eda1d93010166","3b64001bcf263052","4b259f7f8f0a44ad","fa87537f4a9c1e25"]},
"d7c6a501b0381f8e": {"kind":"object","properties":[{"name":"inserted","type":"6c0f8aded45d4b31","optional":false},{"name":"outcome","type":"d4e4d575abeb4b72","optional":true},{"name":"removedCount","type":"0657d3ca5ac4e7bf","optional":true},{"name":"start","type":"0657d3ca5ac4e7bf","optional":false},{"name":"target","type":"96f4a9c81fc0f940","optional":false}],"indices":[]},
"d85590a5675c6e2f": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"d8a476d2c6fd30df": {"kind":"literal","value":"team/mode"},
"d9196086e41e4dd5": {"kind":"literal","value":"complete"},
@@ -1260,6 +1265,7 @@
"d9edf1862e4471d6": {"kind":"literal","value":"schedule"},
"da60ed58a8fa23d7": {"kind":"object","properties":[{"name":"cwd","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"dacf3d5f3e4ff619": {"kind":"literal","value":true},
"daffe1e8caaeaf76": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"68f44f59e91c4139","optional":false},{"name":"source","type":"9c75043166543713","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.user-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"db06ef35b27a3842": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"db6c5246911d47a7": {"kind":"literal","value":"webhook"},
"db874d463b0fdec7": {"kind":"object","properties":[{"name":"data","type":"3e4e7683b0192c9f","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"e2d0367e5716bc18","optional":false}],"indices":[]},
@@ -1299,14 +1305,17 @@
"e7ce49f12953583f": {"kind":"literal","value":"initial"},
"e7e154d47d5fbc53": {"kind":"literal","value":"clear"},
"e7e8f1318170b828": {"kind":"literal","value":"deleted"},
"e7f07198d10adc34": {"kind":"union","types":["04c12e59a9ed4d7a","4b259f7f8f0a44ad","7645031a0886c6fb","daffe1e8caaeaf76","fa87537f4a9c1e25"]},
"e7f4cbb3a57f4cbd": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"e8de0f457fed5b9f": {"kind":"literal","value":"notice"},
"e90c7a2af8e7d05b": {"kind":"object","properties":[{"name":"maxTokens","type":"0657d3ca5ac4e7bf","optional":false},{"name":"messageSeqs","type":"5d03ba38734809bc","optional":false},{"name":"messages","type":"be53b443539d32c2","optional":false},{"name":"reasoningEffort","type":"4cd48f3e5108bd6e","optional":true},{"name":"route","type":"07e1a58c58b593f5","optional":false},{"name":"system","type":"4cd48f3e5108bd6e","optional":false},{"name":"titleProvider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"e95f957154b2b1b5": {"kind":"literal","value":"assistant/attempt"},
"ea08ec1df0c33108": {"kind":"object","properties":[{"name":"message","type":"2eafefdc6f79a492","optional":false},{"name":"teamId","type":"4cd48f3e5108bd6e","optional":false},{"name":"version","type":"a0f906856fc06f1c","optional":false}],"indices":[]},
"eaa71be0fbf0f702": {"kind":"object","properties":[{"name":"kind","type":"ad3b56aa2fc1ad42","optional":false}],"indices":[]},
"ebb768d85ec87fb6": {"kind":"literal","value":"image/webp"},
"ec38b5949af8eaca": {"kind":"object","properties":[{"name":"data","type":"2fe5026daf14bd4f","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"2aed07493b1c65b6","optional":false}],"indices":[]},
"ec8b5ff7c77ca689": {"kind":"object","properties":[{"name":"kind","type":"b2245a906e13aa94","optional":false}],"indices":[]},
"ed3b0ee800e0ef9a": {"kind":"object","properties":[{"name":"data","type":"c460ea99c4124f01","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1c5a58f4599bd4a9","optional":false}],"indices":[]},
"edbbfff1128099fd": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"edd37b1e4974af64": {"kind":"object","properties":[{"name":"data","type":"611d82d2dc50df70","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"347de3380f2da308","optional":false}],"indices":[]},
"ee577a0cc18664c9": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
@@ -1339,6 +1348,7 @@
"f88f1b7b6bb733f6": {"kind":"literal","value":1},
"f90eb4ab2d3897bc": {"kind":"object","properties":[{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"f97f47b0eb87905e": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"f9c2cb19607330d3": {"kind":"array","element":"daffe1e8caaeaf76"},
"f9cfc89e8fe085b4": {"kind":"literal","value":"text-chunks"},
"fa87537f4a9c1e25": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"95c0e88fcf0bafb2","optional":false},{"name":"source","type":"719c51f67074f970","optional":false}],"indices":[]},
"fab2bb09bc5e3b9d": {"kind":"union","types":["12a0cfa619ac4a5f","18fce9540bb20897","a3edd1efd1fef21b"]},
+4 -4
View File
@@ -6,8 +6,8 @@
en: 2b372c8f979dfc0e
zh: 818c50976481b90b
/compaction/the-compaction-session-events:
en: bc9bbbe82efc308c
zh: 0b2b7f70f5df5d99
en: 1c71c156254859ea
zh: 4306125484deeee6
/compaction/image-offload:
en: 19632b674911826b
zh: b29ef7ff4ae58e58
@@ -15,8 +15,8 @@
en: 9dde333b53c14f24
zh: 8959aafefc55f9a4
/compaction/the-service:
en: 6745d00e80bba52e
zh: e5c98f752e46e5f3
en: 7968f10392845778
zh: b5fc084b745ef2f8
/compaction/tool-result-pruning-outcomes:
en: 27091b0a3d454575
zh: e22431e27e1349f2
+4 -3
View File
@@ -8,7 +8,7 @@ Source: [`packages/compaction/compaction/src/types.ts`](../../packages/compactio
## The `compaction/*` session events
Compaction extends [`SessionEventMap`](session.md) with three event types via declaration merging. All three are **log-only** — they record the lock, summary, selected range, shadowed event seqs, token count, and model call without joining the surface. `SurfaceEventType` is deliberately NOT extended (only message-producing events reach the model), so the summary itself rides on a separate `user/message` with `surfaceOp: { op: 'replace', startSeq, endSeq }` — the only surface mutation performed by summary compaction. The [historical Agent Note](../../.agents/notes/archived/feature/2026-06-18-compaction-capability-seam.md) records the rationale for reusing `user/message`.
Compaction extends [`SessionEventMap`](session.md) with three event types via declaration merging. All three are **log-only** — they record the lock, summary, selected range, shadowed event seqs, token count, and model call without joining the surface. `SurfaceEventType` is deliberately NOT extended (only message-producing events reach the model), so the summary itself rides on a separate `user/message` with `surfaceOp: { op: 'replace', startSeq, endSeq }`. The next model attempt consolidates current system instructions through ordinary `system/message` replacements. The [historical Agent Note](../../.agents/notes/archived/feature/2026-06-18-compaction-capability-seam.md) records the rationale for reusing `user/message`.
| Event | Payload | Role |
|---|---|---|
@@ -81,7 +81,7 @@ Automatic callers state why policy is running; implementations may treat confirm
type CompactionTrigger = 'pressure' | 'context-overflow'
```
`CompactionEngine` exposes `compactIfNeeded(agent, trigger, signal)` for automatic `pressure` or `context-overflow` policy, `compactNow(agent, signal)` for one useful idle-session reduction even below pressure, and `compactRegion(...)` for an explicit inclusive surface range. `compactNow()` runs as agent maintenance between turns, returns `null` without writing when no useful range exists, records a standalone `turn: null` bracket before summarization, and flushes a closed attempt before later queued prompts may derive from the new surface. Every backend creates its replacement `user/message` source with `compactCheckpointSource(compactionId, sourceCommandId?)`; client and wire consumers import that constructor, `CompactionCheckpointSource`, and `isCompactCheckpointSource()` from the cordis-free `@deepseek-ai/dsh-compaction/checkpoint` subpath, while the package root re-exports them for host consumers. The required transaction identity correlates the replacement checkpoint, while the predicate keeps recognition independent of any one backend. Implementations must forward the supplied signal to summarization. The seam owns no pricing API: the singleton [`ctx.tokenMeter`](token-meter.md) directly owns estimation and replay, while `dsh-compaction-basic` owns retention, event sequencing, routed summarization calls, and their configuration.
`CompactionEngine` exposes `compactIfNeeded(agent, trigger, signal)` for automatic `pressure` or `context-overflow` policy, `compactNow(agent, signal)` for one useful idle-session reduction even below pressure, and `compactRegion(...)` for an explicit inclusive balanced range that excludes the initial system message. `compactNow()` runs as agent maintenance between turns, returns `null` without writing when no useful range exists, records a standalone `turn: null` bracket before summarization, and flushes a closed attempt before later queued prompts may derive from the new surface. Every backend creates its replacement `user/message` source with `compactCheckpointSource(compactionId, sourceCommandId?)`; client and wire consumers import that constructor, `CompactionCheckpointSource`, and `isCompactCheckpointSource()` from the cordis-free `@deepseek-ai/dsh-compaction/checkpoint` subpath, while the package root re-exports them for host consumers. The required transaction identity correlates the replacement checkpoint, while the predicate keeps recognition independent of any one backend. Implementations must forward the supplied signal to summarization. The seam owns no pricing API: the singleton [`ctx.tokenMeter`](token-meter.md) directly owns estimation and replay, while `dsh-compaction-basic` owns retention, event sequencing, routed summarization calls, and their configuration.
Expected manual failures use `ManualCompactionErrorCode`:
@@ -184,7 +184,8 @@ abstract compactIfNeeded( agent: CompactionAgentContext, trigger: CompactionTrig
abstract compactNow( agent: ManualCompactAgentContext, signal: AbortSignal, sourceCommandId?: CommandId, ): Promise<CompactionResult | null>
/**
* Forcibly compact a range of surface nodes into a single summary node.
* Compact a balanced range of conversation nodes into a single summary node.
* The initial system node, when present, lies outside the selected range.
* `start` and `end` name an inclusive span by surface position, not numeric seq
* order; replacements can make visible seqs non-monotonic. Both edges must be
* balanced so assistant tool calls remain paired with their results. A model-
+4 -3
View File
@@ -8,7 +8,7 @@
## `compaction/*` 会话事件
压缩通过声明合并为 [`SessionEventMap`](session.zh.md) 扩展三种事件类型。三者都**仅写入日志**——它们记录锁、摘要、选中范围、被遮蔽事件 seq、token 数以及模型调用,绝不进入 surface。这里有意不扩展 `SurfaceEventType`(只有产生消息的事件才到达模型),因此摘要本身承载在另一条带有 `surfaceOp: { op: 'replace', startSeq, endSeq }` 的 `user/message` 上——这是摘要压缩执行的唯一 surface 变更。[历史Agent Note](../../.agents/notes/archived/feature/2026-06-18-compaction-capability-seam.md) 负责复用 `user/message` 的决策依据。
压缩通过声明合并为 [`SessionEventMap`](session.zh.md) 扩展三种事件类型。三者都**仅写入日志**——它们记录锁、摘要、选中范围、被遮蔽事件 seq、token 数以及模型调用,绝不进入 surface。这里有意不扩展 `SurfaceEventType`(只有产生消息的事件才到达模型),因此摘要本身承载在另一条带有 `surfaceOp: { op: 'replace', startSeq, endSeq }` 的 `user/message` 上。下一次模型尝试通过普通 `system/message` 替换操作合并当前系统指令。[历史Agent Note](../../.agents/notes/archived/feature/2026-06-18-compaction-capability-seam.md) 负责复用 `user/message` 的决策依据。
| 事件 | 载荷 | 作用 |
|---|---|---|
@@ -81,7 +81,7 @@ interface CompactionResult {
type CompactionTrigger = 'pressure' | 'context-overflow'
```
`CompactionEngine` 暴露 `compactIfNeeded(agent, trigger, signal)` 以执行自动 `pressure` 或 `context-overflow` 策略,暴露 `compactNow(agent, signal)` 以便即使未达到压力也对空闲会话进行一次有效缩减,还针对显式、两端均包含的 surface 范围暴露 `compactRegion(...)`。`compactNow()` 作为轮次之间的 agent maintenance 运行;没有有效范围时返回 `null` 且不写入;在摘要前记录独立的 `turn: null` 标记对,并在后续排队提示词能够从新表层派生前 flush 已闭合尝试。每个后端都使用 `compactCheckpointSource(compactionId, sourceCommandId?)` 创建替换用 `user/message` 的源;client 与 wire 消费方从无 Cordis 的 `@deepseek-ai/dsh-compaction/checkpoint` 子路径导入该构造函数、`CompactionCheckpointSource` 和 `isCompactCheckpointSource()`,包根则为 host 消费方重新导出它们。必填的事务身份会关联替换检查点,而该判定函数使检查点识别不依赖任一特定后端。实现必须把传入的 signal 转发给摘要流程。该 seam 不拥有计价 API:单例 [`ctx.tokenMeter`](token-meter.zh.md) 直接拥有估算与回放,而 `dsh-compaction-basic` 拥有保留策略、事件排序、按路由执行的摘要调用及其配置。
`CompactionEngine` 暴露 `compactIfNeeded(agent, trigger, signal)` 以执行自动 `pressure` 或 `context-overflow` 策略,暴露 `compactNow(agent, signal)` 以便即使未达到压力也对空闲会话进行一次有效缩减,还针对显式指定、两端均包含的平衡选区暴露 `compactRegion(...)`,不含开头的系统消息。`compactNow()` 作为轮次之间的 agent maintenance 运行;没有有效范围时返回 `null` 且不写入;在摘要前记录独立的 `turn: null` 标记对,并在后续排队提示词能够从新表层派生前 flush 已闭合尝试。每个后端都使用 `compactCheckpointSource(compactionId, sourceCommandId?)` 创建替换用 `user/message` 的源;client 与 wire 消费方从无 Cordis 的 `@deepseek-ai/dsh-compaction/checkpoint` 子路径导入该构造函数、`CompactionCheckpointSource` 和 `isCompactCheckpointSource()`,包根则为 host 消费方重新导出它们。必填的事务身份会关联替换检查点,而该判定函数使检查点识别不依赖任一特定后端。实现必须把传入的 signal 转发给摘要流程。该 seam 不拥有计价 API:单例 [`ctx.tokenMeter`](token-meter.zh.md) 直接拥有估算与回放,而 `dsh-compaction-basic` 拥有保留策略、事件排序、按路由执行的摘要调用及其配置。
预期的手动失败使用 `ManualCompactionErrorCode`:
@@ -184,7 +184,8 @@ abstract compactIfNeeded( agent: CompactionAgentContext, trigger: CompactionTrig
abstract compactNow( agent: ManualCompactAgentContext, signal: AbortSignal, sourceCommandId?: CommandId, ): Promise<CompactionResult | null>
/**
* Forcibly compact a range of surface nodes into a single summary node.
* Compact a balanced range of conversation nodes into a single summary node.
* The initial system node, when present, lies outside the selected range.
* `start` and `end` name an inclusive span by surface position, not numeric seq
* order; replacements can make visible seqs non-monotonic. Both edges must be
* balanced so assistant tool calls remain paired with their results. A model-
+9 -9
View File
@@ -6,13 +6,13 @@
en: 989057ec9786a505
zh: 03e20367da473086
/llm-streaming/content-blocks-and-messages:
en: 365ecc228f756098
zh: 396e68661a789854
en: 451f5a4094996447
zh: 2cbbb538d1159066
/llm-streaming/streamchunk-the-raw-protocol:
en: a18fe401763efde4
zh: ef59a76d9c694654
/llm-streaming/compact-assistant-streams:
en: a2d35127e0b8ca72
en: ab4ea0563524a379
zh: fb1ba6e5a69adef7
/llm-streaming/llmfailure:
en: 13415501869b4ca9
@@ -27,20 +27,20 @@
en: cbab49d689311d4d
zh: 76246140eabaa55e
/llm-streaming/appidentity-app-attribution:
en: 2da6911c03ea8195
en: fbe63500e4eea1f9
zh: ae55da1a7e22be3a
/llm-streaming/tokenusage:
en: 33830f78fdb845fa
en: 0b09c6d47136d922
zh: f43a4502c4c3bfff
/llm-streaming/blockassembler:
en: 58dec2259b0b1c6f
zh: fc99fe965acaabf3
/llm-streaming/the-model-request:
en: 834d3d8d6b5871ab
zh: 393889ec6075f622
en: b7f90b15ee055c8a
zh: c0a3543ae86a8d98
/llm-streaming/the-model-request/the-request-envelope-llmcallconfig-and-the-logged-header:
en: b0eb4620c6953646
zh: fabf51c7245a4855
en: 311300c9bb9e2f12
zh: 1026adb49779ce60
/llm-streaming/official-deepseek-request-extensions:
en: 42bc50394b070e96
zh: 007caa743ec3c790
+14 -4
View File
@@ -72,6 +72,8 @@ type Message = MessageRoleMap[keyof MessageRoleMap]
`DeveloperMessage` records incremental agent session changes in conversation order with the `developer` role. `ToolAdditionBlock.toolName` activates the definition selected by the containing Session event's historical header reference; `ToolRemovalBlock.toolName` removes the active definition. Both blocks are rejected in other message roles. `deferLoading` independently requests deferred definition loading without requiring an addition record. See [Session](../../packages/core/session/README.md) for header binding and the [LLM package](../../packages/llm/llm/README.md#known-limitations-and-deferred-work) for provider support limits. `ToolUpdate` is `in-history` or `addition-only` on resolved and prepared model metadata. `GenerateOptions.toolHistory` carries `ToolHistory`: initial `tools` and ordered `updates`, each binding a developer `messageId` to its historically resolved `additions`. The runtime projects this state into provider declarations; it does not change the active tool list in logged headers.
`SystemPromptMessageSource.sections` associates active instructions and transition notices with named sources. Active records identify canonical text through `contentIndex`; source-owned notices use `noticeIndex`, including retirement notices whose record has no canonical text. The [system-prompt package](../../packages/core/system-prompt/README.md) owns index rules and committed-state reconstruction.
Where a message came from is itself a merge-extensible sum type:
```ts type-equiv
@@ -225,6 +227,8 @@ type StreamChunk =
Process-local `agent/assistant-stream` frames carry live presentation. Durable replay and restore validation still expand the embedded settlement; telemetry, token accounting, and Host folds read the compact records directly. Record-level readers (`assistantStreamFirstTokenTime`, `assistantStreamHasVisibleContent`, `assistantStreamHasVisibleText`, `lastAssistantStreamChunk`, `assistantStreamChunks`, `joinAssistantStreamText`, `assembleAssistantStream`, and the per-run `runFirstTokenTime` and `runFirstVisibleTime`) answer consumer questions in one pass over the records with early exit, so a large history costs O(records) per settlement instead of O(members) expansion ([fold reference](../../packages/llm/llm/README.md)). `expandAssistantStream()` remains the validating path for records read at a durable boundary and for consumers that need every member.
<a id="llmfailure"></a>
## `LlmFailure`
Every thrown or in-band final-adapter failure normalizes to one serializable provider-neutral payload. `providerRetryAfterMs` is a validated positive delay requested by the provider, not a retry decision; `ProviderRequestId` is an opaque branded string for diagnostics.
@@ -333,6 +337,8 @@ interface AppIdentity {
}
```
<a id="tokenusage"></a>
## `TokenUsage`
Per-call token accounting. Counts are **disjoint**: `inputTokens` is uncached input only; cached input is reported separately, and billed input is the sum of the three. Adapters whose providers fold cache hits into a single prompt total (DeepSeek's `prompt_tokens`) subtract them back out. Optional `totalTokens` is an exact aggregate prompt-plus-output count preserved from the provider or reconstructed from authoritative aggregate counters; adapters omit it when unavailable or inconsistent. `reasoningTokens`, when present, is informational detail already included in `outputTokens`; totals must not add it again.
@@ -363,6 +369,8 @@ interface TokenUsage {
}
```
<a id="blockassembler"></a>
## `BlockAssembler`
`BlockAssembler` ([`packages/llm/llm/src/assembler.ts`](../../packages/llm/llm/src/assembler.ts)) is the single shared implementation that folds a `StreamChunk` stream back into `ContentBlock`s, usage, finish reason, and replay state. The loop logs the raw chunks while feeding the same chunks through an assembler, then stores the assembled assistant content with the provider and model that produced it. A consumer that needs the assembled result without re-implementing the fold uses this.
@@ -568,7 +576,7 @@ interface LlmModelInfo {
}
```
Correctness-sensitive metadata is resolved separately from the advisory catalog and is owned by the adapter serving the exact route. Context capacity, adapter call defaults, reasoning choices, and the system prompt update mode share one exact-model result so consumers do not repeat authoritative model resolution. `SystemPromptUpdate` has the single value `'in-history'`: the model reads the latest `system` message at any position of `messages` as the complete effective system prompt, so the agent loop can append a changed prompt after the cached history instead of rewriting message 0 ([decision rule](../../packages/core/agent-loop/README.md#understand-the-implementation)); an absent mode means only a leading system message is read, and `normalizeModelInfo` rejects any other value with `INVALID_MODEL_INFO`.
Correctness-sensitive metadata is resolved separately from the advisory catalog and is owned by the adapter serving the exact route. Context capacity, adapter call defaults, reasoning choices, and the system prompt update mode share one exact-model result so consumers do not repeat authoritative model resolution. `SystemPromptUpdate` has the single value `'in-history'`, which declares native support for system updates within conversation history. System admission appends section changes independently of this capability; each update adds instructions or explicitly supersedes earlier ones, rather than implicitly replacing the whole prompt. When the mode is absent, the adapter represents these updates through its supported prompt or reminder format. `normalizeModelInfo` rejects any other mode with `INVALID_MODEL_INFO`.
```ts type-equiv
/** Provider-owned context capacity for one exact provider/model route. */
@@ -798,11 +806,13 @@ interface LlmDiscoveredModel {
### The request envelope: `LlmCallConfig` and the logged header
The loop builds each request from logged state. `EpochHeader` records call config, marks the fields supplied by adapter defaults, and records the authoritative returned tool order (configured by `toolOrder`, or lexicographic when unset) through full `request/header` snapshots. The rendered prompt is derived history — the `system/message` at surface node 0, plus any later system node an `in-history` route appended — so the header and the derived history together make the request reconstructable from the session log. See [session.md](session.md#the-request-header-event-requestheader) and the [reconstructability Agent Note](../../.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.md).
The loop builds each request from logged state. `EpochHeader` records call config, marks the fields supplied by adapter defaults, and records the authoritative returned tool order (configured by `toolOrder`, or lexicographic when unset) through full `request/header` snapshots. The system prompt is derived history: the initial `system/message` and subsequent section updates in surface order. Together, the header and derived history make the request reconstructable from the session log. See [session.md](session.md#the-request-header-event-requestheader) and the [reconstructability Agent Note](../../.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.md).
The deprecated `agent/request` hook remains available to existing listeners. New code selects models and reasoning effort through [Session model selection](../../packages/core/agent/README.md#use-this-package). The hook receives a frozen call-config seed based on the step's captured model selection and may replace controls such as sampling. A replacement must preserve provider, model, and the optional explicit reasoning effort; record a new Session selection before the next step to change them. Before the waterfall, the loop removes values marked as adapter defaults so exact-model preparation materializes the selected route's current values; unmarked explicit settings remain in the proposal. After the waterfall, preparation rejects unsupported explicit effort ids without clamping and logs the effective config plus the fields supplied by adapter defaults under the turn signal. On step admission, this waterfall and preparation run after assembly and `step/start` but before the system prompt and accepted user batch are committed; cancellation during either commits neither. The prepared capability governs prompt reconciliation, and the call keeps one adapter registration through dispatch. Requests reaching `llm/stream` are deep-frozen, so mutation throws, and carry a process-local loop identity so observers do not confuse separately logged frozen auxiliary calls with conversation requests.
The deprecated `agent/request` hook remains available to existing listeners. New code selects models and reasoning effort through [Session model selection](../../packages/core/agent/README.md#use-this-package). The hook receives a frozen call-config seed based on the step's captured model selection and may replace controls such as sampling. A replacement must preserve provider, model, and the optional explicit reasoning effort; record a new Session selection before the next step to change them. Before the waterfall, the loop removes values marked as adapter defaults so exact-model preparation materializes the selected route's current values; unmarked explicit settings remain in the proposal. After the waterfall, preparation rejects unsupported explicit effort ids without clamping and logs the effective config plus the fields supplied by adapter defaults under the turn signal. On step admission, this waterfall and preparation run after assembly and `step/start` but before the system prompt and accepted user batch are committed; cancellation during either commits neither. System admission uses the assembled section deltas without consulting the prepared capability, and the call keeps one adapter registration through dispatch. Requests reaching `llm/stream` are deep-frozen, so mutation throws, and carry a process-local loop identity so observers do not confuse separately logged frozen auxiliary calls with conversation requests.
On the wire, a loop-built request is the derived history alone: the rendered prompt travels as the leading `system`-role message (surface node 0, a `system/message` event) and, when the prepared call declares `systemPromptUpdate: 'in-history'`, a non-empty changed prompt may follow the cached history as a later `system`-role message that the model reads as the effective prompt; the request's `system` field is unset — `GenerateOptions.system` serves direct one-shot callers such as title providers. An empty rendering leaves no system messages in derived history, even when earlier requests retained several prompt versions. The logged request ends with the newest `user/message` on a turn's first step and the previous step's tool results on later steps.
At the adapter boundary, a loop-built request carries the derived history in `messages`; its `system` field is unset. `GenerateOptions.system` serves direct one-shot callers such as title providers. Section changes and retirement notices append system messages without deleting earlier instructions from history; their text tells the model which instructions remain applicable. An empty initial system node stays in the log but contributes no model message.
Adapters own separators in provider requests. The DeepSeek and pi-ai adapters trim each system text block, discard empty blocks, and join the remaining blocks with blank lines. DeepSeek merges leading system messages into its top-level `system` field and sends later updates natively when supported; otherwise it combines all system text in history order. pi-ai merges leading system messages into `systemPrompt` and represents later updates as native system messages or user-role system reminders. See [DeepSeek serialization](../../packages/llm/llm-deepseek/README.md) and [pi-ai history conversion](../../packages/llm/llm-pi-ai/README.md).
FIXME(call-config-shape): revisit which remaining fields are genuinely epoch-level for cache purposes (`model` and the model-owned reasoning effort are explicit; the sampling scalars sit here out of caution).
+8 -4
View File
@@ -72,6 +72,8 @@ type Message = MessageRoleMap[keyof MessageRoleMap]
`DeveloperMessage` 以 `developer` 角色按对话顺序记录增量智能体 Session 变更。`ToolAdditionBlock.toolName` 激活由所在 Session 事件的历史请求头引用所选定的定义;`ToolRemovalBlock.toolName` 移除当前生效的定义。其他消息角色拒绝这两种内容块。`deferLoading` 独立控制工具定义的加载请求,不要求存在添加记录。请求头绑定见 [Session](../../packages/core/session/README.zh.md),提供方支持限制见 [LLM 包](../../packages/llm/llm/README.zh.md#known-limitations-and-deferred-work)。 已解析和已准备模型元数据中的 `ToolUpdate` 为 `in-history` 或 `addition-only`。`GenerateOptions.toolHistory` 携带 `ToolHistory`:初始 `tools` 和有序 `updates`,每项把 developer `messageId` 绑定到已解析历史定义的 `additions`。运行时将此状态投影为提供方声明,不修改已记录请求头中的有效工具列表。
`SystemPromptMessageSource.sections` 将活跃指令与转换通知关联到具名来源。活跃记录通过 `contentIndex` 标识规范文本;来源拥有的通知使用 `noticeIndex`,其中退役通知的记录不包含规范文本。[system-prompt 包](../../packages/core/system-prompt/README.zh.md)负责索引规则与已提交状态的重建。
消息来源本身也是一个可合并扩展的和类型:
```ts type-equiv
@@ -574,7 +576,7 @@ interface LlmModelInfo {
}
```
对正确性敏感的元数据与参考目录分开解析,并归服务该确切路由的适配器所有。上下文容量、适配器调用默认值、推理选项和系统提示词更新模式共用同一个确切模型结果,消费方因而无需重复执行权威模型解析。`SystemPromptUpdate` 只有一个值 `'in-history'`:模型把 `messages` 中任意位置最新的 `system` 消息读作完整的有效系统提示词,因此 agent loop 可以把变化后的提示词追加到已缓存历史之后,而不是改写第 0 条消息([决策规则](../../packages/core/agent-loop/README.zh.md#understand-the-implementation));模式缺失表示只读取开头的 system 消息,`normalizeModelInfo` 以 `INVALID_MODEL_INFO` 拒绝任何其他值。
对正确性敏感的元数据与参考目录分开解析,并归服务该确切路由的适配器所有。上下文容量、适配器调用默认值、推理选项和系统提示词更新模式共用同一个确切模型结果,消费方因而无需重复执行权威模型解析。`SystemPromptUpdate` 只有一个值 `'in-history'`,声明原生支持对话历史中的系统更新。系统准入独立于该能力追加章节变化;每次更新增加指令或显式取代较早指令,而非隐式替换完整提示词。模式缺失时,适配器通过其支持的提示词或提醒格式表示这些更新。`normalizeModelInfo` 以 `INVALID_MODEL_INFO` 拒绝任何其他模式。
```ts type-equiv
/** Provider-owned context capacity for one exact provider/model route. */
@@ -804,11 +806,13 @@ interface LlmDiscoveredModel {
### 请求信封:`LlmCallConfig` 与记录的 header
循环从已记录状态构建每个请求。`EpochHeader` 记录调用配置,标记由适配器默认值提供的字段,并通过完整的 `request/header` 快照记录权威返回工具顺序(由 `toolOrder` 配置;未配置时按字典序)。渲染后的提示词是派生历史——surface 第 0 号节点上的 `system/message`,加上 `in-history` 路由追加的任何后续系统节点——因此请求头与派生历史共同使请求可由会话日志重建。见 [session.md](session.zh.md#the-request-header-event-requestheader) 与[可重建性 Agent Note](../../.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.zh.md)。
循环从已记录状态构建每个请求。`EpochHeader` 记录调用配置,标记由适配器默认值提供的字段,并通过完整的 `request/header` 快照记录权威返回工具顺序(由 `toolOrder` 配置;未配置时按字典序)。系统提示词是派生历史:按表面顺序排列的初始 `system/message` 与后续章节更新。请求头与派生历史共同使请求可由会话日志重建。见 [session.md](session.zh.md#the-request-header-event-requestheader) 与[可重建性 Agent Note](../../.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.zh.md)。
已弃用的 `agent/request` hook 仍可供现有监听器使用。新代码通过 [Session 模型选择](../../packages/core/agent/README.zh.md#use-this-package) 设置模型与推理强度。该 hook 收到基于步骤已捕获模型选择的冻结调用配置初值,可以替换采样等控制参数。替换值必须保留提供方、模型及可选的显式推理强度;要改变这些选择,需在下一个步骤之前记录新的 Session 选择。waterfall(瀑布式事件)开始前,循环会移除标记为适配器默认值的值,使确切模型准备过程填入所选路由的当前值;未带标记的显式设置仍保留在提议中。waterfall 结束后,准备过程会在轮次信号控制下拒绝显式指定但不受支持的推理强度 ID(不自动调整),并记录生效配置以及由适配器默认值提供的字段。步骤准入时,该 waterfall 与准备过程在组装和 `step/start` 之后、系统提示词与已接纳用户批次提交之前运行;在任一阶段取消都不会提交这两者。已准备调用的能力决定提示词协调,调用直至分派完成始终持有同一项适配器注册。到达 `llm/stream` 的请求会被深度冻结,因此变更会抛异常;请求还携带进程本地循环标识,使观察者不会把单独记录的冻结辅助调用误认成对话请求。
已弃用的 `agent/request` hook 仍可供现有监听器使用。新代码通过 [Session 模型选择](../../packages/core/agent/README.zh.md#use-this-package) 设置模型与推理强度。该 hook 收到基于步骤已捕获模型选择的冻结调用配置初值,可以替换采样等控制参数。替换值必须保留提供方、模型及可选的显式推理强度;要改变这些选择,需在下一个步骤之前记录新的 Session 选择。waterfall(瀑布式事件)开始前,循环会移除标记为适配器默认值的值,使确切模型准备过程填入所选路由的当前值;未带标记的显式设置仍保留在提议中。waterfall 结束后,准备过程会在轮次信号控制下拒绝显式指定但不受支持的推理强度 ID(不自动调整),并记录生效配置以及由适配器默认值提供的字段。步骤准入时,该 waterfall 与准备过程在组装和 `step/start` 之后、系统提示词与已接纳用户批次提交之前运行;在任一阶段取消都不会提交这两者。系统准入使用已组装的章节增量,不读取已准备调用的能力;调用直至分派完成始终持有同一项适配器注册。到达 `llm/stream` 的请求会被深度冻结,因此变更会抛异常;请求还携带进程本地循环标识,使观察者不会把单独记录的冻结辅助调用误认成对话请求。
在协议中,循环构建的请求只有派生历史:渲染后的提示词作为开头的 `system` 角色消息(surface 第 0 号节点,即一个 `system/message` 事件)传输,并且当已准备调用声明 `systemPromptUpdate: 'in-history'` 时,变化后的非空提示词可以作为后续的 `system` 角色消息跟在已缓存历史之后,由模型读作有效提示词;请求的 `system` 字段不设置——`GenerateOptions.system` 服务于标题提供方等直接单次调用方。空渲染文本使派生历史不包含任何系统消息,即使先前请求保留了多个提示词版本。已记录的请求会以最新的 `user/message`(轮次首步)或上一步的工具结果(后续步骤)结尾。
在适配器边界,循环构建的请求通过 `messages` 携带派生历史,不设置 `system` 字段。`GenerateOptions.system` 服务于标题提供方等直接单次调用方。章节变化与退出通知追加系统消息,不删除历史中的较早指令;其文本向模型说明哪些指令仍然适用。初始空系统节点保留在日志中,但不产生模型消息。
适配器负责提供方请求中的分隔符。DeepSeek 与 pi-ai 适配器会裁剪每个系统文本块,丢弃空块,并以空行连接其余块。DeepSeek 会将开头的系统消息合并到顶层 `system` 字段,并在支持时原生传输后续更新;不支持时,则将所有系统文本按历史顺序合并。pi-ai 会将开头的系统消息合并到 `systemPrompt`,并将后续更新表示为原生系统消息或 user 角色的系统提醒。详见 [DeepSeek 序列化](../../packages/llm/llm-deepseek/README.zh.md)与 [pi-ai 历史转换](../../packages/llm/llm-pi-ai/README.zh.md)。
FIXME(call-config-shape):重新审视其余哪些字段出于缓存目的确实属于 epoch 层级(`model` 和模型持有的推理强度已明确属于;采样标量目前出于谨慎保留在此)。
+1
View File
@@ -70,6 +70,7 @@ get(agent: Agent): { active: boolean; pending?: boolean }
* further in-turn pre-step runs. During an open turn the selection remains
* pending until the next accepted in-turn pre-step. Repeated selection of
* the current or already-pending state is a no-op.
* Each committed user selection contributes a user-switch notice.
*
* @param agent The agent to switch.
* @param active Whether plan mode should be active.
+1
View File
@@ -70,6 +70,7 @@ get(agent: Agent): { active: boolean; pending?: boolean }
* further in-turn pre-step runs. During an open turn the selection remains
* pending until the next accepted in-turn pre-step. Repeated selection of
* the current or already-pending state is a no-op.
* Each committed user selection contributes a user-switch notice.
*
* @param agent The agent to switch.
* @param active Whether plan mode should be active.
+10 -10
View File
@@ -9,23 +9,23 @@
en: 541354f6468e117d
zh: 2d7a665bad828a02
/sessions/sessioneventmap-the-event-vocabulary/the-request-header-event-request-header:
en: 6eb931fcb2f4ab8d
zh: d822a83384cc1fee
en: 62cd2a392c207fad
zh: 1496143dd0243d65
/sessions/sessioneventmap-the-event-vocabulary/the-route-capacity-event-request-context:
en: 7e21ea8bcdb16b7a
zh: a377774d3596dbeb
en: 4d3263765ecdc3ae
zh: bb5b8e3d7a4de532
/sessions/sessionevent-t-one-log-entry:
en: 622d333d9d903795
en: 0d233f94371bf05b
zh: fdc9ee663330f01e
/sessions/surface-types:
en: 55fa7be0643afc08
zh: 0bc544886c68cdb3
en: ee5e9670f6abda49
zh: 2cc665c78bdeeff6
/sessions/surface-types/surfaceeventtype-the-message-producing-subset-of-event-types:
en: 2f1b6a16a4ee7cc1
zh: 7f16b568c4aa940f
/sessions/surface-types/surfaceop-how-an-event-entered-the-surface:
en: 8fcc967516a13692
zh: d3978d3b8d02c566
en: 90c0a35e4e152679
zh: d962d2312f09b265
/sessions/surface-types/surfaceintent-the-parameter-to-session-append:
en: c65cc976acad9005
zh: 3efd10779881cba5
@@ -48,7 +48,7 @@
en: 45d1a9ee6d610ac5
zh: 79c061252fde4ceb
/sessions/live-session-fork-api:
en: 06189884c62a80a1
en: dd2828959411ceba
zh: 30121aed7a011c72
/sessions/why-a-turn-ended-turnendreasonmap:
en: 966cc60273fb3911
+31 -19
View File
@@ -62,18 +62,15 @@ interface SessionEventMap {
headerSeq?: SessionSeq
}
/**
* The rendered system prompt on the model-visible surface. The loop appends
* the first one as surface node 0 before the step's first `user/message`.
* A prepared in-history route can append nonempty changes in a continuing
* series. An incapable route, or a new series whose effective text differs,
* normalizes text to the first system node; a series start whose latest
* surviving node already holds the rendering leaves it in place.
* Normalization empties nonempty later nodes, then rewrites the head if
* needed, through logged per-node replacements. An empty rendering always
* clears all active system nodes, leaving no older instructions model-visible.
* Empty later nodes are dormant and project to no message; an empty head with
* no active later node records "no system prompt". Restored nonempty text follows
* the same route and series rule; empty nodes never restore older text.
* System instructions and notices on the model-visible surface. The first
* accepted assembly reserves node 0, even with empty content. Later admissions
* append new or changed sections independently of the route's capabilities.
* Source metadata identifies canonical text and notices; retired records remove
* a source from committed state. Empty active text withdraws its instructions
* while preserving the source. Earlier messages retain their positions.
* `source.reset` replaces committed state, including when compaction rebuilds
* the initial system node from current instructions.
* Empty system nodes remain in the surface but produce no model message.
*/
'system/message': { turn: number; step: number; message: SystemMessage }
/**
@@ -144,8 +141,8 @@ interface SessionEventMap {
/**
* Route metadata for the next request, logged only when the route, capacity,
* or system prompt update mode changes. It does not participate in request
* reconstruction or header equality. Prompt admission uses the bound prepared
* call's capability, not this snapshot from an earlier request.
* reconstruction, header equality, or system-section admission. The bound
* prepared call's capabilities determine adapter representation.
*/
'request/context': RequestContext
/**
@@ -182,12 +179,12 @@ interface SessionEventMap {
### The request header event: `request/header`
The request envelope — the `EpochHeader` (call config + markers for adapter-supplied defaults + assembled tool schemas) — is logged session state, so every conversation request is a pure function of the log (the reconstructability Agent Note). The rendered system prompt is not part of the header: it is derived history, the `system/message` event at surface node 0 and any later in-history system node ([decision](../../.agents/notes/implemented/architecture/2026-09-02-system-prompt-as-surface-node.md)), so a prompt change replaces or appends a system node and leaves the header unchanged. A full `request/header` snapshot with reason `'initial'` or `'resume'` records each loop-instance boundary; a changed request appends a snapshot with reason `'change'`; and an unchanged envelope beginning an explicitly declared message series or following a surface replacement appends a snapshot with reason `'series'`. An `'initial'`, `'resume'`, or `'change'` snapshot carries `startsSeries: true` when that request also begins a series; reason `'series'` already records that fact. Ordinary append-only later Turns, further Steps, and retries in the same model-message series inherit the latest snapshot. `foldRequestHeader(events)` reconstructs the header by selecting the latest snapshot. The event is not a `SurfaceEventType`: it produces no LLM message.
The request envelope — the `EpochHeader` (call config + markers for adapter-supplied defaults + assembled tool schemas) — is logged session state, so every conversation request is a pure function of the log (the reconstructability Agent Note). The rendered system prompt is not part of the header: it is derived history, the `system/message` event at surface node 0 and any later in-history system node ([decision](../../.agents/notes/implemented/architecture/2026-09-02-system-prompt-as-surface-node.md)), so ordinary prompt changes append system nodes and leave the header unchanged. A full `request/header` snapshot with reason `'initial'` or `'resume'` records each loop-instance boundary; a changed request appends a snapshot with reason `'change'`; and an unchanged envelope beginning an explicitly declared message series or following a surface replacement appends a snapshot with reason `'series'`. An `'initial'`, `'resume'`, or `'change'` snapshot carries `startsSeries: true` when that request also begins a series; reason `'series'` already records that fact. Ordinary append-only later Turns, further Steps, and retries in the same model-message series inherit the latest snapshot. `foldRequestHeader(events)` reconstructs the header by selecting the latest snapshot. The event is not a `SurfaceEventType`: it produces no LLM message.
```ts type-equiv
/**
* Logged request state outside derived history: call config and tools. The
* system prompt is derived history — surface node 0, a `system/message` event.
* system prompt is derived history — the initial and subsequent `system/message` nodes.
* The latest full `request/header` snapshot reconstructs the header; canonical
* empty optional fields are absent.
*/
@@ -209,7 +206,7 @@ Current event acceptance requires canonical `request/header.header`: any `system
### The route capacity event: `request/context`
The context metadata of the route a request resolved to is separate logged state, appended beside `request/header` inside the same step and only when the provider, model, capacity, or `systemPromptUpdate` mode differs from the previous record. It stays outside `EpochHeader` because that type is the reconstruction contract compared field-wise by `headerEquals`: capacity and the update mode describe a route, not a request input, so folding them in would let a route change register as a request-envelope `change` and would pull adapter metadata into the loop's request reconstruction. Like `request/header`, it is not a `SurfaceEventType` and produces no LLM message. `session.requestContext()` folds the latest record incrementally; the agent loop reads that record's `systemPromptUpdate` when it decides whether a changed system prompt replaces the latest system node or is appended after the cached history ([decision rule](../../packages/core/agent-loop/README.md#understand-the-implementation)). A route whose adapter advertises no capacity is recorded with `contextWindow` absent, so the new record clears an older route's capacity; a route without a declared update mode likewise clears an older route's `systemPromptUpdate`.
Route context metadata is separate logged state, appended beside `request/header` in the same step only when provider, model, capacity, or `systemPromptUpdate` changes. These fields describe the prepared route and remain outside `EpochHeader`; they do not select system admission or become LLM messages. `session.requestContext()` folds the latest record incrementally. An absent `contextWindow` or `systemPromptUpdate` clears the previous route’s corresponding value.
```ts type-equiv
/** Registration-bound metadata for one resolved model route. */
@@ -295,9 +292,11 @@ type SessionEvent<T extends SessionEventType = SessionEventType> = {
Every surface event requires `surfaceOp`; known log-only events forbid both surface metadata fields. Native unknown or obsolete ignorable envelopes remain opaque. `assistant/message` embeds its provider stream and forbids `sourceEventSeqs`. System, user, and tool surface events may cite a complete non-empty set of unique earlier events when source attribution or replacement coverage requires it. A `tool/result` may carry `data.error` only when its message has `isError: true`; failure identity remains optional for failed results.
<a id="surface-types"></a>
## Surface types
The message-producing types (`SurfaceEventType` — `system/message`, `developer/message`, `user/message`, `assistant/message`, `tool/result`) carry surface metadata declaring how they join the ordered derived surface. `system/message` holds the rendered system prompt: the loop appends the first one as surface node 0 and, when the prompt changes, replaces exactly the latest system node or appends a new one on an in-history route; the surface fold rejects any other replacement covering a `system/message` at node 0, while a later system node is ordinary history that a compaction replacement may shadow. See the [session surface Agent Note](../../.agents/notes/implemented/architecture/2026-06-18-session-surface.md).
Message-producing types (`SurfaceEventType`: `system/message`, `developer/message`, `user/message`, `assistant/message`, `tool/result`) declare placement in the ordered derived surface. System messages contain section updates and full resets; the [system-prompt package](../../packages/core/system-prompt/README.md) owns their meaning. A system message at node 0 permits only a system replacement over exactly that node; later system nodes can be shadowed by compaction. See the [session surface Agent Note](../../.agents/notes/implemented/architecture/2026-06-18-session-surface.md).
### `SurfaceEventType` — the message-producing subset of event types
@@ -337,7 +336,7 @@ type SurfaceOp =
| { op: 'replace'; startSeq: SessionSeq; endSeq: SessionSeq }
```
`'append'` is the normal tail-append path. `replace` contains exactly `op`, `startSeq`, and `endSeq`, with no aliases or extra keys. It shadows the inclusive span between those current surface event sequences and inserts the new event in their place; equal endpoints replace one entry. Endpoints must precede the replacing event, but their relative order is surface order, not numeric sequence order.
`'append'` adds at the tail. `replace` has exactly `op`, `startSeq`, and `endSeq`; it shadows the inclusive span between current surface nodes and inserts the new event in their place. Equal endpoints replace one entry. All referenced events must precede the new event in the log. Positions follow surface order, not numeric sequence order.
### `SurfaceIntent` — the parameter to `session.append()`
@@ -403,11 +402,22 @@ interface SessionMessageProjection<T extends SessionEventType = SessionEventType
`SurfaceManager(log, baseSeq?, projections?)` can instead fold a contiguous loaded window whose first event has the absolute sequence `baseSeq`. Every event remains contiguous in that absolute sequence space, and a replacement that crosses the window head fails because its declared range is absent.
```ts type-equiv
/** One system node on the current surface, including an empty head. */
interface SystemSurfaceNode {
readonly seq: SessionSeq
/** Whether the logged content array has no blocks; a node with empty text blocks is not empty. */
readonly isEmpty: boolean
}
```
```ts type-equiv
/** Readonly live projection of the message-producing session events. */
interface SessionSurface {
/** Current surface event sequences in model-visible order. */
readonly nodes: readonly SessionSeq[]
/** Current system nodes in surface order, scanned from the surface on each read; citations do not affect membership. */
readonly systemNodes: readonly SystemSurfaceNode[]
/** Monotonic count of committed positional replacements. */
readonly replaceGeneration: number
/** Monotonic count of committed replacements and plugin-owned message changes. */
@@ -712,6 +722,8 @@ Everything else (`turn/*`, `step/*`, `assistant/attempt`, plugin-owned `llm/retr
An explicit `boundary` lets callers fork from any stable between-turn position, including a previous `turn/end` or a later standalone log-only event, even if the source has newer events or an open current turn. The API rejects a prefix that ends inside an open turn instead of clipping silently. `dsh-subagent-fork-in-process` keeps its completed-prefix clipping because tool-time delegation usually starts while the parent turn is open; ordinary session branching should make the requested boundary explicit.
<a id="why-a-turn-ended-turnendreasonmap"></a>
## Why a turn ended: `TurnEndReasonMap`
`turn/start` has no trigger field. The entered `user/message` batch records what entered each step, `llm/retry` records request recovery, and idle injection remains pending until a waking delivery reaches a later pre-step. Live turns retain the typed [`AgentCancelCause`](core.md#the-agent-handle) that stopped the driver; persistence uses the additional `{ kind: 'legacy' }` cause only when importing a supported coarse cancellation record that did not store its caller.
+27 -19
View File
@@ -62,18 +62,15 @@ interface SessionEventMap {
headerSeq?: SessionSeq
}
/**
* The rendered system prompt on the model-visible surface. The loop appends
* the first one as surface node 0 before the step's first `user/message`.
* A prepared in-history route can append nonempty changes in a continuing
* series. An incapable route, or a new series whose effective text differs,
* normalizes text to the first system node; a series start whose latest
* surviving node already holds the rendering leaves it in place.
* Normalization empties nonempty later nodes, then rewrites the head if
* needed, through logged per-node replacements. An empty rendering always
* clears all active system nodes, leaving no older instructions model-visible.
* Empty later nodes are dormant and project to no message; an empty head with
* no active later node records "no system prompt". Restored nonempty text follows
* the same route and series rule; empty nodes never restore older text.
* System instructions and notices on the model-visible surface. The first
* accepted assembly reserves node 0, even with empty content. Later admissions
* append new or changed sections independently of the route's capabilities.
* Source metadata identifies canonical text and notices; retired records remove
* a source from committed state. Empty active text withdraws its instructions
* while preserving the source. Earlier messages retain their positions.
* `source.reset` replaces committed state, including when compaction rebuilds
* the initial system node from current instructions.
* Empty system nodes remain in the surface but produce no model message.
*/
'system/message': { turn: number; step: number; message: SystemMessage }
/**
@@ -144,8 +141,8 @@ interface SessionEventMap {
/**
* Route metadata for the next request, logged only when the route, capacity,
* or system prompt update mode changes. It does not participate in request
* reconstruction or header equality. Prompt admission uses the bound prepared
* call's capability, not this snapshot from an earlier request.
* reconstruction, header equality, or system-section admission. The bound
* prepared call's capabilities determine adapter representation.
*/
'request/context': RequestContext
/**
@@ -182,12 +179,12 @@ interface SessionEventMap {
### 请求头事件:`request/header`
请求信封(即 `EpochHeader`:调用配置 + 适配器所提供默认值的标记 + 已组装的工具 schema)会作为会话状态写入日志,因此每个对话请求都是日志的纯函数(见可重建性 Agent Note)。渲染后的系统提示词不属于请求头:它是派生历史,即 surface 第 0 号节点上的 `system/message` 事件以及任何后续的历史内系统节点([决策](../../.agents/notes/implemented/architecture/2026-09-02-system-prompt-as-surface-node.zh.md)),因此提示词变更替换或追加一个系统节点,而请求头保持不变。带有 reason `'initial'` 或 `'resume'` 的完整 `request/header` 快照记录每个 agent loop 实例的边界;请求变化时会追加 reason 为 `'change'` 的快照;未变的信封显式开启消息序列或跟随 surface 替换时,会追加 reason 为 `'series'` 的快照。如果 `'initial'`、`'resume'` 或 `'change'` 快照所属请求同时开启序列,它会携带 `startsSeries: true`;reason `'series'` 已记录这一事实。普通的仅追加后续 Turn,以及同一模型消息序列内的后续 Step 与重试沿用最新快照。`foldRequestHeader(events)` 通过选择最新快照重建请求头。该事件不是 `SurfaceEventType`,不产生 LLM 消息。
请求信封(即 `EpochHeader`:调用配置 + 适配器所提供默认值的标记 + 已组装的工具 schema)会作为会话状态写入日志,因此每个对话请求都是日志的纯函数(见可重建性 Agent Note)。渲染后的系统提示词不属于请求头:它是派生历史,即 surface 第 0 号节点上的 `system/message` 事件以及任何后续的历史内系统节点([决策](../../.agents/notes/implemented/architecture/2026-09-02-system-prompt-as-surface-node.zh.md)),因此普通提示词变更追加系统节点,而请求头保持不变。带有 reason `'initial'` 或 `'resume'` 的完整 `request/header` 快照记录每个 agent loop 实例的边界;请求变化时会追加 reason 为 `'change'` 的快照;未变的信封显式开启消息序列或跟随 surface 替换时,会追加 reason 为 `'series'` 的快照。如果 `'initial'`、`'resume'` 或 `'change'` 快照所属请求同时开启序列,它会携带 `startsSeries: true`;reason `'series'` 已记录这一事实。普通的仅追加后续 Turn,以及同一模型消息序列内的后续 Step 与重试沿用最新快照。`foldRequestHeader(events)` 通过选择最新快照重建请求头。该事件不是 `SurfaceEventType`,不产生 LLM 消息。
```ts type-equiv
/**
* Logged request state outside derived history: call config and tools. The
* system prompt is derived history — surface node 0, a `system/message` event.
* system prompt is derived history — the initial and subsequent `system/message` nodes.
* The latest full `request/header` snapshot reconstructs the header; canonical
* empty optional fields are absent.
*/
@@ -209,7 +206,7 @@ interface EpochHeader {
### 路由容量事件:`request/context`
请求所解析到的路由的上下文元数据是独立的已记录状态,在同一步骤内紧随 `request/header` 追加,且仅在提供方、模型、容量或 `systemPromptUpdate` 模式与上一条记录不同时追加。它保持在 `EpochHeader` 之外,因为该类型是 `headerEquals` 逐字段比较的重建约定。容量与更新模式描述的是路由,不是请求输入,把它们折叠进去会让一次路由变化被登记为请求信封的 `change`,也会把适配器元数据拉进 loop 的请求重建。与 `request/header` 一样,它不是 `SurfaceEventType`,也不产生 LLM 消息。`session.requestContext()` 以增量方式归并最新一条记录;agent loop 在决定变化后的系统提示词是替换最新的系统节点还是追加到已缓存历史之后时,读取该记录的 `systemPromptUpdate`([决策规则](../../packages/core/agent-loop/README.zh.md#understand-the-implementation))。适配器不公布容量的路由会以缺失 `contextWindow` 的形式记录,因此新记录可以清除较早路由的容量;未声明更新模式的路由同样会清除较早路由的 `systemPromptUpdate`。
路由上下文元数据是独立的已记录状态,仅在提供方、模型、容量或 `systemPromptUpdate` 变化时,于同一步骤内紧随 `request/header` 追加。这些字段描述已准备路由,位于 `EpochHeader` 之外;它们不选择系统准入,也不产生 LLM 消息。`session.requestContext()` 以增量方式归并最新记录。缺失的 `contextWindow` 或 `systemPromptUpdate` 会清除上一条路由的对应值。
```ts type-equiv
/** Registration-bound metadata for one resolved model route. */
@@ -299,7 +296,7 @@ type SessionEvent<T extends SessionEventType = SessionEventType> = {
## Surface 类型
产生消息的类型(`SurfaceEventType`:`system/message`、`developer/message`、`user/message`、`assistant/message`、`tool/result`)携带 surface 元数据,用来声明它们如何加入有序的派生 surface。`system/message` 承载渲染后的系统提示词:循环把第一条追加为 surface 第 0 号节点,并在提示词变化时恰好替换最新的系统节点,或在历史内路由上追加一条新的;surface 折叠拒绝任何其他覆盖第 0 号节点 `system/message` 的替换,而后续系统节点是普通历史,压缩替换可以遮蔽它。见 [session surface Agent Note](../../.agents/notes/implemented/architecture/2026-06-18-session-surface.zh.md)。
产生消息的类型(`SurfaceEventType`:`system/message`、`developer/message`、`user/message`、`assistant/message`、`tool/result`)声明其在有序派生 surface 中的位置。系统消息包含段更新和完整重置;[system-prompt 包](../../packages/core/system-prompt/README.zh.md) 规定其含义。第 0 号节点的系统消息只允许系统消息恰好替换该节点;后续系统节点可以被压缩遮蔽。见 [session surface Agent Note](../../.agents/notes/implemented/architecture/2026-06-18-session-surface.zh.md)。
### `SurfaceEventType`:事件类型中产生消息的子集
@@ -339,7 +336,7 @@ type SurfaceOp =
| { op: 'replace'; startSeq: SessionSeq; endSeq: SessionSeq }
```
`'append'` 是常规的尾部追加路径。`replace` 恰好包含 `op`、`startSeq` 和 `endSeq`,不接受别名或额外键。它遮蔽这两个当前 surface 事件序号之间的闭区间,并在原位置插入新事件;相同端点仅替换一个条目。端点必须早于替换事件,但它们的相对顺序按 surface 顺序而非数值序号顺序确定。
`'append'` 在尾部追加。`replace` 恰好包含 `op`、`startSeq` 和 `endSeq`;它遮蔽两个当前 surface 节点之间的闭区间,并在原位置插入新事件。相同端点仅替换一个条目。所有引用的事件都必须在日志中早于新事件。位置按 surface 顺序而非数值序号顺序确定。
### `SurfaceIntent`:`session.append()` 的参数
@@ -405,11 +402,22 @@ interface SessionMessageProjection<T extends SessionEventType = SessionEventType
`SurfaceManager(log, baseSeq?, projections?)` 也可以折叠一个连续的已加载窗口,其第一个事件的绝对序号为 `baseSeq`。每个事件在该绝对序号空间中仍保持连续;如果替换跨过窗口头部,由于其声明的范围并不存在,该替换会失败。
```ts type-equiv
/** One system node on the current surface, including an empty head. */
interface SystemSurfaceNode {
readonly seq: SessionSeq
/** Whether the logged content array has no blocks; a node with empty text blocks is not empty. */
readonly isEmpty: boolean
}
```
```ts type-equiv
/** Readonly live projection of the message-producing session events. */
interface SessionSurface {
/** Current surface event sequences in model-visible order. */
readonly nodes: readonly SessionSeq[]
/** Current system nodes in surface order, scanned from the surface on each read; citations do not affect membership. */
readonly systemNodes: readonly SystemSurfaceNode[]
/** Monotonic count of committed positional replacements. */
readonly replaceGeneration: number
/** Monotonic count of committed replacements and plugin-owned message changes. */
+4 -4
View File
@@ -6,14 +6,14 @@
en: 7ad02b2146520e7b
zh: 93cb93c7aa12ceb4
/system-prompt-assembly/assembly-context:
en: 26585a8664060a19
zh: 2bbe792ef28f40e3
en: 33dc560081027ecc
zh: 320c0c301e78d96c
/system-prompt-assembly/tool-provider-result:
en: 89cb015bf2e3e7a5
zh: b4340e853b34c777
/system-prompt-assembly/prompt-sections:
en: e31de7452a4f1186
zh: db697d4db7f88642
en: c2a1cac6eeab6f7c
zh: ac356ac548825dd3
/system-prompt-assembly/dynamic-prompt-context:
en: 2abb13dec8e6d041
zh: 8cf434f360d8a519
+36 -19
View File
@@ -8,11 +8,13 @@ Source: [`packages/core/system-prompt/src/index.ts`](../../packages/core/system-
## Assembly context
`AssembleContext` identifies the scope layer one assembly resolves and may carry the explicit control signal for that request. It is merge-extensible: `dsh-agent` adds optional `agent` and `modelSelection` fields. `assembleContextFor(agent, signal)` sets the agent, scope, and signal; the loop supplies the model selection captured for the step and retained across retries, with omitted reasoning effort using adapter defaults. A bare assembly has neither scope nor signal.
`AssembleContext` identifies the scope and optional Session receiving one assembly. With a Session, the assembly’s `systemUpdates()` compares the captured sections with that Session’s committed state when called; without one, it returns no writes. The context is merge-extensible: `dsh-agent` adds optional `agent` and `modelSelection` fields. `assembleContextFor(agent, signal)` supplies the agent, Session, scope, and signal; the loop adds the model selection retained across retries, with omitted reasoning effort using adapter defaults.
```ts type-equiv
/** Merge-extensible context for one prompt assembly. */
interface AssembleContext {
/** Session receiving system updates; omission produces a registry-only presentation. */
session?: Session
/**
* Scope whose providers and waterfall listeners participate. When absent,
* only global providers and subject-less listeners participate.
@@ -41,14 +43,14 @@ interface ToolProviderResult {
## Prompt sections
The exported `PERSONA_PREFIX_SECTION` (`deployment:persona-prefix`) and `PERSONA_SUFFIX_SECTION` (`deployment:persona-suffix`) name the slots shared by global configuration and scoped contributions. Their `PromptSectionOrderName` entries are `DEPLOYMENT_PERSONA_PREFIX` and `DEPLOYMENT_PERSONA_SUFFIX`; the [package README](../../packages/core/system-prompt/README.md#configure-the-prompt) owns their placement and template configuration.
The exported `PERSONA_PREFIX_SECTION` (`deployment:persona-prefix`) and `PERSONA_SUFFIX_SECTION` (`deployment:persona-suffix`) name ordinary sections whose deployment defaults are registered by the system service. Plugins override either name through `section()`; prefix registrations may carry complete mode. Their `PromptSectionOrderName` entries are `DEPLOYMENT_PERSONA_PREFIX` and `DEPLOYMENT_PERSONA_SUFFIX`; the [package README](../../packages/core/system-prompt/README.md#configure-the-prompt) owns placement and template configuration.
`PromptSection` is a readonly same-process registration contract. Its text may be static or resolved from the current assembly context. Sections sort by ascending order and then code-unit name; repository contributors resolve the service-owned named allocation through `getSectionOrder()`. Runtime-context contributors resolve their independent allocation through `getContextOrder()`. One effective `complete` section becomes the sole prompt section after cooperative assembly. agent-loop renders the assembled sections with `renderPrompt` and commits the text as a `system/message` surface node — appended as surface node 0 on the first step, then replaced in place when the rendered text changes or, when the prepared call declares `systemPromptUpdate: 'in-history'`, appended after the cached history for non-empty updates in a continuing series — so the prompt reaches the model as a message of derived history rather than as a request field ([decision](../../.agents/notes/implemented/architecture/2026-09-02-system-prompt-as-surface-node.md); [decision rule](../../packages/core/agent-loop/README.md#understand-the-implementation)).
`PromptSection` registers text and optional replacement and retirement notices. The nearest scope wins a name; within that scope, the latest live registration wins. `AssembledSection` retains `name` and `order` with resolved text; `PromptAssembly` adds provider-owned tools and `systemUpdates()` to the waterfall’s `PromptPresentation`. Each returned `SystemUpdate` pairs one system message with its surface intent: ordinary deltas append, while a rebuild empties later system nodes and then replaces the head with one full prompt. The comparison uses the captured source state and that Session’s committed text at the time of the call. Cordis disposal removes one registration; assembly selects retirement only for a committed name with no remaining visible registration. Committing retirement removes that name from the latest projection. After compaction, the next model attempt commits a full reset from the captured sources as the baseline for later comparisons. The [package README](../../packages/core/system-prompt/README.md) owns timing, canonical content-block metadata, and reconstruction semantics.
```ts type-equiv
/** One contributed section of the system prompt (registry input). */
interface PromptSection {
/** Unique name — a duplicate registration throws (see {@link SystemPrompt.section}). */
/** Logical source name; the nearest scope and latest registration in that scope win. */
readonly name: string
/**
* Sections are concatenated in ascending order. Equal orders use code-unit
@@ -56,9 +58,10 @@ interface PromptSection {
*/
readonly order: number
/**
* Static text or a provider evaluated at each assembly with that assembly's
* {@link AssembleContext}. The text may reference `{{variable}}`s — they are
* interpolated later, by {@link renderPrompt}, unless `interpolate` is false.
* Static text or a provider evaluated with that assembly's {@link AssembleContext}
* only while this registration is effective. The text may reference `{{variable}}`s — they are
* interpolated later unless `interpolate` is false, then trimmed before rendering
* and admission. Interior whitespace is preserved.
*/
readonly text: string | ((context: AssembleContext) => string)
/** Whether to interpolate prompt variables. Defaults to true; false preserves literal text. */
@@ -67,9 +70,20 @@ interface PromptSection {
* Treat this contribution as the complete system prompt. Assembly still
* runs the cooperative waterfall so tools, contexts, and variables can be
* resolved, then restores this exact section as the sole prompt section.
* Admission appends prospective supersession notices on entry, changes,
* and exit; earlier messages retain their positions until compaction.
* More than one effective complete section makes assembly fail.
*/
readonly complete?: boolean
/** Optional trimmed notice before changed text; blank text suppresses this notice. */
readonly replacement?: string
/**
* Literal notice, nonempty after trimming, sent when no visible registration remains
* to Sessions that previously admitted this name. The last disposed definition captured
* by the Session supplies the notice; omission uses a notice naming the section.
* A remaining or newly registered definition is compared as ordinary source text.
*/
readonly retirement?: string
}
```
@@ -123,12 +137,11 @@ Registry service for the prompt inputs assembled before each model step.
```ts cordis-catalog
/**
* Register an ordered prompt section in the calling context's scope. A scoped
* section shadows a global section with the same name; duplicates within one
* layer and non-finite orders throw. Registration and disposal emit
* `system-prompt/change`.
* @param section - the section to register.
* @returns the exact Cordis effect disposer.
* Register a section; the nearest scope wins, then the latest registration
* within that scope. Disposal reveals the next live definition. Retirement
* is admitted only after no registration remains in the visible scope chain.
* @param section - definition, canonical order and optional transition notices.
* @returns the exact Cordis disposer; retirement is observed at later assembly.
*/
section(section: PromptSection): () => void
@@ -195,12 +208,13 @@ refreshContext(assembly: PromptAssembly, context: AssembleContext = {}): PromptA
/**
* Assemble global and scoped providers, detach tool parameters, apply
* canonical ordering, then run the presentation waterfall. Scoped sections
* and variables shadow globals. The waterfall's text is authoritative except
* canonical ordering, then run the presentation waterfall. Scoped variables
* shadow globals; section IDs have one effective owner. The waterfall's text is authoritative except
* that an effective complete section is restored afterwards as the sole
* prompt section; tool declarations stay provider-owned.
* prompt section; tool declarations stay provider-owned. Section text and
* lifecycle are fixed here; `systemUpdates()` compares them with committed state later.
* @param context - the optional scope, step tool set, and plugin-defined assembly fields.
* @returns the post-waterfall assembly with ordered tool declarations and any complete prompt enforced.
* @returns the post-waterfall presentation and the system updates for the supplied Session.
*/
async assemble(context: AssembleContext = {}): Promise<PromptAssembly>
```
@@ -215,13 +229,16 @@ Source: [`packages/core/system-prompt/src/index.ts`](../../packages/core/system-
#### `system-prompt/assemble` — waterfall
Presentation waterfall over assembled sections, contexts, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope's assemblies. The returned text is authoritative; tool declarations remain provider-owned. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope's system prompt.
Presentation waterfall over assembled sections, contexts, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope's assemblies. Returned section text determines updates; omitting a previously admitted section leaves its instructions unchanged. Empty text withdraws its instructions; registration disposal retires it. Tool declarations remain provider-owned. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope's system prompt.
```ts cordis-catalog
/**
* Presentation waterfall over assembled sections, contexts, and variables.
* Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners
* receive only that scope's assemblies. The returned text is authoritative; tool declarations remain provider-owned.
* receive only that scope's assemblies. Returned section text determines updates;
* omitting a previously admitted section leaves its instructions unchanged.
* Empty text withdraws its instructions; registration disposal retires it.
* Tool declarations remain provider-owned.
* A supplied signal controls only this explicit assembly request and must not
* be retained to control later turns. A registered complete section is
* restored after this waterfall, so listeners cannot add to or replace
+36 -19
View File
@@ -8,11 +8,13 @@
## 组装上下文
`AssembleContext` 标识一次组装所解析的作用域层,并可携带该请求的显式控制信号。它可合并扩展:`dsh-agent` 添加可选字段 `agent` 和 `modelSelection`。`assembleContextFor(agent, signal)` 设置 agent(智能体)、作用域和信号;循环提供为该步骤捕获并在重试期间保留的模型选择,省略推理强度时使用适配器默认值。裸组装既没有作用域,也没有信号。
`AssembleContext` 标识一次组装的作用域及可选接收 Session。传入 Session 时,组装结果的 `systemUpdates()` 在调用时将捕获的段与该 Session 的已提交状态比较;未传入时,它不返回写入。该上下文可合并扩展:`dsh-agent` 添加可选字段 `agent` 和 `modelSelection`。`assembleContextFor(agent, signal)` 提供 agent、Session、作用域与信号;循环添加重试期间保留的模型选择,省略推理强度时使用适配器默认值。
```ts type-equiv
/** Merge-extensible context for one prompt assembly. */
interface AssembleContext {
/** Session receiving system updates; omission produces a registry-only presentation. */
session?: Session
/**
* Scope whose providers and waterfall listeners participate. When absent,
* only global providers and subject-less listeners participate.
@@ -41,14 +43,14 @@ interface ToolProviderResult {
## 提示词段落
导出的 `PERSONA_PREFIX_SECTION`(`deployment:persona-prefix`)与 `PERSONA_SUFFIX_SECTION`(`deployment:persona-suffix`)为全局配置和带作用域贡献所共享的段落命名。它们对应的 `PromptSectionOrderName` 项为 `DEPLOYMENT_PERSONA_PREFIX` 与 `DEPLOYMENT_PERSONA_SUFFIX`;[包 README](../../packages/core/system-prompt/README.zh.md#configure-the-prompt)规定其位置与模板配置。
导出的 `PERSONA_PREFIX_SECTION`(`deployment:persona-prefix`)与 `PERSONA_SUFFIX_SECTION`(`deployment:persona-suffix`)为普通段命名,其部署默认值由系统服务注册。插件通过 `section()` 覆盖任一名称;前缀注册可携带完整模式。它们对应的 `PromptSectionOrderName` 项为 `DEPLOYMENT_PERSONA_PREFIX` 与 `DEPLOYMENT_PERSONA_SUFFIX`;[包 README](../../packages/core/system-prompt/README.zh.md#configure-the-prompt) 规定位置与模板配置。
`PromptSection` 是一份只读的同进程注册约定。其文本可以是静态的,也可以从当前组装上下文动态解析。各段先按 order 升序排列,再按名称的代码单元顺序排列;仓库贡献方通过 `getSectionOrder()` 解析服务持有的具名分配。Runtime-context 贡献方通过 `getContextOrder()` 解析独立分配。协作式组装完成后,一个有效的 `complete` 段会成为唯一的提示词段落。agent loop(智能体循环)用 `renderPrompt` 渲染组装后的各段,并把文本作为 `system/message` surface 节点提交——首个步骤作为 surface 第 0 号节点追加,之后在渲染文本变化时原地替换,或者当已准备调用声明 `systemPromptUpdate: 'in-history'` 时,在序列延续期间把非空更新追加到已缓存历史之后——因此提示词作为派生历史中的消息而不是请求字段到达模型([决策](../../.agents/notes/implemented/architecture/2026-09-02-system-prompt-as-surface-node.zh.md);[决策规则](../../packages/core/agent-loop/README.zh.md#understand-the-implementation))。
`PromptSection` 注册文本以及可选的替换和退役通知。同名来源由最近作用域覆盖;同一作用域内,最后一个活跃注册生效。`AssembledSection` 在已求值文本之外保留 `name` 与 `order`;`PromptAssembly` 在 waterfall 的 `PromptPresentation` 上添加提供方拥有的工具和 `systemUpdates()`。返回的每个 `SystemUpdate` 包含一条系统消息及其 surface 意图:普通增量为追加,重建则先清空后续系统节点,再以一份完整提示词替换头节点。比较使用捕获的来源状态与调用时该 Session 的已提交文本。Cordis 清理移除一个注册;组装只为已提交且不再有可见注册的名称选择退役。提交退役后,该名称从最新投影移除。压缩后,下一次模型尝试根据捕获的来源提交完整重置,作为后续比较的基线。[包 README](../../packages/core/system-prompt/README.zh.md) 规定时序、纯段内容块元数据与重建语义。
```ts type-equiv
/** One contributed section of the system prompt (registry input). */
interface PromptSection {
/** Unique name — a duplicate registration throws (see {@link SystemPrompt.section}). */
/** Logical source name; the nearest scope and latest registration in that scope win. */
readonly name: string
/**
* Sections are concatenated in ascending order. Equal orders use code-unit
@@ -56,9 +58,10 @@ interface PromptSection {
*/
readonly order: number
/**
* Static text or a provider evaluated at each assembly with that assembly's
* {@link AssembleContext}. The text may reference `{{variable}}`s — they are
* interpolated later, by {@link renderPrompt}, unless `interpolate` is false.
* Static text or a provider evaluated with that assembly's {@link AssembleContext}
* only while this registration is effective. The text may reference `{{variable}}`s — they are
* interpolated later unless `interpolate` is false, then trimmed before rendering
* and admission. Interior whitespace is preserved.
*/
readonly text: string | ((context: AssembleContext) => string)
/** Whether to interpolate prompt variables. Defaults to true; false preserves literal text. */
@@ -67,9 +70,20 @@ interface PromptSection {
* Treat this contribution as the complete system prompt. Assembly still
* runs the cooperative waterfall so tools, contexts, and variables can be
* resolved, then restores this exact section as the sole prompt section.
* Admission appends prospective supersession notices on entry, changes,
* and exit; earlier messages retain their positions until compaction.
* More than one effective complete section makes assembly fail.
*/
readonly complete?: boolean
/** Optional trimmed notice before changed text; blank text suppresses this notice. */
readonly replacement?: string
/**
* Literal notice, nonempty after trimming, sent when no visible registration remains
* to Sessions that previously admitted this name. The last disposed definition captured
* by the Session supplies the notice; omission uses a notice naming the section.
* A remaining or newly registered definition is compared as ordinary source text.
*/
readonly retirement?: string
}
```
@@ -123,12 +137,11 @@ Registry service for the prompt inputs assembled before each model step.
```ts cordis-catalog
/**
* Register an ordered prompt section in the calling context's scope. A scoped
* section shadows a global section with the same name; duplicates within one
* layer and non-finite orders throw. Registration and disposal emit
* `system-prompt/change`.
* @param section - the section to register.
* @returns the exact Cordis effect disposer.
* Register a section; the nearest scope wins, then the latest registration
* within that scope. Disposal reveals the next live definition. Retirement
* is admitted only after no registration remains in the visible scope chain.
* @param section - definition, canonical order and optional transition notices.
* @returns the exact Cordis disposer; retirement is observed at later assembly.
*/
section(section: PromptSection): () => void
@@ -195,12 +208,13 @@ refreshContext(assembly: PromptAssembly, context: AssembleContext = {}): PromptA
/**
* Assemble global and scoped providers, detach tool parameters, apply
* canonical ordering, then run the presentation waterfall. Scoped sections
* and variables shadow globals. The waterfall's text is authoritative except
* canonical ordering, then run the presentation waterfall. Scoped variables
* shadow globals; section IDs have one effective owner. The waterfall's text is authoritative except
* that an effective complete section is restored afterwards as the sole
* prompt section; tool declarations stay provider-owned.
* prompt section; tool declarations stay provider-owned. Section text and
* lifecycle are fixed here; `systemUpdates()` compares them with committed state later.
* @param context - the optional scope, step tool set, and plugin-defined assembly fields.
* @returns the post-waterfall assembly with ordered tool declarations and any complete prompt enforced.
* @returns the post-waterfall presentation and the system updates for the supplied Session.
*/
async assemble(context: AssembleContext = {}): Promise<PromptAssembly>
```
@@ -215,13 +229,16 @@ Source: [`packages/core/system-prompt/src/index.ts`](../../packages/core/system-
#### `system-prompt/assemble` — waterfall
Presentation waterfall over assembled sections, contexts, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope's assemblies. The returned text is authoritative; tool declarations remain provider-owned. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope's system prompt.
Presentation waterfall over assembled sections, contexts, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope's assemblies. Returned section text determines updates; omitting a previously admitted section leaves its instructions unchanged. Empty text withdraws its instructions; registration disposal retires it. Tool declarations remain provider-owned. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope's system prompt.
```ts cordis-catalog
/**
* Presentation waterfall over assembled sections, contexts, and variables.
* Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners
* receive only that scope's assemblies. The returned text is authoritative; tool declarations remain provider-owned.
* receive only that scope's assemblies. Returned section text determines updates;
* omitting a previously admitted section leaves its instructions unchanged.
* Empty text withdraws its instructions; registration disposal retires it.
* Tool declarations remain provider-owned.
* A supplied signal controls only this explicit assembly request and must not
* be retained to control later turns. A registered complete section is
* restored after this waterfall, so listeners cannot add to or replace
+1
View File
@@ -721,6 +721,7 @@ schemas(scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolSchema[]
/**
* Provide the executor for the calling scope; an unscoped contribution is the deployment default.
* Rendering any executor-owned section requires the viewing scope's selection to remain available.
* Disposal retires its sections; a replacement's same-name sections supersede those notices.
* @param executor - initialized provider owned by the contributing plugin.
* @returns the effect disposer. Unloading leaves the selection unavailable until it is replaced.
*/
+1
View File
@@ -721,6 +721,7 @@ schemas(scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolSchema[]
/**
* Provide the executor for the calling scope; an unscoped contribution is the deployment default.
* Rendering any executor-owned section requires the viewing scope's selection to remain available.
* Disposal retires its sections; a replacement's same-name sections supersede those notices.
* @param executor - initialized provider owned by the contributing plugin.
* @returns the effect disposer. Unloading leaves the selection unavailable until it is replaced.
*/
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.5/system-prompt-integrations/guide.md
/:
en: 5351a4e082de2f32
zh: 544beca450fd6df0
/system-sections-and-custom-integrations:
en: 7b8344f8831cfe4c
zh: 27f2885f0140bec3
/system-sections-and-custom-integrations/change:
en: b5bd850e07b0e328
zh: 50c28fc86d8d4896
/system-sections-and-custom-integrations/migration:
en: 4e2f3a641be79e2e
zh: 03ce6e66dd13cdb9
@@ -0,0 +1,25 @@
---
kind: upgrade-guide
description: "System-message consumers must accumulate section updates and recognize source-specific notices."
---
# System sections and custom integrations
English | [中文](guide.zh.md)
## Change
Later `system/message` events contain section updates rather than complete prompts. Consumers must preserve all surviving system messages. Accepted assemblies compare source text and order with logged state; disposal produces retirement only for a previously committed source with no remaining live registration. Rejected assemblies commit nothing. Legacy messages without `source.sections` remain readable; the next model attempt replaces the initial system node with current sections and clears later system messages, as after compaction.
`section()` accepts repeated names: the nearest visible scope wins, then the latest live registration within that scope. Disposing an override restores the next definition. Plan mode keeps conditional instructions and appends active/inactive status updates.
Sections are trimmed after interpolation and stored as separate text blocks; system service inserts no whitespace separators. Each active record has `contentIndex` pointing to its actual text, including an empty text update; retired records omit it. Optional `noticeIndex` arrays identify replacement and retirement blocks belonging to a source. Whole-prompt supersession notices remain unattributed. Notices are trimmed too; retirement notices must be nonempty.
Compaction summarizes the selected conversation under its logged instructions. Before the next model attempt, ordinary system-message replacements first clear later system updates, including those outside the selected range, then install current sources at the initial system node. Idle inspection retains the old instructions until that attempt. No additional message projection or Session event type is required.
## Migration
1. Keep section names stable and use distinct names for independent instructions. Reuse a name only for an override. Keep registrations alive while their instructions apply; dispose them to withdraw the source. Optionally provide literal `retirement` text and a `replacement` notice; a blank replacement suppresses that notice. Dispose and re-register between admissions without changing the effective text to avoid redundant updates.
2. Update custom transcript, SDK, adapter, and viewer consumers to accumulate sections and distinguish actual text from notices using the indexes above. Preserve meaningful whitespace inside sections; do not use whitespace-only sections as separators. Adapters choose separators when formatting requests. Existing logged text is unchanged; previously untrimmed text may receive one normalized update.
3. Custom compositions must load `session-projection` before using `system-prompt`. Instead of consuming `systemMessages`, custom loops call `PromptAssembly.systemUpdates(retry)` before each model attempt, including overflow retries, and append every returned `{ message, intent }` as a `system/message` event, in order and without yielding. Pass `false` on the first attempt and `true` on later attempts; later attempts receive only the rebuild that compaction requires. Retries reuse their assembly. See [loop admission](../../../../packages/core/agent-loop/README.md#understand-the-implementation).
4. Verify that unchanged sections send nothing, changed sections send updates, and disposal sends one retirement after the last visible registration leaves. Remove a persona override and confirm that the parent persona takes effect.
@@ -0,0 +1,25 @@
---
kind: upgrade-guide
description: "系统消息消费方必须累计章节更新,并识别各来源的通知。"
---
# 系统章节与自定义集成
[English](guide.md) | 中文
## 变更
后续 `system/message` 事件包含章节更新,而非完整提示词。消费方必须保留所有仍存活的系统消息。接受的组装会将来源文本和顺序与日志状态比较;仅当来源已提交且没有剩余活跃注册时,清理才会产生退役通知。被拒绝的组装不提交任何内容。不含 `source.sections` 的旧式消息仍可读取;下一次模型尝试会以当前章节替换初始系统节点,并清空后续系统消息,与压缩之后相同。
`section()` 接受重复名称:最近的可见作用域优先,其次是该作用域内最后一个活跃注册。清理覆盖后会恢复下一个定义。Plan mode 保留条件指令,并追加 active/inactive 状态更新。
章节在插值后去除首尾空白,保存为独立文本块;系统服务不插入空白分隔符。每个 active 记录都有指向其实际文本的 `contentIndex`,包括空文本更新;retired 记录不提供该字段。可选的 `noticeIndex` 数组标识属于该来源的替换和退役文本块。整段提示词的替代通知保持无归属。通知也会去除首尾空白;退役通知必须非空。
压缩根据已记录的指令为选中对话生成摘要。下一次模型尝试之前,普通系统消息替换操作先清空后续系统更新,包括选区外的更新,再将当前来源写入初始系统节点。空闲期间的检查视图保留旧指令,直到该次尝试。不需要额外的消息投影或 Session 事件类型。
## 迁移
1. 保持章节名称稳定,为独立指令使用不同名称。仅在覆盖场景中复用名称。指令适用期间保持注册活跃;清理注册以撤回来源。可选地提供字面量 `retirement` 文本和 `replacement` 通知;空 replacement 会省略该通知。在两次准入之间清理并重新注册且不改变生效文本时,不会产生多余更新。
2. 更新自定义 transcript、SDK、适配器和查看器消费方,以累计章节,并使用上述索引区分实际文本和通知。保留章节内部有意义的空白;不要用纯空白章节充当分隔符。适配器在格式化请求时选择分隔符。已有日志文本不变;此前未裁剪的文本可能收到一次规范化更新。
3. 自定义组合必须在使用 `system-prompt` 前加载 `session-projection`。自定义循环不再消费 `systemMessages`,而是在每次模型尝试前(包括溢出重试)调用 `PromptAssembly.systemUpdates(retry)`,并按顺序、不让出执行地将返回的每个 `{ message, intent }` 追加为 `system/message` 事件。首次尝试传入 `false`,之后的尝试传入 `true`;之后的尝试只会得到压缩所要求的重建。重试复用已有组装。详见[循环准入](../../../../packages/core/agent-loop/README.zh.md#understand-the-implementation)。
4. 验证未变化的章节不发送消息,变化的章节发送更新,且最后一个可见注册被清理后发送一次退役通知。移除 persona 覆盖后,确认父级 persona 生效。
@@ -32,8 +32,8 @@ function request<P>(payload: P): P {
async function composed(workspaces: readonly Workspace[] = []): Promise<Context> {
const ctx = new Context()
await ctx.plugin(SessionStore)
await ctx.plugin(SystemPrompt, { personaPrefix: '' })
await ctx.plugin(SessionProjectionRegistry)
await ctx.plugin(SystemPrompt, { personaPrefix: '' })
await ctx.plugin(AgentRegistry)
await installSessionReadTestServices(ctx)
ctx.provide('workspaceRegistry', { list: () => workspaces, archivedSessionIds: [] } as never)
@@ -276,6 +276,7 @@ describe('sessions.fork', () => {
await mountAgentLoopTestDependencies(ctx)
const harness = await mountAgentLoopTestHarness(ctx)
await ctx.plugin(TokenMeter)
await installSessionReadTestServices(ctx)
const compact = new BasicCompactionEngine(ctx, { auto: false })
const adapter = new MockAdapter([
textResponse('reply'), textResponse('checkpoint'), textResponse('continued'),
@@ -97,9 +97,9 @@ async function harness(logged?: {
sessionId: SessionId
}> {
await ctx.plugin(SessionStore)
await ctx.plugin(SessionProjectionRegistry)
await ctx.plugin(SystemPrompt, { personaPrefix: '' })
await ctx.plugin(LlmRuntime)
await ctx.plugin(SessionProjectionRegistry)
await ctx.plugin(AgentRegistry)
ctx.llm.registerAdapter(['deepseek-official'], new CatalogAdapter('DeepSeek', [
{ provider: 'deepseek-official', id: 'deepseek-chat', name: 'DeepSeek Chat' },
@@ -38,10 +38,10 @@ async function fixture(mode: 'read-only' | 'workspace-write' | 'danger-full-acce
setVersionExemption: vi.fn(async () => ({ changed: true, application: 'applied' })),
}
ctx.provide('pluginManager', manager as unknown as PluginManager)
await ctx.plugin(SessionProjections)
await ctx.plugin(SystemPrompt)
await ctx.plugin(ToolRuntime)
await ctx.plugin(NativeToolExecutor)
await ctx.plugin(SessionProjections)
await ctx.plugin(SandboxPolicy, { mode })
if (approval !== undefined) await ctx.plugin(ApprovalService, { policy: approval })
const fiber = await ctx.plugin(tool)
+2 -1
View File
@@ -103,6 +103,7 @@
"@deepseek-ai/dsh-tools": "workspace:*",
"@deepseek-ai/dsh-typert-protocol": "workspace:*",
"@types/hosted-git-info": "^3.0.5",
"@types/semver": "^7.8.0"
"@types/semver": "^7.8.0",
"@deepseek-ai/dsh-session-projection": "workspace:*"
}
}
@@ -1,4 +1,5 @@
/** The read-only market listing tool over the same service the Discover page uses. */
import SessionProjectionRegistry from '@deepseek-ai/dsh-session-projection'
import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit'
import * as NativeToolExecutor from '@deepseek-ai/dsh-tool-executor-native'
import { Context, Service } from '@deepseek-ai/cordis'
@@ -33,6 +34,7 @@ async function fixture(indexes: readonly string[] = [URL_A]) {
}
await ctx.plugin(Manager)
await ctx.plugin(PluginMarket, { indexes: [...indexes], detailCacheDir: UNUSED_CACHE })
await ctx.plugin(SessionProjectionRegistry)
await ctx.plugin(SystemPrompt)
await ctx.plugin(ToolRuntime)
await ctx.plugin(NativeToolExecutor)
@@ -220,6 +222,7 @@ it('registers the tool only while the pluginMarket service is mounted', async ()
listVersionExemptions() { return { exemptions: {}, warnings: [] } }
}
await ctx.plugin(Manager)
await ctx.plugin(SessionProjectionRegistry)
await ctx.plugin(SystemPrompt)
await ctx.plugin(ToolRuntime)
await ctx.plugin(NativeToolExecutor)
@@ -75,8 +75,8 @@ async function boot(profile: string, primaryRuntime: (root: string) => string |
})
ctx.provide('dshHomePath', dshHomePath)
provideWorkingDirectoryFixture(ctx, workspace)
await ctx.plugin(SystemPrompt)
await ctx.plugin(SessionProjectionRegistry)
await ctx.plugin(SystemPrompt)
await ctx.plugin(AgentRegistry)
await ctx.plugin(ToolRuntime)
await ctx.plugin(NativeToolExecutor)
Loaded 100 of 861 files, more files were not shown because too many files have changed in this diff. Show more