Direct Usage¶
Use --backend langchain to connect UCAgent directly to a model in one terminal. This backend binds the verification tools in process.
This guide runs toffee-ut:ut for a selected DUT. Its default output is <workspace>/ut_project/.
1. Configure the Model¶
Environment variables are recommended:
UCAgent uses the OpenAI-compatible interface. The OPENAI_API_MODE for the LangChain backend defaults to auto: it probes the Responses API before the first model operation and falls back to Chat Completions only if the server explicitly does not support it. Set it to responses or chat_completions if you need to fix the protocol. OPENAI_REASONING_EFFORT defaults to xhigh; the value is passed to the server as-is, so please fill in a value supported by your model.
Configure an embedding model if you need semantic search or memory tools:
The default value for --no-embed-tools in the current CLI is true, meaning embedding tools are disabled by default. To enable them, pass the flag explicitly:
You can also write the same keys into the project config.yaml:
The configuration file supports environment variable placeholders in the form $(NAME: default). For the hierarchical loading order, CLI override methods, and other model providers, see Parameter Description.
2. Prepare the Workspace¶
Prepare the RTL, specifications, and output/toffee_Adder/ workspace as shown in Normal Mode. ToffeeUT creates the native DUT package during the workflow's build stage.
3. Using the CLI Directly¶
Start the prepared workspace with the LangChain backend:
If you omit --loop, enter loop in the TUI to start.
Common parameters:
--config <path>: Specifies the project configuration; if not specified, the hierarchical default configuration is used.--output <name>: Changes the output directory under the workspace. ToffeeUT defaults tout_project.--human/-hm: Starts human-intervention mode.--tui: Opens the TUI; if not using the TUI, you can use--web-consoleor--web-terminal.--skip <index>,--unskip <index>: Controls stages by runtime stage index; the index is based on what is displayed instatus/hmcheck_list.--no-write <path ...>: Prohibits writing to existing files or directories within the workspace; wildcard paths can be used for non-existent targets. See Parameter Description for security restrictions.
4. Common Actions in the TUI¶
When a stage fails, wait for the active operation to end, inspect the files and next steps reported by the Checker, repair them, then invoke each command and wait for its result:
If a check has no output, inspect the logs. Cancel active model/tool work with Ctrl+C or the HTTP operation API and wait for it to end. The following tool calls also use the model-operation slot and are rejected while it is busy:
For a complete command reference, see Human-Machine Collaborative Verification and TUI.
Model Request Failures and Retries¶
When a LangChain automatic loop receives a non-retryable HTTP 4xx rejection, it stops the current loop immediately and retains the original error for inspection. Correct the service URL, model/credentials, or conversation/tool messages, then enter loop again. HTTP 408, 409, 429, 5xx, and unclassified connection/runtime errors retain the existing retry limits and delays. A request may be retried after missing tool results have actually been recorded, so the model can handle the recorded tool failure. If a later request is still rejected without further recovery progress, the loop stops. Stopping retries does not clear the conversation, advance stages, or bypass Check, Complete, or human authorization.
5. Artifacts and Next Steps¶
Specifications, tests, and run receipts are under <workspace>/ut_project/. See Result Analysis and Workflow Summary for details.
- To involve an external Code Agent: Read MCP Integration.
- To centrally manage multiple tasks: Read Master Mode.
- To modify stages, tools, or Checkers: Start with Custom Development Quick Start.