Skip to content

fix(tui): make subagent api timeout configurable#1808

Closed
LING71671 wants to merge 2 commits into
Hmbown:mainfrom
LING71671:fix/subagent-api-timeout-config
Closed

fix(tui): make subagent api timeout configurable#1808
LING71671 wants to merge 2 commits into
Hmbown:mainfrom
LING71671:fix/subagent-api-timeout-config

Conversation

@LING71671
Copy link
Copy Markdown
Contributor

Summary

Closes #1806.

This PR makes the sub-agent per-step model API timeout configurable without changing the legacy default:

  • adds [subagents] api_timeout_secs
  • keeps the default at 120 seconds for backwards compatibility
  • caps configured values at 1800 seconds
  • threads the resolved timeout through EngineConfig into SubAgentRuntime
  • uses the configured timeout around each sub-agent create_message call
  • documents the setting in docs/CONFIGURATION.md and docs/SUBAGENTS.md

Scope

This intentionally implements the minimal timeout-control fix from the issue. It does not change sub-agent tool permissions, write access, streaming, or checkpoint behavior.

Validation

Passed:

  • cargo fmt --all -- --check
  • git diff --check
  • cargo check -p deepseek-tui --bin deepseek-tui
  • cargo test -p deepseek-tui --bin deepseek-tui subagent_api_timeout_defaults_to_legacy_120s
  • cargo test -p deepseek-tui --bin deepseek-tui subagent_api_timeout_only_clamps_to_maximum
  • cargo test -p deepseek-tui --bin deepseek-tui child_runtime_preserves_api_timeout
  • cargo test -p deepseek-tui --bin deepseek-tui subagent_runtime_default_api_timeout_is_legacy_120s
  • cargo test -p deepseek-tui --bin deepseek-tui tools::subagent::tests::
  • cargo build
  • cargo clippy --workspace --all-targets --all-features

Notes:

  • cargo build / cargo clippy still report pre-existing warnings in schema_migration.rs.
  • cargo clippy also still reports the pre-existing needless_return warnings in tui/ui.rs.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a configurable per-step model API timeout for sub-agents, including configuration updates, runtime propagation, and documentation. The reviewer suggests enforcing a minimum timeout of 1 second to prevent configuration errors and ensuring that all documentation and tests consistently reflect the valid range of 1 to 1800 seconds.

Comment thread crates/tui/src/config.rs Outdated
Comment thread crates/tui/src/config.rs
Comment thread crates/tui/src/config.rs Outdated
Comment thread docs/CONFIGURATION.md Outdated
Comment thread docs/SUBAGENTS.md Outdated
@Hmbown Hmbown mentioned this pull request May 20, 2026
11 tasks
@Hmbown
Copy link
Copy Markdown
Owner

Hmbown commented May 21, 2026

Thanks for the configurable subagent API timeout work. This was harvested into v0.8.40 release PR #1823 as commit ad122fd, and #1823 is now CI-green. Closing as superseded by the release branch; thank you for improving long-running subagent behavior.

@Hmbown Hmbown closed this May 21, 2026
@LING71671
Copy link
Copy Markdown
Contributor Author

Thanks for harvesting this into v0.8.40. Glad the subagent timeout work made it into the release branch.

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.

Subject: Sub-agent 120s API timeout renders agent_open nearly unusable (v0.8.39)

2 participants