Skip to content

feat(discuss): make the discussion request timeout configurable - #790

Merged
ajianaz merged 1 commit into
developfrom
feat/discuss-timeout
Nov 14, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/discuss-timeout

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What

The provider request timeout of a discussion is configurable. Precedence, as for TOLE_CONTEXT_WINDOW (#440): env TOLE_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 at timeout: global; discussion_host::factory never passed a timeout and no knob existed. Found in live use (#756, #786).

Changes

  • Settings.request_timeout (Eff<u64>) is resolved through the standard resolve_or path in config/apply.rs, so tole config check prints the resolved value and its source like every other key.
  • New [discussions] table (DiscussionsConfig, strict, bounded 1 to 3600). User layer only: layered drops the project's table and config check marks it IGNORED, like [cron] and [tui].
  • An invalid env value (not a number, 0, above 3600) is a startup error naming TOLE_DISCUSSION_TIMEOUT_SECS, never silently ignored (as effort_error, feat(core): reasoning effort setting, sent as reasoning_effort #457). A blank env counts as unset.
  • discussion_host::factory takes 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. New OpenAiProvider::request_timeout() getter. The two call sites (tole discuss, the discuss tool roster) use the installed value; the advisor keeps its 120 s.
  • tole doctor prints discussions: request timeout Ns (source).
  • Docs: README config and env rows, automation-design discussion section, CHANGELOG.

Testing

  • Resolution tests: env beats config, config beats default, invalid env errors naming the variable (text, 0, negative, fraction, 3601, overflow), bounds 1 and 3600 valid, project layer ignored, config check output (value, source, IGNORED, INVALID).
  • Factory test: the built provider carries the configured timeout, and the default pins 120 s. Mutation check: removing .with_timeout fails it (left: 120s, right: 600s).
  • Real-binary test (tests/discuss_timeout_e2e.rs) against a mock that answers participants after 3 s: timeout 2 s fails the turn with timeout, 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

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.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit e73bfe2 into develop Nov 14, 2026
22 checks passed
@ajianaz
ajianaz deleted the feat/discuss-timeout branch November 20, 2026 08:36
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.

discuss: make the provider request timeout configurable (env + config)

2 participants