← Back to PRs

#8464: feat: make exec approval timeout configurable

by fabioaraujopt open 2026-02-04 02:26 View on GitHub →
docs agents stale
## Summary Add `tools.exec.approvalTimeoutSec` configuration option to control how long the system waits for an approval decision before timing out and denying a command. The default remains **120 seconds** for backward compatibility. Previously this was hardcoded to 120 seconds and could not be changed without modifying the source code. ## Changes - Add `approvalTimeoutSec` to `ExecToolConfig` type and zod schema - Add resolve function to convert seconds to milliseconds - Update `bash-tools.exec.ts` to use configured timeout - Pass config through `pi-tools.ts` - Update exec and exec-approvals docs ## Usage ```json5 { tools: { exec: { approvalTimeoutSec: 300 // 5 minutes } } } ``` Or via CLI: ```bash openclaw config set tools.exec.approvalTimeoutSec 300 ``` ## Test Plan - [x] Build passes (`pnpm build`) - [x] Lint passes (`pnpm check`) - [ ] Manual testing with different timeout values <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new `tools.exec.approvalTimeoutSec` configuration value (defaulting to 120s) and threads it through config types/zod schema and into `createExecTool`, replacing the previously hardcoded approval timeout for approval-gated exec flows. Docs were updated to mention the new setting. Main code impact is in `src/agents/bash-tools.exec.ts`, where approval expiry (`expiresAtMs`), the timeout passed to `exec.approval.request`, and the request RPC timeout are now derived from config instead of constants. <h3>Confidence Score: 4/5</h3> - This PR is generally safe to merge; it’s a small, well-scoped config plumbing change with minor semantics to double-check around timeouts. - Changes are localized and the new config is validated as a positive integer, reducing risk of invalid values. The main remaining concern is whether the derived request timeout (`approvalTimeoutMs + 10s`) matches intended UX for very small configured timeouts and whether the redundant flooring in the resolver is desired. - src/agents/bash-tools.exec.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs