Skip to content

feat: the owner chooses how long a request for permission waits - #42

Merged
httpsphl merged 2 commits into
mainfrom
feat/approval-wait
Sep 29, 2026
Merged

httpsphl merged 2 commits into
mainfrom
feat/approval-wait

Conversation

@httpsphl

Copy link
Copy Markdown
Owner

Stacked on #41: it adds a choice to the Chat part of Settings.

What

Settings → Chat gets How long a request for permission waits for you, with 15 min, 30 min, 1 hour, 2, 4 or 8 hours. The line under it says that, with no answer by then, the bot's request is denied. A value set by hand in config.toml shows up in the list too.

How

  • Settings API: settings.get and settings.update gain approvalWaitMinutes.
    • The daemon accepts 1 to 1440 minutes.
    • It saves the value as bots.approval_timeout_minutes, and a comment after the old value stays.
  • Live value: the wait now lives in LiveSettings and has left BotSettings. Approvals and workspace_env read the current value.
  • Longer wait: it has to reach each bot's mcp.json, which Claude Code only reads when it starts. So Supervisor::workspace_settings_changed restarts every running bot once nothing is in progress, and the bot resumes its conversation (the same path as a mode change).
  • Shorter wait: no restart is needed, because the daemon answers before the old limit.
  • Spec: sections 6, 10.1, 11.2 and 15.1 updated.

Tests

  • cargo test, clippy -D warnings, fmt and pnpm check pass (163 app tests).
  • New tests:
    • An idle bot restarts with the new timeout in mcp.json after a longer wait; a shorter wait restarts nothing.
    • 0 and 1441 minutes are refused.
    • A changed value keeps its comment, and a new one goes into [bots].
    • The app lists the waits, including one set by hand, and saves the choice.

Manual step still open

  • A real Claude Code 2.1.284 bot with an 8-hour wait: it should start with its MCP server connected, and a request answered after more than an hour should reach the bot. The largest timeout (8 h 2 min, about 28.9 million ms) is still below the 2^31 ms limit of Node's timers.

settings.update takes approvalWaitMinutes (1 to 1440) and saves it as
bots.approval_timeout_minutes, keeping a comment after the old value.
The wait is live: the next request waits the new time, and a longer one
restarts each bot once nothing is in progress, since Claude Code reads
the timeout in mcp.json when it starts. Settings, Chat offers 15 min to
8 hours, plus a value set by hand.
@httpsphl
httpsphl changed the base branch from feat/settings-sections to main September 29, 2026 23:05
@httpsphl
httpsphl merged commit dc56652 into main Sep 29, 2026
3 checks passed
@httpsphl httpsphl mentioned this pull request Sep 30, 2026
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