Skip to content

fix: seed always_allowed_commands into permission engine for scheduled tasks#229

Open
tpaulshippy wants to merge 1 commit into
andrewyng:mainfrom
tpaulshippy:fix/always-allowed-commands
Open

fix: seed always_allowed_commands into permission engine for scheduled tasks#229
tpaulshippy wants to merge 1 commit into
andrewyng:mainfrom
tpaulshippy:fix/always-allowed-commands

Conversation

@tpaulshippy

Copy link
Copy Markdown

The ScheduledTask model has an always_allowed_commands field, but it was never wired into the permission engine. _seed_task_permissions only seeded always_allowed_tools, so scheduled tasks with pre-approved shell commands still hung forever on approval.

The permission engine already supports session-level command allowlisting (permissions.py:155 checks session_allow_commands), so the fix is to also call allow_command_for_session(cmd) for each entry.

Fixes #228

…d tasks

The ScheduledTask model has an always_allowed_commands field, but it was
never wired into the permission engine. _seed_task_permissions only
seeded always_allowed_tools (via allow_tool_for_session), so scheduled
tasks with pre-approved shell commands still hung forever on approval.

The permission engine already supports session-level command allowlisting
(permissions.py:155 checks session_allow_commands), so the fix is to also
call allow_command_for_session(cmd) for each entry.

Also fixes the overlap guard deadlock: without this, the runner hangs
on a pending approval that never resolves, the finally block in
scheduler.py:run_task never executes, the task ID stays pinned in
_running_ids, and all subsequent runs are silently skipped.
@tpaulshippy
tpaulshippy deleted the fix/always-allowed-commands branch July 27, 2026 06:35
@tpaulshippy
tpaulshippy restored the fix/always-allowed-commands branch July 27, 2026 06:36
@tpaulshippy tpaulshippy reopened this Jul 27, 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.

Scheduled task hangs forever when tool requires approval; always_allowed_commands field is dead code

1 participant