Repository navigation
feat(discuss): make the discussion request timeout configurable - #790
Merged
Merged
Conversation
Discussions do not stream, so one provider call is the model's whole generation and a reasoning model can pass the 120 s default. Add env TOLE_DISCUSSION_TIMEOUT_SECS > user config [discussions] request_timeout_secs > 120 (1 to 3600 s), resolved through Settings and shown by config check and doctor. User layer only; an invalid env value is a startup error naming the variable.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What
The provider request timeout of a discussion is configurable. Precedence, as for
TOLE_CONTEXT_WINDOW(#440): envTOLE_DISCUSSION_TIMEOUT_SECS> user config[discussions] request_timeout_secs> default 120 s (unchanged). Allowed range 1 to 3600 seconds.Why
Discussions do not stream (the whole reply must land before a ledger entry is written), so one call is the model's entire generation. On reasoning models (GLM via Z.AI) with a growing shared context that passes the 120 s default of
OpenAiProvider::new, and every round dies attimeout: global;discussion_host::factorynever passed a timeout and no knob existed. Found in live use (#756, #786).Changes
Settings.request_timeout(Eff<u64>) is resolved through the standardresolve_orpath inconfig/apply.rs, sotole config checkprints the resolved value and its source like every other key.[discussions]table (DiscussionsConfig, strict, bounded 1 to 3600). User layer only:layereddrops the project's table andconfig checkmarks itIGNORED, like[cron]and[tui].TOLE_DISCUSSION_TIMEOUT_SECS, never silently ignored (aseffort_error, feat(core): reasoning effort setting, sent as reasoning_effort #457). A blank env counts as unset.discussion_host::factorytakes the timeout and applies it with the existing.with_timeout(Duration). The value is the provider's global request timeout: connect, send and reading the whole reply of one call, not an idle timeout; documented. NewOpenAiProvider::request_timeout()getter. The two call sites (tole discuss, the discuss tool roster) use the installed value; the advisor keeps its 120 s.tole doctorprintsdiscussions: request timeout Ns (source).Testing
config checkoutput (value, source, IGNORED, INVALID)..with_timeoutfails it (left: 120s, right: 600s).tests/discuss_timeout_e2e.rs) against a mock that answers participants after 3 s: timeout 2 s fails the turn withtimeout, timeout 10 s (from the user config) succeeds, env 2 s beats config 10 s, invalid env values stop startup naming the variable. About 7 s total.cargo fmt,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace.Closes #786
Refs #756