Dongxi 东锡 NLP@dongxi_nlp
63AI 编辑部评分,满分 100

DeepSeek Harness:让智能体状态有明确归属

2026-08-16 02:35· 53分钟前
AI 导读

DeepSeek Harness 的核心设计是拒绝将“智能体状态”视为单一模糊对象,而是让每个关键事实归属于有权验证它的组件。例如文件读取会记录版本号,仅在版本匹配时才允许修改,以消除检查与使用之间的时间差。工具调用则作为事件管道,包含身份验证、模式校验、执行钩子等环节,子智能体也需独立决策上下文、生命周期与权限。

https://x.com/i/article/2088681782606536704

The Glance of DeepSeek Harness

DeepSeek Harness is easy to misunderstand from its name.

You may expect a model wrapper, a tool collection, or a CLI built around DeepSeek models.

After tracing its contracts, source, and tests, the most interesting part is somewhere else:

It refuses to let "agent state" become one vague object.

Instead, every important fact is placed beside the component that has the authority to verify it.

Truth Has An Owner

A file provider owns current file truth.

A session policy remembers what the agent observed.

Live events coordinate the process that is running now.

Durable events record what later sessions may replay.

Model and client projections select what each consumer actually needs.

This separation appears everywhere. It is the architectural personality of the harness.

Example: A shell command may stream "40% complete" as live state. After it finishes, the durable history only needs the command and final result.

The Stale Read Tells The Whole Story

Suppose the agent reads a file at version v1. Before it edits, another process rewrites the file.

A weak harness remembers only that the transcript contains a read. DeepSeek Harness remembers the observed version, then asks the filesystem provider to mutate only if the current version is still v1.

The policy owns the expectation. The provider owns current truth. The atomic comparison closes the time-of-check/time-of-use gap.

One subtle detail matters: reading a window proves freshness for that file version, but it does not prove the model understood the whole file. Freshness and completeness are different policies.

Example: The agent reads timeout = 30. A teammate changes it to 60. The agent's edit still expects the old version, so the provider rejects it and asks for a fresh read.

A Tool Is An Event Pipeline

A tool call is not passed directly to a handler.

It receives immutable identity, schema validation, pre-execution hooks, monotonic guards, execution wrappers, normalization, finalization, and result recording.

DeepSeek even distinguishes a live tools/result notification from the durable tool/result session fact.

That naming difference captures the design: coordination state and historical state are related, but they are not interchangeable.

Example: For "find TODOs," the schema checks the query, a guard limits the search to the workspace, the runner finds matches, and the finalizer records a normalized result.

A Subagent Opens A Managed Runtime

DeepSeek also makes subagents more precise than "call another model."

Spawning a child requires three independent decisions.

First, context seed: fresh instructions or a completed-turn fork.

Second, lifecycle: one-shot, background, or continuable through follow-up.

Third, authority: tools, approval behavior, resources, and delegation depth.

The parent receives a report, settlement, or transcript projection. The child can spend a large local context without flooding the parent conversation.

Example: A parent asks a child to inspect failing tests. The child receives only that task plus read/test tools, then returns a five-bullet diagnosis instead of its whole transcript.

What Is Worth Copying?

Not the package count.

Not every Cordis seam.

The reusable lesson is smaller:

For every capability, name the truth owner, authority gate, durable record, model projection, and recovery rule.

Example: For screenshots, the browser owns the pixels, permission gates the capture, a file stores the durable artifact, the model sees a bounded preview, and retry handles capture failure.

If one of those is missing, the harness contract is incomplete.

That is my glance of DeepSeek Harness: a runtime where invisible boundaries are made explicit enough to test.

来源:Dongxi 东锡 NLP · x.com

DeepSeek Harness:让智能体状态有明确归属

Dongxi 东锡 NLP · @dongxi_nlp · X·2026-08-16 02:35·53分钟前
AI 导读

DeepSeek Harness 的核心设计是拒绝将“智能体状态”视为单一模糊对象,而是让每个关键事实归属于有权验证它的组件。例如文件读取会记录版本号,仅在版本匹配时才允许修改,以消除检查与使用之间的时间差。工具调用则作为事件管道,包含身份验证、模式校验、执行钩子等环节,子智能体也需独立决策上下文、生命周期与权限。

https://x.com/i/article/2088681782606536704

The Glance of DeepSeek Harness

DeepSeek Harness is easy to misunderstand from its name.

You may expect a model wrapper, a tool collection, or a CLI built around DeepSeek models.

After tracing its contracts, source, and tests, the most interesting part is somewhere else:

It refuses to let "agent state" become one vague object.

Instead, every important fact is placed beside the component that has the authority to verify it.

Truth Has An Owner

A file provider owns current file truth.

A session policy remembers what the agent observed.

Live events coordinate the process that is running now.

Durable events record what later sessions may replay.

Model and client projections select what each consumer actually needs.

This separation appears everywhere. It is the architectural personality of the harness.

Example: A shell command may stream "40% complete" as live state. After it finishes, the durable history only needs the command and final result.

The Stale Read Tells The Whole Story

Suppose the agent reads a file at version v1. Before it edits, another process rewrites the file.

A weak harness remembers only that the transcript contains a read. DeepSeek Harness remembers the observed version, then asks the filesystem provider to mutate only if the current version is still v1.

The policy owns the expectation. The provider owns current truth. The atomic comparison closes the time-of-check/time-of-use gap.

One subtle detail matters: reading a window proves freshness for that file version, but it does not prove the model understood the whole file. Freshness and completeness are different policies.

Example: The agent reads timeout = 30. A teammate changes it to 60. The agent's edit still expects the old version, so the provider rejects it and asks for a fresh read.

A Tool Is An Event Pipeline

A tool call is not passed directly to a handler.

It receives immutable identity, schema validation, pre-execution hooks, monotonic guards, execution wrappers, normalization, finalization, and result recording.

DeepSeek even distinguishes a live tools/result notification from the durable tool/result session fact.

That naming difference captures the design: coordination state and historical state are related, but they are not interchangeable.

Example: For "find TODOs," the schema checks the query, a guard limits the search to the workspace, the runner finds matches, and the finalizer records a normalized result.

A Subagent Opens A Managed Runtime

DeepSeek also makes subagents more precise than "call another model."

Spawning a child requires three independent decisions.

First, context seed: fresh instructions or a completed-turn fork.

Second, lifecycle: one-shot, background, or continuable through follow-up.

Third, authority: tools, approval behavior, resources, and delegation depth.

The parent receives a report, settlement, or transcript projection. The child can spend a large local context without flooding the parent conversation.

Example: A parent asks a child to inspect failing tests. The child receives only that task plus read/test tools, then returns a five-bullet diagnosis instead of its whole transcript.

What Is Worth Copying?

Not the package count.

Not every Cordis seam.

The reusable lesson is smaller:

For every capability, name the truth owner, authority gate, durable record, model projection, and recovery rule.

Example: For screenshots, the browser owns the pixels, permission gates the capture, a file stores the durable artifact, the model sees a bounded preview, and retry handles capture failure.

If one of those is missing, the harness contract is incomplete.

That is my glance of DeepSeek Harness: a runtime where invisible boundaries are made explicit enough to test.

来源:Dongxi 东锡 NLP· x.com