Kind: Function
Source: atloria-monorepo/libs/agent-core/src/benchmark/agent-hardening.ts
Agent Hardening — Defensive Patterns for Benchmark Execution
Utilities adopted from SWE-agent and Claude Code:
- Bash timeout clamping utility (prevents single commands from hogging budget)
- Pager-disabling environment (PAGER=cat, etc.)
- Cost limit per task ($3-5 budget)
- Autosubmission on error (partial patch > no patch)
- Zero-progress detection (3 consecutive zero-token turns)
Note: Task-level timeout is 1800s (30 min, matching SWE-agent). Setup time is excluded — timer starts AFTER setupTask() completes. Per-command bash timeout is 120s (benchmark) / 60s (interactive).
These are pure utility functions — no side effects, easy to test.
Signature
tsfunction clampTimeout(requested: number | undefined, ceiling: number, defaultMs: number): number
Parameters
| Name | Type |
|---|---|
requested | `number |
ceiling | number |
defaultMs | number |
Returns: number
Was this page helpful?