feat(agents): local integration_test authoring agent - #586
Conversation
Implements the 01-coding-template's documented authoring flow locally: 'hud eval <taskset> integration_test' now pre-stages the golden solution by replaying every Task.validation tool call through the task's own MCP capabilities, ends the trace, and lets the environment's scenario graders run. The CLI enforces the authoring gate afterwards: every run must grade Reward 1.0, otherwise the eval exits non-zero naming the failing reward/raw grade. Replaces the hud-evals#585 error path with the real implementation. No LLM calls; timeout_seconds bounds the staging pass.
- validation calls dispatch through MCP capabilities and record ToolSteps - empty/invalid validation entries degrade safely - EvalConfig accepts integration_test - the reward gate exits non-zero below 1.0 and on grading errors
5508c1c to
d13314d
Compare
Two gaps from Bugbot review of the integration_test agent: 1. SSH-published workspaces: the agent now opens ssh/2 bindings alongside mcp ones and runs bash validation steps via 'bash -lc <command>' over SSHClient.run, converting the completed process into a ToolStep result (exit code -> isError). 2. create_agent now rejects INTEGRATION_TEST instead of hiding the non-LLM agent behind the gateway cast, mirroring gateway_provider.
- bash validation over an ssh/2 workspace records a ToolStep with
the command output and success state
- non-zero SSH exit codes surface as error results
- create_agent('integration_test') raises instead of constructing
|
Thanks Bugbot — three findings, addressed on the new head f7c84bd:
Full suite 395 passed, ruff + ty clean. |
Pass the golden bash step to SSHClient.run as one remote command string (asyncssh shlex-splits it, preserving the command's own quoting, and ships it to 'bash -lc' as a single argument) instead of three argv parts, which can lose grouping on space-join.
|
Fixed on c9601f2: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c9601f2. Configure here.
| # Single remote command string: asyncssh shlex-splits it, preserving | ||
| # the command's own quoting, and ships `command` to `bash -lc` as one | ||
| # argument (the codebase idiom; avoids multi-arg space-join hazards). | ||
| completed = await client.run(f"bash -lc {command}") |
There was a problem hiding this comment.
SSH staging command misquoted
High Severity
Building the remote string as bash -lc {command} without shlex.quote does not pass the golden script as one -c argument. On ssh/2 workspaces, shell_argv already wraps the exec string in bash -lc, and working SSH tools just run the raw command. Typical validation steps with spaces or redirects therefore stage the wrong remote command, so the authoring gate can fail (or pass) for the wrong reason.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c9601f2. Configure here.
|
Review-readiness summary, since the PR went through several CI rounds:
No rush — flagging only because the diff is now stable. |


Summary
The 01-coding-template documents
hud eval <env-name> integration_testas the shipping check for every task: pre-stage the golden solution, run the graders, require Reward 1.0. Until now that agent only existed on the platform — the local CLI rejected the name (previously patched with a helpful error in #585). This PR implements the real thing locally.What it does
AgentType.INTEGRATION_TEST+IntegrationTestConfig(no model,timeout_secondsbounds the staging pass).IntegrationTestAgent— anAgentthat makes no LLM calls: it opens the task's own MCP capabilities, replays everyTask.validationtool call through them (recordingToolSteps like any other agent), and ends the trace with an empty answer so the environment's scenario graders grade the staged workspace. String-arguments steps are rejected without executing, unknown/invalid steps are skipped with warnings, and a missing-capability call surfaces as an error result.Run.validation—rolloutattachestask.validationto the live run so the agent can consume it.gateway_providerraises for this type (it's not a gateway shortcut — no LLM).Validation
hud/agents/tests/test_integration_test.py(dispatch + ToolStep recording, empty-validation no-op, invalid-entry tolerance) and CLI tests (config accepts the name, the reward gate exits on <1.0 and on grading errors).hud/tests+ capabilities + patches + agents + cli).ruff+tyclean.Notes
Note
Medium Risk
Touches eval rollout, grading exit behavior, and remote command execution over MCP/SSH for golden staging; mistakes could block authoring or run unintended shell on workspaces, though scope is limited to the integration_test path.
Overview
Adds a local, no-LLM
integration_testagent sohud eval <taskset> integration_testcan serve as the documented shipping check: replayTask.validationthrough the task’s MCP or SSH capabilities, then let scenario graders score the staged workspace.IntegrationTestAgentopens manifest MCP/ssh/2bindings, coerces validation entries toMCPToolCall, dispatches tool calls (includingbash -lcover SSH), recordsToolSteps, and honors a configurable staging timeout. Invalid or unsupported validation steps are skipped with warnings;create_agentrejects this type as a gateway model shortcut.Rollout and CLI:
Run.validationis populated fromtask.validationduring rollout. After eval,_enforce_integration_test_rewardrequires every run to reach reward 1.0 (or exits non-zero on grading errors), matching the authoring-loop contract.AgentType.INTEGRATION_TEST,IntegrationTestConfig, and tests cover agent dispatch, SSH paths, config parsing, and the reward gate.Reviewed by Cursor Bugbot for commit c9601f2. Bugbot is set up for automated code reviews on this repo. Configure here.