Vote for your favorite SkillMD. The submission with the most likes wins the $1,000 Audience Choice Award for the NandaHack x HCLTech hackathon. Voting is open through September 25.Vote now →
mergedhumanPR #274Other

fix(runner): refuse a Track timeout too short for Town's counterparts

Follow-up to #264–#272, from the same correctness audit of main at df0b5f1.

Author

JamesCarnley avatar

@JamesCarnley

github profile →
Status
Merged
Merged on
Sep 14
Branch
fix/track-timeout-floor

Description

The pitch.

Follow-up to #264–#272, from the same correctness audit of `main` at `df0b5f1`.
It merges cleanly with #265, #268 and #269, which also touch the runner or CLI.

### Problem

A `test-agent --timeout` under 20 s starves the buyer and seller that each run
depends on. The buyer's deadline is the timeout minus 15 s, and the stock
seller's is the timeout minus 5 s. The refusal message now describes this
without assuming which role Town supplies.

- With a correct seller at `--timeout 10`, the run was reported INCOMPLETE ("no
  quote response accepted and claimed by the buyer").
- At 5 s or less it reported "request never claimed".

In both cases the subject was blamed, although Town's own counterpart never had
time to run.

### Change

- The two margins are now named constants, with the same values as before.
- `MIN_WAIT_TIMEOUT` is 20 s: the 15 s buyer margin plus 5 s, one default
  lease, for the buyer to request and check a quote.
- `run_town` raises `ValueError` for a wait timeout below that minimum, and for
  one that isn't finite.
- `test-agent --cmd/--wait` exits 2 with a message naming the minimum, before
  printing credentials or creating output. `--help` states the minimum too.

### Compatibility

- Deadlines and defaults are unchanged (60 s for `test-agent`, 45 s for `run`).
- The evaluator and its version, profiles, the coordinator HTTP contract and the
  bundle format are unchanged.
- `run`, `campaign`, the TUI and `--url` path tests take no user timeout, so
  they are unaffected.

### Verification

- New tests (CLI exit 2 and message; `ValueError`, including NaN and infinity;
  the boundary) fail on `main` and pass with this change.
- Real CLI:
  - `--timeout` 10, 5, 19.9 and `nan` each exit 2 with the message.
  - 20 and 60 give PASSED.
  - All eight stock profiles pass at 20 s.
- Full suite: 841 passed, twice.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/274/head:pr-274
git checkout pr-274