Files
deepseek-harness/website/zh-CN/api/harness/agent-execution.md
T

1.7 KiB

ctx.agentExecution

AgentExecutionService (abstract seam) — provided by @deepseek-ai/dsh-agent-execution.

Ambient Agent identity within one process-local asynchronous chain.

Source

ctx.agentExecution.current()

current(): AgentExecution | undefined

Read the active execution without requiring one.

Returns the inherited execution, or undefined outside/inside a cleared boundary.

Source

ctx.agentExecution.require()

require(): AgentExecution

Read the active execution and fail when no boundary is active.

Returns the inherited execution.

Source

ctx.agentExecution.run(execution, operation)

run<T>(execution: AgentExecution | undefined, operation: () => T): T

Run an operation inside an execution boundary. Passing undefined clears an inherited execution; the exact synchronous value or Promise is returned.

  • execution — execution to inherit, or undefined for a clearing boundary.
  • operation — synchronous or asynchronous operation to invoke.

Returns the exact value returned by operation.

Source