feat(nano): round 3 — long-running work support + operational verification (FOR REVIEW) - #900
Conversation
…bash-no-timeout"" This reverts commit b21a6ba.
…constraint-checklist"" This reverts commit 3e705e4.
tb21-nano-flash-max-2 shows 29 run_in_background launches across 9 trials — all long-running-work tasks (compile-compcert, caffe-cifar-10, train-fasttext, ...). In nano the param is a trap: retrieving a backgrounded command's output needs the TaskOutput tool, which the nano surface deliberately lacks, so the model strands the output and falls into exactly the log-poll loops the no-timeout contract eliminates. With no default timeout, one blocking call is strictly better. The nano Bash schema no longer advertises the param (additionalProperties stays false, so passing it anyway yields an actionable validation error naming it), and the legacy timeout_s description loses its stale '(1-600)' cap text. Stock schema untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Test Results 5 files 997 suites 28m 54s ⏱️ For more details on these failures, see this check. Results for commit 447446e. ♻️ This comment has been updated with latest results. |
…idle watchdog Answers the question the no-timeout contract raises: how do we detect a bash call stuck forever? Layered: 1. stdin=DEVNULL (already present) — interactive prompts see EOF and fail fast instead of waiting for input forever. 2. NEW concurrent pipe drain: stdout/stderr are drained by reader threads using raw os.read (returns on ANY available bytes; TextIOWrapper.read(n) blocks until n chars and starved the liveness stamp on drip-feed output). This also fixes a latent deadlock in ALL modes: with communicate()-at-exit, any command writing more than the ~64KB pipe buffer blocked on write and could never exit — the stock hard timeout misreported those as 'timed out'; under an unbounded timeout they would hang outright. 3. NEW output-idle watchdog (nano only): a command with NO output for NANO_BASH_IDLE_TIMEOUT_S (default 600s) while still running is presumed stuck and killed with a teaching error — re-run non-interactively / add progress output / pass an explicit timeout. A noisy 40-minute build never trips it. Stock keeps its hard-timeout model unchanged. 4. Explicit timeout param, the abort signal, and the task wall-clock remain the outer layers. Nano Bash doc states the keep-long-jobs-chatty contract. 11 watchdog/ drain tests (silent-stuck killed in seconds with the teaching message; drip-feed chatty command spared; >64KB outputs complete in both modes; stock unaffected); 201 nano+bash tests pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Targeted validation results (k=1, previously-failed tasks, this branch's wheel):
Also added since the PR opened: the Launching the full-suite |
|
Full-suite v3 result (tb21-nano-flash-max-3, this branch's wheel + vision + websearch): Topline: 61/87 verified (+2 trials lost to a pre-agent infra failure — curl SSL error fetching the uv installer; zero agent involvement; being re-run) at $1.04. v2 was 64/89, v1 60/89. Mechanism attribution is clean in both directions:
Cross-run stability (the honest 0.8 frame): pass@1 = 60/64/61 across three draws (±3 noise); stable core v2∩v3 = 55; pass@2 = 70/89 (78.7%); pass@3 = 73/89 (82.0%). 16 tasks never solved in any run — video/vision-heavy, cross-toolchain builds, compute/think-bound — the genuine capability frontier at this model tier. Verdict: the branch's mechanisms are individually validated and net-positive; single-draw pass@1 sits ~70±3% with the capability union above 82%. |
|
Infra-rerun correction: both pre-agent infra deaths (curl SSL fetching the uv installer, zero agent involvement) pass when actually run — hf-model-inference 1.0, qemu-startup 1.0. Corrected v3: 63/89 (70.8%). Final cross-run picture for this branch: pass@1 = 60 / 64 / 63 across the three draws (±2 around ~62); stable core 55; pass@2 = 70/89 (78.7%), pass@3 = 73/89 (82.0%); 16 never-solved tasks form the capability frontier at deepseek-v4-flash. All 6 v3 gains are branch-attributed, zero losses branch-caused, idle watchdog 0 misfires in 89 tasks. |
Port of pi's shell-output.ts capture model (the one residual bash-layer advantage pi held after round 3): * Tail-keep, not head-keep: for a long build the signal is at the END (the error, the final metrics); stock truncation keeps s[:limit] and drops exactly that. Nano replies now show the last BASH_MAX_OUTPUT_LENGTH chars. * The full output survives: once a stream crosses the limit it spills, complete from byte 0, to a temp file whose path is in the footer — [Showing last N of M lines (X KB total). Full output: /tmp/bash-...] — so the model greps the whole log instead of re-running the build. * Bounded memory: the drain keeps only ~2x limit per stream in a rolling deque (pi's lazy-lossless trigger: file created at 1x while memory still holds everything), so a multi-GB log no longer accumulates unbounded in chunk lists. Stock mode is byte-identical: the spool is wired only under the nano gate; all four result paths (normal/interrupted/timeout/idle) branch on the attached TailCapture and fall back to the old truncate_output. Nano Bash doc tells the model the tail+file contract (still <500 chars). Tests: 5 new (tail-keep+spill, small passthrough, stderr-separate, UTF-8 re-align on trim, stock unchanged); pipe-drain test marker moved to the end (tail-keep); nano suite 81 passed, stock bash suites 142 passed. Live smoke: 4001-line fake build log -> reply ends with the FATAL line + footer, spill file complete (169,826 bytes). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Added: pi-style rolling-tail truncation + full-output spill file (447446e, requested follow-up) The one residual bash-layer advantage pi held: its truncation keeps the tail of long output (where a build's error and final metrics live — stock head-keep drops exactly that) and spills the complete stream to a temp file whose path is handed to the model, so it can grep the whole log instead of re-running a 25-minute build. Mechanics (port of pi's
Validation: nano suite 81 passed; live smoke with a 4001-line fake build log → reply ends with the |
Held for your review — will not be auto-merged. Reapplies the round-3 changes (#897/#898, reverted from main by #899 pending your decision).
Gap analysis driving the round (tb21-nano-flash-max-2, 25 incorrect tasks)
Changes
NANO_MAX_TURNSoverride).Evidence
5 new tests; 70 nano + 125 bash regressions pass; live
sleep 130completes in one nano call (old default killed at 120s). Targeted k=1 validations on compile-compcert / train-fasttext / caffe-cifar-10 are running with this branch's wheel — results will be posted as a PR comment.🤖 Generated with Claude Code