Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion eval/harbor/run_tb21_nano_max.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ PYTHONPATH="$ROOT/eval/harbor" harbor run \
--ak "source=$WHEEL" \
--ak nano=1 \
--ak effort=max \
--ak "max_turns=${NANO_MAX_TURNS:-600}" \
${AK_EXTRA[@]+"${AK_EXTRA[@]}"}

echo
Expand Down
10 changes: 3 additions & 7 deletions src/nano/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,9 @@
"files merely by opening them",
"- Get a minimal working version of the requested deliverable in "
"place early, then iterate to improve it",
"- Run long builds, training runs, or downloads as ONE blocking bash "
"command (tee output to a log) — never launch with nohup and poll in "
"a loop",
"- Before finishing, re-read the task and list every explicit "
"requirement and constraint (exact formats, tolerances, numeric "
"bounds, required sources or methods), then test your artifact "
"against each one; plausible output is not verified output",
"- Before finishing, re-read the task and verify each explicit "
"requirement against what you actually produced; plausible output "
"is not verified output",
"- Be concise in your responses",
"- Show file paths clearly when working with files",
)
Expand Down
7 changes: 2 additions & 5 deletions src/nano/tool_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@
),
"Bash": (
"Executes a bash command and returns stdout+stderr. The working "
"directory persists between commands; shell state does not. No "
"default timeout: a long build or training run can block in a "
"single call (tee output to a log file) — pass timeout (ms) only "
"when you want one. Long output is truncated. Quote paths "
"containing spaces."
"directory persists between commands; shell state does not. Long "
"output is truncated. Quote paths containing spaces."
),
# Edit is intentionally absent: the nano registry swaps in
# NanoEditTool (src/nano/edit_tool.py), which carries its own doc for
Expand Down
24 changes: 3 additions & 21 deletions src/tool_system/tools/bash/bash_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,37 +659,19 @@ def _bash_call(tool_input: dict[str, Any], context: ToolContext) -> ToolResult:
)

# Resolve timeout: prefer explicit timeout (ms), fall back to timeout_s (legacy), then default
#
# Nano mode removes the ceiling entirely (pi's bash has no default
# timeout). Measured on TB 2.1 (tb21-nano-flash-max-2): the 2-minute
# default / 10-minute cap forced nohup-and-poll loops on every long
# build or training run — 225 poll-pattern commands across the 25
# failed tasks, with compile-compcert alone burning 111 polls and
# dying at the 300-turn ceiling mid-build. One blocking call costs
# zero turns; the benchmark/task wall-clock and the abort signal
# (checked continuously by _run_supervised) remain the backstops.
from src.nano.state import is_nano_mode as _bash_is_nano

_nano = _bash_is_nano()
_NANO_NO_TIMEOUT_S = 86_400 # 24h — effectively "until abort/wall-clock"
timeout_ms = tool_input.get("timeout")
if timeout_ms is not None:
max_ms = get_max_timeout_ms()
if not isinstance(timeout_ms, (int, float)) or timeout_ms < 1000:
raise ToolInputError("timeout must be at least 1000 ms")
if timeout_ms > max_ms and not _nano:
if timeout_ms > max_ms:
raise ToolInputError(f"timeout must not exceed {max_ms} ms")
timeout_s = int(timeout_ms / 1000)
else:
timeout_s = tool_input.get("timeout_s")
if timeout_s is None:
timeout_s = (
_NANO_NO_TIMEOUT_S if _nano
else int(get_default_timeout_ms() / 1000)
)
if not isinstance(timeout_s, int) or timeout_s < 1 or (
timeout_s > 600 and not _nano
):
timeout_s = int(get_default_timeout_ms() / 1000)
if not isinstance(timeout_s, int) or timeout_s < 1 or timeout_s > 600:
raise ToolInputError("timeout_s must be an integer between 1 and 600")

# Persist cwd across invocations (port of ``typescript/src/utils/Shell.ts``,
Expand Down
56 changes: 0 additions & 56 deletions tests/nano/test_nano_bash.py

This file was deleted.

Loading