Skip to content

[autoresearch] 30s default timeout + yellow banner + standard time notation parsing #3309

Closed

Description

@zackees

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 seconds
  • 2m -> 120 seconds
  • 1h -> 3600 seconds
  • 10m -> 600 seconds
  • 90 -> 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 10m parses correctly, runs for 600 s max, no banner.
  • bash autoresearch lpc845brk --timeout 5s (debugging-quick) runs for 5 s max.
  • bash autoresearch lpc845brk --no-timeout runs 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 --quiet suppresses 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 --timeout that'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 --timeout to anything else.

Refs

Filed during /clud-fix burn-down on #3208 while debugging the LPC bring-up echo silence.

Activity

  1. added a commit that references this issue on Jun 20, 2026
    8f8779c
  2. moved this from Triage to Done in FastLED Trackeron Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions