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
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d13314d. Configure here.
| if not connections: | ||
| logger.warning( | ||
| "integration_test: no MCP capabilities to stage the golden solution through" | ||
| ) |
There was a problem hiding this comment.
Agent skips SSH golden staging
High Severity
IntegrationTestAgent only opens MCP bindings and dispatches via call_tool, so it never drives the SSH workspace the coding template actually publishes. Golden bash/shell validation steps therefore do not run; graders see the unstaged baseline and the Reward 1.0 gate fails a shippable task.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d13314d. Configure here.
| # cls/config_cls are matched unions; the pairing is correct by construction. | ||
| config = agent_type.config_cls(**kwargs) | ||
| return agent_type.cls(cast("Any", config)) | ||
| return cast("GatewayAgent", agent_type.cls(cast("Any", config))) |
There was a problem hiding this comment.
Gateway factory accepts integration_test
Medium Severity
create_agent treats every AgentType value as a HUD gateway shortcut. Adding INTEGRATION_TEST makes create_agent("integration_test") construct a non-LLM agent and hide it behind a GatewayAgent cast, instead of raising the way gateway_provider already does.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d13314d. Configure here.


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
Changes the eval rollout path and adds a hard CLI exit on grading outcomes; no auth or payment logic, but authors rely on this gate for shipping tasks.
Overview
Implements the local
hud eval … integration_testauthoring check: stage the golden solution, run graders, and fail the CLI if reward is not 1.0.IntegrationTestAgent(withAgentType.INTEGRATION_TESTandIntegrationTestConfig) opens the task’s MCP capabilities and replays eachTask.validationstep asToolSteprecords—no LLM calls. Invalid or unknown validation entries are skipped with warnings; string arguments are not executed.rolloutnow setsRun.validationfromtask.validationso the agent can consume golden steps. After eval,_enforce_integration_test_rewardexits non-zero when any run grades below 1.0 or grading errors.Config parsing accepts the
integration_testagent name (including beforeAgentTypeenum resolution).gateway_providercorrectly rejects this type as a gateway shortcut.Reviewed by Cursor Bugbot for commit d13314d. Bugbot is set up for automated code reviews on this repo. Configure here.