prepare_harness_build
Create a build + prepared worktree WITHOUT queueing the autonomous pipeline.
Create-without-queue primitive for the interactive build terminal: the
calling agent is the single driver and orchestrates the build itself, so
this must be used instead of create_build (which would queue a second,
autonomous pipeline over the same recipe). Pass platform_agent=True to
buy out of that and have OpenFactory's own goal agent drive instead; it is
the only way to get one here, and it needs a plan that includes it.
When a conversation is bound,
cancels that conversation's previous active interactive build first. It
never cancels another unbound caller's build. It creates and persists the
record, canonicalizes the recipe, prepares the primed worktree
(deterministic distro and package inputs), and marks
the build "building". No email notifications fire on this path — the user
is present in the terminal.
The returned agent_mode (author | report-only) governs authoring:
report-only is the worker-owned pipelines only (pi-gen, pmbootstrap), whose
configure() writes the config later, during build_image dispatch, so
their agent authors nothing (agent_mode_notice restates the rule). Every
other worker returns author, because the preparation path is actuators only
and the agent is the sole author of config/.
Returns: {build_id, worktree_path, branch_name, agent_mode, session_token}
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"recipe": "<recipe>"
},
"name": "prepare_harness_build"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | No | The owner's original natural-language request, if there was one. Persisted privately as durable planning intent and seeded as the opening user message; provide the owner's words, not a narrowed recipe summary. | |
| recipe | Yes | The build recipe as a JSON object (or a JSON string). Required: name, base_image. Put OS features, packages, services, users, networking, and security under os. | |
| api_key | No | OpenFactory MCP API key (optional). | |
| create_chat | No | Create a chat for this build, seeded with the prompt and a recipe card, and link it so the build is reachable from the sidebar and opens the build panel. Leave on unless you're generating bulk/QA builds. | |
| build_context | No | Structured Chat/TTY build selections to apply to the recipe. | |
| session_token | No | Session token from a previous tool response. IMPORTANT: Always pass the session_token from the most recent tool response to maintain session continuity. | |
| platform_agent | No | Hand this build to OpenFactory's own goal agent instead of driving it yourself. A paid add-on: included with the Builder, Team, Compliance and BYOC Fleet plans, and refused with error_code=upgrade_required on a plan without it. Omit it and YOU drive -- you get the worktree and no platform agent is started, which is the normal way to use this tool and costs no upgrade. | |
| owning_conversation_id | No | Existing owner-scoped conversation to bind before goal/worktree preparation. Used by the unified v3 harness. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||