Repository navigation
Description
Problem
bash autoresearch <board> currently uses an internal default timeout (60 s today, per --timeout argparse default) but does NOT print that the default is in effect. When the device hangs or silently crashes, the user sees the harness wait quietly until the default fires -- with no visible signal that a timeout is even running, or how long is left, or how to override it.
This is the second-most-common "wait, did it freeze?" failure mode after the wrong-COM-port and silent-crash classes (already addressed by #3296 and FastLED/framework-arduino-lpc8xx#30 respectively).
Proposed work
1. Default to 30 s
Drop the default from 60 s to 30 s. Real-world bring-up RPC round-trips are well under 100 ms; a 30 s ceiling catches genuine hangs much sooner without false-tripping legit work. The 60 s number predates the on-device watchdog wiring (now available via FastLED.watchdog()) and the LPC8xx HardFault override (FastLED/framework-arduino-lpc8xx#30) -- both shorten the window in which a real hang stays silent.
2. Yellow banner whenever the default applies
When --timeout is not passed on the command line (i.e. the script chose the default), print to stdout in yellow before phase work begins:
[default 30s timeout in effect — pass --timeout <duration> or --no-timeout to override]
Suppressed by --quiet. Implementation: detect whether argparse defaulted by checking sys.argv for the flag (or by using a sentinel default + explicit comparison).
3. Parse standard time notation
Accept --timeout values in the unit-suffixed form. Examples:
30s-> 30 seconds2m-> 120 seconds1h-> 3600 seconds10m-> 600 seconds90-> 90 seconds (bare number = seconds, matches the current contract)1500ms-> 1.5 seconds (millisecond support is a bonus, not required)
Parse via a small helper:
import re
_TIME_UNITS = {"ms": 0.001, "s": 1.0, "m": 60.0, "h": 3600.0}
_TIME_RE = re.compile(r"^([0-9]+(?:\.[0-9]+)?)(ms|s|m|h)?$")
def parse_duration(s: str) -> float:
"""Parse '30s', '10m', '1.5h', or bare seconds into a float."""
m = _TIME_RE.match(s.strip().lower())
if not m:
raise argparse.ArgumentTypeError(
f"invalid duration {s!r} -- expected '<N>[ms|s|m|h]'"
)
value = float(m.group(1))
unit = m.group(2) or "s"
return value * _TIME_UNITS[unit]Wire as argparse type=parse_duration. Error messages on bad input are friendlier than the current argparse "invalid int value" message.
4. Add --no-timeout for genuinely-unbounded waits
--no-timeout Disable the timeout entirely. Use when stepping with a debugger or
running interactive bring-up sessions. Implies the yellow banner
is not printed.
Sets the internal timeout to math.inf (or a sentinel the run loop interprets as "wait forever").
Acceptance criteria
-
bash autoresearch lpc845brk(no--timeout) prints the yellow[default 30s timeout in effect ...]banner before phase work, then exits the run at 30 s if no completion signal. -
bash autoresearch lpc845brk --timeout 10mparses correctly, runs for 600 s max, no banner. -
bash autoresearch lpc845brk --timeout 5s(debugging-quick) runs for 5 s max. -
bash autoresearch lpc845brk --no-timeoutruns unbounded (until external interrupt), no banner. -
bash autoresearch lpc845brk --timeout 30sX(malformed) produces a clear error:invalid duration '30sX' -- expected '<N>[ms|s|m|h]'. -
bash autoresearch lpc845brk --quietsuppresses the yellow banner even with the default in effect. - Existing call sites (CI scripts, agents' docs) keep working unchanged -- bare integers continue to mean seconds.
Out of scope
- Changing the per-phase timeouts (each test phase has its own
--timeoutthat's different from the harness-level one). - Adding a progress bar or live countdown to the banner (the banner is a one-shot announcement, not a live indicator).
- Renaming
--timeoutto anything else.
Refs
- Sibling: [autoresearch] Make --auto-discover-pins the default; sweep docs so agents don't get stuck #3296 (autoresearch UX -- pin discovery default + green banner for LED tests). Same UX-improvement category, different surface.
- Trigger: hit during LPC845-BRK bring-up debugging on [BLOCKER] LPC845-BRK AutoResearch bring-up echo returns empty RX (suspected HardFault) — blocks #3102 #3300 / meta(lpc845-brk): bench-validate the three on-hand-hardware checklists (deploy + #565-sidestep + SCT-RX phases) #3102 -- the 60s wait felt silent because no banner announced the timeout.
Filed during /clud-fix burn-down on #3208 while debugging the LPC bring-up echo silence.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(autoresearch): 30s default timeout + yellow banner + standard ti…