Human-in-the-Loop Verification¶
UCAgent allows pausing during stage execution, testing, or Checker failure, enabling manual repair of files or the environment before allowing the Agent to continue. Normal mode and MCP mode use the same set of Console commands; Master mode places common operations on the Web page.
1. When to Intervene¶
Situations suitable for human intervention include:
- Specifications, feature points, or test plans require human confirmation;
- Test environment, dependencies, or simulator configuration need modification;
- Checker failure information is clear, but the model has not fixed the issue;
- The check process times out, requiring log inspection and termination before retrying.
A test failure itself does not equal a DUT defect. First, confirm that the fixture, reference model, API, reset/timing, and assertions are correct, then decide whether to record a Bug.
2. Pausing and Checking Status¶
In local Console/TUI, press Ctrl+C to request cancellation of this interaction session's latest active foreground operation; it does not close the interface or instance. A Code Agent launched by UCAgent's command-line backend is cancelled through that operation; a manually launched client uses its own pause controls. Wait for active work to end before changing stage state or invoking another tool; see Runtime Control. Queries remain available during execution:
status displays stage progress, current_tips displays the current stage task and Checker requirements, task_detail views stage details, and changed_files views recent modifications.
3. Checking, Fixing, and Continuing¶
- Confirm that the previous model/tool operation has ended, then read the artifact, location, expected, and next_action returned by
Check. - Manually edit files or fix the environment, running a single pytest case if necessary.
- Re-check:
- After the check passes, record the work for this stage, then proceed:
Complete requires that the current stage already has a log; if prompted that reference files are unread, use ReadTextFile to read the listed files first. If human review is required, confirm according to the next section and then call Complete again.
- Wait for the preceding tool calls to finish, then choose one way to resume the Agent loop:
If Check has no output for a long time, inspect logs and operation state. Request cancellation with Ctrl+C for local foreground work, or use the HTTP operation API for work from other interfaces. Diagnostic tool syntax is:
StdCheck and KillCheck target check processes only. All tool_invoke commands share the model-operation slot; these diagnostic calls can also return busy while loop or tool_invoke Check is active. Use operation cancellation in that case and wait for completion before retrying. Do not submit repeated checks; wait for each tool result before the next command.
4. Forced Human Review¶
You can make a stage wait for human confirmation after the Checker passes:
The stage index is the flattened index of the current runtime; do not reuse numbering from another configuration. Use status or hmcheck_list. Review and flag updates can return busy while model work is active; pause and wait first. If Web/API reports a stale revision, refresh and confirm the current state before resubmitting.
After pausing, confirm the artifacts and test results, then approve or reject the review:
You can also approve the review and continue in one step:
HM is the human review switch. LFail/LPass on the Web page are LLM failure suggestion and pass review switches, which are not the same function as the human confirmation of hmcheck_pass/hmcheck_fail.
5. Permissions and Stage Control¶
View or adjust Agent writable paths:
Workflow stage control:
skip_stage, unskip_stage, and GoToStage all use stage indices; GoToStage can only return to stages already reached. When starting from the command line, you can also use --skip, --unskip, and --force-stage-index; see Parameter Description for details.
6. Common Commands Table¶
| Command | Function | Example |
|---|---|---|
status | View overall status | status |
task_detail | View stage details | task_detail 2 |
current_tips | Get current stage guidance | current_tips |
tool_list | List available tools | tool_list |
tool_invoke | Invoke tool in Console | tool_invoke Check |
hmcheck_set | Set human review | hmcheck_set 2 true |
hmcheck_pass / hmcheck_fail | Pass or reject human review | hmcheck_pass Confirmed |
skip_stage / unskip_stage | Skip or restore stage | skip_stage 3 |
loop | Continue model loop | loop |
help | View current version commands | help |
quit | Close the instance in Console; detach the view in TUI | quit |
shutdown | Explicitly close the entire instance | shutdown |
In ordinary Console, q/exit/quit closes the instance. In TUI, these commands and Ctrl+Q only detach the view; tasks and services continue. shutdown explicitly closes the instance from either frontend.
The parameter format for tool_invoke is:
Arguments use a JSON object with true/false booleans. In ToffeeUT, RunToffee.targets accepts project-relative paths or actual pytest node IDs. Replace the node ID below with a case from your project:
7. Master Page¶
The Dashboard, Task, and Agent pages of Master allow viewing logs, stage files, and Diffs, and batch setting HM, Skip, LFail, and LPass. Page operations are similar to local commands in function, but the entry point and permissions are determined by Master configuration; see Web Master User Guide for details.
Whether the Web Terminal retains the local terminal simultaneously depends on whether the sub-Agent uses --web-console or --web-terminal; see Parameter Description for the differences.
8. Recovery Principles¶
UCAgent saves stage history in the workspace. After the process exits, ensure that the old UCAgent and Code Agent have stopped, then restart with the same workspace, DUT, and configuration. After startup, first execute status to confirm the current stage and history, then enter loop or let the external Agent continue. Do not directly delete .ucagent/, test reports, or workflow artifacts for the sake of "recovery".