spawner: auto-replace completed Tasks on re-discovery#415
Closed
axon-agent[bot] wants to merge 1 commit intomainfrom
Closed
spawner: auto-replace completed Tasks on re-discovery#415axon-agent[bot] wants to merge 1 commit intomainfrom
axon-agent[bot] wants to merge 1 commit intomainfrom
Conversation
When a work item reappears in discovery results (e.g., a label was removed and re-added to re-queue an issue), the spawner now automatically deletes the old completed/failed Task and creates a fresh one. Previously, the spawner skipped any item whose Task already existed regardless of phase, requiring the /reset-worker GitHub Actions workflow or manual Task deletion to re-trigger work. This closes the re-work loop natively: remove the excludeLabel from an issue, and the spawner will pick it up on the next poll cycle without any external intervention. Active (Running/Pending/Waiting) Tasks are never affected — only Tasks in terminal phases (Succeeded/Failed) are replaced. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Actually, preventing a new task with the same name from being generated is a feature. /reset-worker |
Collaborator
|
not to auto-replace completed tasks is intentional in order to have a cooldown for the same issue or PR. |
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.
🤖 Axon Agent @gjkim42
Summary
axon/needs-inputlabel removed), automatically delete the old completed/failed Task and create a fresh one/reset-workeror manualkubectl delete taskto re-trigger work on the same issueProblem
The current spawner deduplication logic at
cmd/axon-spawner/main.go:188treats any existing Task — whether Running, Succeeded, or Failed — as "already handled":This creates a re-work bottleneck in the label-based feedback loop used by
axon-workers:actor/axonlabel → spawner createsTask/axon-workers-42axon/needs-inputlabelaxon/needs-input→ issue reappears in discoveryTask/axon-workers-42(Succeeded) and skips itThe
/reset-workerGitHub Actions workflow (.github/workflows/reset-axon-worker.yaml) exists specifically to work around this — it requires GKE auth andkubectlaccess to delete the Task. Issue #369 proposes another workaround for CI-failure retriggers. Both are symptoms of this root cause.Solution
Change the spawner's deduplication logic to check the Task phase. When a re-discovered item's Task is in a terminal phase (Succeeded/Failed), delete it and treat the item as new:
Active Tasks (Running/Pending/Waiting) are never affected.
Impact on self-development
Before: Remove
axon/needs-input→ wait up to 1 hour for TTL, or use/reset-workerAfter: Remove
axon/needs-input→ spawner picks it up on next poll (1 minute foraxon-workers)The
/reset-workerworkflow remains useful for force-resetting active tasks, but is no longer needed for the common re-work case.Test plan
TestRunCycleWithSource_RediscoveredCompletedTaskIsReplaced— succeeded task is replacedTestRunCycleWithSource_RediscoveredFailedTaskIsReplaced— failed task is replacedTestRunCycleWithSource_ActiveTaskNotReplaced— running task is NOT replacedgo build ./cmd/axon-spawner/succeedsRelated issues
🤖 Generated with Claude Code
Summary by cubic
Auto-replace completed or failed Tasks when their work items are rediscovered, so re-queued issues (e.g., label removed/re-added) are processed on the next poll without using /reset-worker. Active tasks are not touched.
Written for commit 28ab2a0. Summary will update on new commits.