Skip to content

fix(demo): bound all curl calls in first-boot-demo and showcase - #6180

Closed
0xacee wants to merge 1 commit into
Osmantic:public-betafrom
0xacee:fix/demo-curl-timeouts
Closed

0xacee wants to merge 1 commit into
Osmantic:public-betafrom
0xacee:fix/demo-curl-timeouts

Conversation

@0xacee

@0xacee 0xacee commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Why this matters

ods/scripts/first-boot-demo.sh and ods/scripts/showcase.sh are the first-run showcase a new ODS user sees. Every one of their curl calls ran with no connection or total timeout — 7 sites in first-boot-demo, 4 in showcase. A service that accepts TCP but never answers (wedged listener, firewall DROP rule, stalled SSE stream, misconfigured port forward) makes curl wait indefinitely, freezing the demo with no error and no way forward short of Ctrl+C. The neighboring ods-preflight.sh and health-check.sh already bound every probe; the demo scripts were the remaining unbounded operational surface.

What changed

Two flag arrays, defined once per script next to the URL config:

CURL_PROBE_FLAGS=(--connect-timeout 3 --max-time 10)   # same as ods-preflight.sh
CURL_GEN_FLAGS=(--connect-timeout 5 --max-time 300)    # generous ceiling for slow inference
  • first-boot-demo.sh: check_service() + Whisper/Piper/n8n probes use CURL_PROBE_FLAGS; the chat, code-assistant, and streaming completions use CURL_GEN_FLAGS. The streaming call keeps -sN and its pipe — --max-time bounds a stalled stream rather than changing its semantics.
  • showcase.sh: check_service() uses CURL_PROBE_FLAGS; all three chat-completions calls use CURL_GEN_FLAGS.

No endpoint, parsing, UX, or success-reporting changes — timeout bounding only.

Regression test

ods/tests/test-demo-curl-bounds.sh stubs curl on PATH: the stub logs its argv and sleeps 30 s when --max-time is absent, simulating a wedged peer. Both scripts are then driven end-to-end under a 20 s outer timeout (first-boot-demo.sh --quick; showcase.sh via a scripted menu session covering the chat, RAG, and code-assistant POSTs), followed by a static sweep asserting every curl call site references a bounds array.

  • Red on upstream/public-beta (4d725ee95): both scripts stall on their first unbounded call (exit 124); the sweep reports 7 + 4 unbounded sites. 1 passed, 7 failed.
  • Green on this branch: 8 passed, 0 failed — 8 recorded calls in first-boot-demo, all 3 completion paths in showcase, all bounded.

Validation

  • bash -n both scripts: clean
  • shellcheck -S error on both scripts + the test: clean
  • git diff --check: clean

Overlap check

Searched open/closed PRs for demo curl timeout, showcase, first-boot. Neighbors verified disjoint:

None bound the existing call sites.

Notes

  • Live end-to-end validation against real services is pending CI/maintainer run; the stub harness exercises the same argv boundary curl sees.
  • The --max-time 300 generation ceiling is intentionally generous (CPU inference on large models); it bounds hangs, not slow responses.

Every curl invocation in the demo scripts ran with no connect or total
timeout, so a service that accepts TCP but never answers (wedged
listener, firewall drop, stalled stream) froze the demo indefinitely —
the very first-run experience ODS presents to new users.

Add CURL_PROBE_FLAGS (--connect-timeout 3 --max-time 10, matching the
ods-preflight.sh health-check convention) to all health probes and
CURL_GEN_FLAGS (--connect-timeout 5 --max-time 300) to the completion
calls, including the streaming demo so a stalled stream still exits.

Regression test stubs curl to hang on any invocation lacking --max-time
and drives both scripts end-to-end; red on base, green here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant