CodingAgentFactory
public final class CodingAgentFactory
io/agentscope/harness/coding/agent/CodingAgentFactory.java:43–177Coding 智能体工厂,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.coding.agent 包。核心成员包括 create、resolveSandboxWorkingDir、resolveSandboxType、resolveSandboxImage、buildModel、resolveModelId。
Factory for the coding agent.
-
Coding-focused system prompt (workspace env, repo setup, GitHub via
github_api_request) -
Custom toolkit (http, fetch_url, web_search, github_api_request, request_pr_review)
-
Compaction for long-running sessions
-
Configurable model from environment (
CODING_MODEL_ID) -
Sandbox integration wired at phase 2
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static HarnessAgent create(Path workspace, Toolkit toolkit)static | 创建并返回实例。 Builds a coding agent for the given workspace with default settings. |
public static HarnessAgent create(Path workspace, Toolkit toolkit, String linearCtx)static | 创建并返回实例。 Builds a coding agent. |
public static String resolveSandboxWorkingDir()static | 解析 `resolveSandboxWorkingDir`。 Resolves the sandbox working directory inside the container. |
public static String resolveSandboxType()static | 解析沙箱类型。 Returns the resolve sandbox type. |
public static String resolveSandboxImage()static | 解析沙箱图像。 Returns the resolve sandbox image. |
public static Model buildModel()static | 构建模型。 Builds the model from the `CODING_MODEL_ID` environment variable. |
public static String resolveModelId()static | 解析模型标识。 Returns the resolve model id. |
方法详情Method Detail
create
public static HarnessAgent create(Path workspace, Toolkit toolkit)
创建并返回实例。
Builds a coding agent for the given workspace with default settings.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspace | Path | 工作区(类型 `Path`)。The workspace. |
toolkit | Toolkit | 工具包(类型 `Toolkit`)。The toolkit. |
HarnessAgentio/agentscope/harness/coding/agent/CodingAgentFactory.java:48–50create
public static HarnessAgent create(Path workspace, Toolkit toolkit, String linearCtx)
创建并返回实例。
Builds a coding agent.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspace | Path | 工作区(类型 `Path`)。agent workspace directory |
toolkit | Toolkit | 工具包(类型 `Toolkit`)。custom tools registered for the coding agent |
linearCtx | String | linear Ctx(类型 `String`)。optional Linear context string (may be null — deferred) |
HarnessAgentio/agentscope/harness/coding/agent/CodingAgentFactory.java:59–90resolveSandboxWorkingDir
public static String resolveSandboxWorkingDir()
解析 resolveSandboxWorkingDir。
Resolves the sandbox working directory inside the container.
Stringio/agentscope/harness/coding/agent/CodingAgentFactory.java:93–96resolveSandboxType
public static String resolveSandboxType()
解析沙箱类型。
Returns the resolve sandbox type.
Stringio/agentscope/harness/coding/agent/CodingAgentFactory.java:98–101resolveSandboxImage
public static String resolveSandboxImage()
解析沙箱图像。
Returns the resolve sandbox image.
Stringio/agentscope/harness/coding/agent/CodingAgentFactory.java:103–106buildModel
public static Model buildModel()
构建模型。
Builds the model from the CODING_MODEL_ID environment variable.
Modelio/agentscope/harness/coding/agent/CodingAgentFactory.java:121–128resolveModelId
public static String resolveModelId()
解析模型标识。
Returns the resolve model id.
Stringio/agentscope/harness/coding/agent/CodingAgentFactory.java:161–164