fix: seed always_allowed_commands into permission engine for scheduled tasks#229
Open
tpaulshippy wants to merge 1 commit into
Open
fix: seed always_allowed_commands into permission engine for scheduled tasks#229tpaulshippy wants to merge 1 commit into
tpaulshippy wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ScheduledTask model has an always_allowed_commands field, but it was never wired into the permission engine.
_seed_task_permissionsonly seededalways_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:155checkssession_allow_commands), so the fix is to also callallow_command_for_session(cmd)for each entry.Fixes #228