Agent Harness Construction
Parent: AI Agent Ecosystems · Published reference · snapshot 2026-09-08 · skill ai-agents-orchestration/references/agent-harness-construction.md
↓ Facts as markdownall context files
当你在改进智能体的规划、调用工具、从错误中恢复以及收敛到完成状态的方式时,使用此技能。
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
智能体框架构建
- 当你在改进智能体的规划、调用工具、从错误中恢复以及收敛到完成状态的方式时,使用此技能。 [archived source: https://llms-explorer.com/sources/mdb-context-hub/agent-harness-construction/#智能体框架构建]
粒度规则
- 对高风险操作(部署、迁移、权限)使用微工具。 [archived source: https://llms-explorer.com/sources/mdb-context-hub/agent-harness-construction/#粒度规则]
- 对常见的编辑/读取/搜索循环使用中等工具。 [archived source: https://llms-explorer.com/sources/mdb-context-hub/agent-harness-construction/#粒度规则]
观察设计
- status: success|warning|error [archived source: https://llms-explorer.com/sources/mdb-context-hub/agent-harness-construction/#观察设计]
- next_actions: 可执行的后续步骤 [archived source: https://llms-explorer.com/sources/mdb-context-hub/agent-harness-construction/#观察设计]
- artifacts: 文件路径 / ID [archived source: https://llms-explorer.com/sources/mdb-context-hub/agent-harness-construction/#观察设计]
上下文预算管理
- 在阶段边界处进行压缩,而不是任意的令牌阈值。 [archived source: https://llms-explorer.com/sources/mdb-context-hub/agent-harness-construction/#上下文预算管理]
架构模式指导
- ReAct:最适合路径不确定的探索性任务。 [archived source: https://llms-explorer.com/sources/mdb-context-hub/agent-harness-construction/#架构模式指导]
- 混合模式(推荐):ReAct 规划 + 类型化工具执行。 [archived source: https://llms-explorer.com/sources/mdb-context-hub/agent-harness-construction/#架构模式指导]
Where this helps
- Designing the tool interface for a new coding agent, and deciding whether a given action (deploying, migrating a database, changing permissions) needs a narrow, single-purpose micro-tool rather than a general-purpose one. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Structuring what a tool call returns to the agent, so the agent can reliably tell success from failure and know what to do next without re-deriving that from raw output. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Deciding when to compress an agent's context — at a natural phase boundary in the task rather than at an arbitrary token count that might cut off mid-reasoning. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Choosing between a pure ReAct loop and a hybrid architecture when a task mixes genuinely exploratory steps with well-defined, typed actions. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Project ideas
- Build a tool-granularity audit for an existing agent harness: flag every high-risk action (deploy, migrate, permission change) still exposed as a broad general-purpose tool instead of a scoped micro-tool. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Design an observation schema for agent tool responses with a fixed status field (success|warning|error), a next_actions list, and an artifacts field for file paths or IDs, then retrofit existing tools to emit it consistently. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Implement phase-boundary-triggered context compression instead of a fixed token-threshold trigger, and compare how much less useful context gets cut mid-task. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Build a hybrid agent loop that uses ReAct-style reasoning for open-ended exploration steps but switches to typed, schema-validated tool calls for well-defined actions. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Antipatterns
- Exposing a high-risk operation (deployment, database migration, permission changes) through the same general-purpose tool used for routine edit/read/search actions, instead of a dedicated micro-tool. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Returning free-form, inconsistent text from tool calls instead of a structured observation with a clear status, next steps, and artifact references. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Triggering context compression at an arbitrary token threshold rather than at a natural phase boundary in the task, risking a compression that cuts off reasoning mid-thought. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Defaulting to a pure ReAct loop for every task, including ones with a well-known, low-uncertainty path where typed tool execution would be more reliable. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Known issues
- This pack's own sourced content is thin — five short facets, each just a rule or two — so treat it as a set of design heuristics rather than a complete harness-construction methodology. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- The recommended hybrid pattern (ReAct planning + typed tool execution) isn't spelled out in detail in this pack beyond the one-line recommendation, so the actual boundary between "plan with ReAct" and "execute with typed tools" needs to be worked out per harness. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- "Compress at phase boundaries" assumes the harness can reliably detect phase boundaries in the first place — a task without clear phase structure doesn't get an obvious compression trigger from this rule alone. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- The three-field observation schema (status/next_actions/artifacts) is a minimal design, not a full specification — it doesn't address how to represent partial success or multi-step failures within a single tool call. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Children
- Action Space Design (frontier)
- Observation Format Design (frontier)
- Error Recovery Contracts (frontier)
- Context Budget Management (frontier)
Frontier under this node: Action Space Design, Context Budget Management, Error Recovery Contracts, Observation Format Design