feat(tasks): background TaskRunner executor + expanded task states - #182
Merged
Conversation
Patel230
force-pushed
the
feat/security-hygiene-cli
branch
from
August 6, 2026 03:01
26c3782 to
c21fe18
Compare
Closes the last KiroCrew gap: the TaskStore was store-only — nothing consumed its retry/replan/checkpoint machinery. Add the execution half: - TaskRunner (internal/tool/task_executor.go): a background executor loop that picks up ready work (pending, no open blockers), runs each task through a host Execute callback, applies the store's retry budget with exponential backoff via MarkFailed, replans tasks that exhaust their budget (OnReplan + Requeue, bounded by MaxReplans), enforces a MaxTotalTasks watchdog, and cancels in-flight tasks on stop. - New task states (KiroCrew parity): reviewing, skipped, cancelled, with TaskStore.Skip/Cancel and Schedule() validation extended. - TaskRunTool + ToolContext.TaskExecutor: the agent (or host) can invoke TaskRun to drive ready tasks; the session arms it with an agent-spawn based executor (subject/description/checkpoint become the sub-agent prompt). TaskUpdateTool accepts the new states and resets the retry budget on any explicit exit from failed.
Patel230
force-pushed
the
feat/task-executor
branch
from
August 6, 2026 03:19
cd6ec89 to
791a5a5
Compare
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.
Closes the last gap from the KiroCrew line-by-line comparison: hawk's
TaskStorewas store-only — it had persistence, retry budgets (MarkFailed), replan (Requeue), and checkpoint APIs, but nothing executed tasks. KiroCrew'sTaskRunner/TaskExecutoractually run tasks in a loop with retry, recovery, and a watchdog.What this adds
1.
TaskRunnerbackground executor (internal/tool/task_executor.go)GetReadyWork().Executecallback (with optional per-task timeout).MarkFailed) with exponential backoff (retryBackoffTickrespected viadueTasks).OnReplan+Requeue(fresh budget), bounded byMaxReplansper task.MaxTotalTaskscaps distinct tasks reaching a terminal state (default 50) so a runaway graph can't loop forever.Stop()/ctx-done cancels in-flight executions and parks tasks ascancelled(not consuming retry budget).Run(blocking) /Start/Stop/Wait/Status.2. Expanded task states (KiroCrew parity)
reviewing,skipped,cancelled.TaskStore.Skip/TaskStore.Cancel(reasons recorded in metadata).Schedule()validation extended to accept the new states.TaskUpdateToolaccepts the new states and resets the retry budget on any explicit exit fromfailed(not justpending).3. Live wiring
ToolContext.TaskExecutorarms the newTaskRunTool: the agent can invokeTaskRunto drive all ready tasks through the executor and get a run summary.Verification
go build ./...,go vet,golangci-lint, boundary scripts — clean.go test ./internal/tool/... ./internal/engine/ ./cmd/— green.Stacked on #181 (base
feat/security-hygiene-cli).