unsloth/.github/scripts
Daniel Han 03590f696e
Give opencode real timeout headroom in Local Agent Guides CI (#7235)
* Raise the opencode invoke timeout in Local Agent Guides CI

The connection (opencode) cell flakes with a 600s timeout reported as guide drift, but it is not a hang: in a passing run the same opencode run finishes in ~482s (08:12:31 to 08:20:33), right against the shared AGENT_INVOKE_TIMEOUT of 600s, so about one run in six drifts past the cap.

opencode is the slow outlier. The print-mode agents (claude -p, codex exec) run one turn against a minimal injected system prompt, while opencode run runs its own full turn with opencode's large system prompt plus a separate small_model call to name the session (start.py pins small_model to the same 4B the server hosts). On a CPU-served gemma-4-E4B that is about 8 minutes, leaving no margin under 600s.

Double opencode's per-invoke timeout in agent-guides-drive.sh and keep the tight 600s cap for the fast agents, so a genuine headless-TTY hang still fails quickly. 1200s stays well under the 40-minute job budget.

* Normalize the agent invoke timeout before doubling it for opencode

Strip an optional trailing 's' from AGENT_INVOKE_TIMEOUT so the opencode
arithmetic, and the "${TIMEOUT}s" timeout message, stay valid if a
timeout(1)-style suffix is ever configured.

* Only double the opencode timeout for a bare-integer seconds value

Guard the arithmetic so a GNU timeout(1) duration suffix (s/m/h/d, including
floats like 0.5s) is passed through unchanged instead of breaking the
expansion; timeout(1) parses those directly. Bare seconds still double.

---------

Co-authored-by: danielhanchen <unslothai@gmail.com>
2026-07-19 06:08:54 -07:00
..
agent-guides-drive.sh Give opencode real timeout headroom in Local Agent Guides CI (#7235) 2026-07-19 06:08:54 -07:00
agent-guides-install.sh CLI: Rename unsloth connect to unsloth start (#6613) 2026-07-03 08:17:27 -07:00
assert-llama-loads.sh Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
assert-prompt-cache.sh Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
ci-connect-prompt.txt Add Local Agent Guides CI (#6547) 2026-06-22 04:21:48 -07:00
ci-min-system-prompt.txt Add Local Agent Guides CI (#6547) 2026-06-22 04:21:48 -07:00
hf-download-with-retry.sh Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
serve-unsloth-run.sh CLI: Rename unsloth connect to unsloth start (#6613) 2026-07-03 08:17:27 -07:00