Repository navigation
Conversation
Every operational curl call in the installer and CLI is bounded except two stragglers: - installers/phases/12-health.sh fetches Perplexica /api/config before pushing the provider config with no timeout — while the identical query 20 lines earlier already uses --max-time 5. A wedged Perplexica listener freezes phase 12 mid-install. - installers/macos/ods-macos.sh cmd_chat POSTs chat completions with no bound, so a stalled local or cloud endpoint hangs the chat command forever. Bound the config fetch with --max-time 5 (matching its sibling) and the chat POST with --connect-timeout 5 --max-time 300 (generous ceiling for slow inference; bounds hangs, not slow responses). Regression test stubs curl to sleep 30s on any call lacking --max-time, evals the real cmd_chat body and each extracted /api/config fetch line, and statically sweeps both files: red on base (two 124 hangs + sweep hits), green here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this matters
ODS bounds essentially every operational
curlcall — preflight probes, health checks, downloads, update checks — except two stragglers:installers/phases/12-health.sh— after detecting Perplexica needs configuration, the phase fetches${PERPLEXICA_URL}/api/configto learn provider UUIDs with no timeout, then pipes it into the config-push Python. A wedged Perplexica listener (container "Created", port mapped but app hung, firewall DROP) freezes install phase 12 indefinitely with the installer looking alive. The identical query 20 lines earlier in the same block already uses--max-time 5— this site was simply missed.installers/macos/ods-macos.shcmd_chat— the./ods-macos.sh chatcommand POSTs to/v1/chat/completionsunbounded. A stalled local inference server or unreachable cloud endpoint hangs the user's terminal forever; every other probe in the same file uses--max-time 10.A peer that accepts TCP but never answers is precisely the failure mode
--connect-timeoutalone cannot catch —--max-timeis required.What changed
12-health.sh:curl -sf --max-time 5 "${PERPLEXICA_URL}/api/config"— same bound as the sibling fetch above it.ods-macos.sh:curl -sf --connect-timeout 5 --max-time 300 -X POST ...— generous ceiling for slow CPU/cloud inference; bounds hangs, not slow responses.No behavior change when services respond normally; failures now surface through the existing error paths (
PERPLEXICA_SETUPempty → auto-setup skipped,cmd_chat→ "Chat request failed.").Regression test
ods/tests/test-curl-timeout-stragglers.shstubscurlon PATH: the stub records argv and sleeps 30 s when--max-timeis absent. It then:cmd_chatfunction body (extracted fromods-macos.sh) with stubbedai/resolve_cli_llm_route— boundary-level proof the flags reach curl's argv;curl ... /api/configinvocation line from12-health.shunder the stub;curl -…invocation lackingmax-time/a bounds array.Red on
upstream/public-beta(15eb56fab):cmd_chatstalls → exit 124; the second/api/configfetch stalls → 124; sweep reports 1 unbounded call per file.1 passed, 5 failed.Green on this branch:
6 passed, 0 failed— and the already-bounded sibling fetch at :494 correctly passes, confirming the harness isn't tautological.Validation
bash -nboth files: cleanshellcheck -S erroron both files + test: cleangit diff --check: cleanOverlap check
Searched open/closed PRs for
12-health,ods-macos curl,curl timeout install. Closed unmerged attempts (#435, #391) were broad sweeps abandoned long ago; #1229 (merged) bounded the STT preload only. My own #6180 covers the demo scripts — disjoint files. No open PR touches these two call sites.Notes