Skip to content

feat(bin): make the Jev request timeout configurable, default 5 seconds - #44

Merged
alandomio merged 1 commit into
mainfrom
fm/jev-timeout-config
Sep 26, 2026
Merged

alandomio merged 1 commit into
mainfrom
fm/jev-timeout-config

Conversation

@alandomio

Copy link
Copy Markdown
Owner

Intent

Make the Jev shadow classifier's request timeout configurable. Captain 26/09/2026: 'riattiva jev con limite di 5 secondi'. bin/fm-jev.sh hard-coded JEV_TIMEOUT=2; read an optional config/jev-timeout (seconds, positive number, like config/jev-daily-cap), default 5; an invalid value keeps the default and is reported via status output. Update the fm-jev.sh header, docs/configuration.md Jev section, AGENTS.md layout list, and tests. Keep everything else identical (spend cap, pause-on-error semantics).

What Changed

  • bin/fm-jev.sh no longer hard-codes a 2-second request timeout. It reads an optional config/jev-timeout (a positive number of seconds) and uses 5 seconds when that file is missing. An invalid value also falls back to 5 seconds. The spend cap and the pause-on-error behavior are unchanged.
  • fm-jev.sh status now prints the request timeout in effect. When config/jev-timeout holds an invalid value, it also shows that value and says the default was kept.
  • Updated the fm-jev.sh header comment, the Jev section of docs/configuration.md and the layout list in AGENTS.md. Added coverage for the new timeout handling to tests/fm-jev.test.sh.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change is small and self-contained: it reads an optional timeout with a validated default of 5, reports invalid values in status, and leaves the spend cap and pause semantics untouched, with docs and tests updated as the intent requires.

Testing

I ran the Jev test script (tests/fm-jev.test.sh) and all 14 cases passed. They cover the new configurable timeout: the 5-second default, a configured value reaching curl, and rejection of invalid or zero values. The existing pause and spend-cap behaviour is unchanged. I also ran fm-jev.sh status by hand for each config case and saved the output as evidence.

Evidence: fm-jev.sh status timeout reporting

Source: fm-jev.sh status timeout reporting

missing -> request timeout: 5s 3 -> request timeout: 3s abc -> request timeout: 5s (config/jev-timeout value "abc" is not a positive number, default kept) 0 -> request timeout: 5s (config/jev-timeout value "0" is not a positive number, default kept)

$ config/jev-timeout=''; fm-jev.sh status
request timeout: 5s
$ config/jev-timeout='3'; fm-jev.sh status
request timeout: 3s
$ config/jev-timeout='abc'; fm-jev.sh status
request timeout: 5s (config/jev-timeout value "abc" is not a positive number, default kept)
$ config/jev-timeout='0'; fm-jev.sh status
request timeout: 5s (config/jev-timeout value "0" is not a positive number, default kept)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-jev.test.sh: all 14 cases pass, including the new test_timeout_is_configurable. It checks that 7.5 reaches curl as --max-time and that the updated default-timeout assertion now expects 5
  • Manual: ran bin/fm-jev.sh status in a temporary home with config/jev-timeout missing, set to 3, set to abc and set to 0
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@alandomio
alandomio merged commit 5e3614e into main Sep 26, 2026
24 of 25 checks passed
alandomio pushed a commit that referenced this pull request Sep 26, 2026
Guards the rebase onto #44's configurable timeout: both backends now
share one JEV_TIMEOUT read once per drain, so the override must apply
identically whichever backend is selected.
alandomio added a commit that referenced this pull request Sep 26, 2026
…sifier (#45)

* feat(bin): add a local Rizzo Flow backend to fm-jev.sh's shadow classifier

config/jev-endpoint selects a loopback Jev-compatible server (e.g. Rizzo
Flow's `rizzo serve`) over the existing OpenRouter path: no API key, no
spend cap, a 1-minute load-average ceiling pause instead
(config/jev-max-load), and non-loopback URLs refused outright. The
OpenRouter path stays byte-identical when config/jev-endpoint is absent.

* no-mistakes(review): Harden Jev local backend endpoint, proxy, and blank-file handling

* no-mistakes(review): Read Jev local load ceiling from the home config

* no-mistakes(document): Align fm-jev.sh header with local Jev backend

* test(bin): prove config/jev-timeout also governs the local Rizzo backend

Guards the rebase onto #44's configurable timeout: both backends now
share one JEV_TIMEOUT read once per drain, so the override must apply
identically whichever backend is selected.

* no-mistakes(review): Skip rows on Jev load spikes; cheap backend gate

---------

Co-authored-by: Alan Domio <a.domio@peter-park.de>
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