Run Design Loop
design_loopUse this when you need to run a CAD design loop over multiple attempts. Run an agent CAD design loop over one or more attempt scripts: review each attempt with review_cad, continue past functional attempts that still have unresolved review warnings, return structured repair prompts, and optionally write a Studio-compatible build record JSON for visual replay.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | Yes | Original user design goal. Fed into every review_cad repair prompt. | |
| assembly | No | ||
| attempts | Yes | Ordered design attempts. Each item is { id?, title?, file? OR code?, visualReview? } — provide file or code (at least one). File attempts can be replayed by Studio build records. | |
| epsilonMm3 | No | Forwarded to review_cad. | |
| stopOnPass | No | Stop after the first attempt that is functional and passes the quality gate. Default true. | |
| recordTitle | No | Optional title for the build record. | |
| combinatorial | No | Sample all 2^N limit-corner combinations across mates with declared limits. Capped at 8 mates with limits; combine with samplesPerMate for both interior coverage and worst-pose detection. Default false. | |
| samplesPerMate | No | Pose-envelope samples per declared-limit mate. 1 (default) = corners only; >=3 adds uniform interior points between min and max. Total samples per non-locked mate = samplesPerMate. | |
| gripperAperture | No | Optional gripper aperture request forwarded to review_cad. | |
| trackConnectors | No | Connector refs to track across sampled poses. | |
| outputRecordPath | No | Optional JSON path to write a Studio-compatible build record. | |
| preserveInterfaces | No | External mates, connector refs, part names, or behavioral interfaces the agent must preserve between attempts. | |
| allowReviewWarnings | No | Warning diagnostic codes the original prompt explicitly allows. Other review warnings keep the loop iterating even if review_cad is functionally ok. | |
| includeInterference | No | Forwarded to review_cad. Default true. | |
| includePoseEnvelope | No | Forwarded to review_cad. Default true. | |
| requireVisualReview | No | Require screenshot-backed visualReview with structured checks before accepting an attempt. Default true; set false only for explicit non-visual batch checks. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| goal | Yes | Echoed design goal. | |
| record | No | Studio-compatible build record (when requested). | |
| attempts | Yes | Per-attempt review results. | |
| recordUrl | No | ||
| finalAttemptId | No | ||
| nextActionPrompt | No | ||
| outputRecordPath | No |