Skip to content

feat(config): make approval timeout configurable (support timeout_s=0 for unlimited) (#1823)#1837

Draft
bloodycoder wants to merge 1 commit intoMoonshotAI:mainfrom
bloodycoder:autopilot/issue-1823-approval-timeout
Draft

feat(config): make approval timeout configurable (support timeout_s=0 for unlimited) (#1823)#1837
bloodycoder wants to merge 1 commit intoMoonshotAI:mainfrom
bloodycoder:autopilot/issue-1823-approval-timeout

Conversation

@bloodycoder
Copy link
Copy Markdown

Summary

Implements #1823 by making approval request timeout configurable.

What changed

  1. Added approval.timeout_s in config (default: 300).
  2. Runtime behavior:
    • timeout > 0: finite timeout via existing timeout path
    • timeout == 0: wait indefinitely
    • internal None: still treated as unlimited mode
  3. Added validation for timeout values:
    • reject negative values
    • reject non-finite values (NaN, Inf, -Inf)
  4. Wired timeout from config into shared approval state so subagents inherit the same behavior.
  5. Updated EN/ZH config docs with unified semantics.

Files changed

  • src/kimi_cli/config.py
  • src/kimi_cli/approval_runtime/runtime.py
  • src/kimi_cli/soul/approval.py
  • src/kimi_cli/soul/agent.py
  • tests/core/test_config.py
  • tests/core/test_approval_runtime.py
  • tests/core/test_approval_timeout_config.py
  • docs/en/configuration/config-files.md
  • docs/zh/configuration/config-files.md

Expected behavior

  • Default remains 300s.
  • Users can set custom finite timeout via approval.timeout_s.
  • approval.timeout_s = 0 means unlimited wait.

Test plan

Added/updated tests for:

  • config default/valid/invalid timeout parsing
  • runtime timeout behavior (300, 0, cancellation in unlimited mode)
  • timeout config injection + subagent inheritance consistency

Current status

Draft PR due to local environment mismatch:

  • local Python: 3.9
  • repo requires: >=3.12 (.python-version is 3.14)
  • missing tools: uv, tmux

I will rerun and attach full passing logs once environment is aligned.

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