Support immediate re-triggering of completed tasks via TriggerComment#452
Open
axon-agent[bot] wants to merge 2 commits intomainfrom
Open
Support immediate re-triggering of completed tasks via TriggerComment#452axon-agent[bot] wants to merge 2 commits intomainfrom
axon-agent[bot] wants to merge 2 commits intomainfrom
Conversation
When TriggerComment is configured and a completed task exists for a discovered work item, the spawner now compares the latest trigger comment timestamp against the task's CompletionTime. If the trigger comment is newer, the completed task is deleted and a new one is created, allowing users to re-trigger work without waiting for TTL cleanup. Changes: - Add TriggerTime field to WorkItem to carry trigger comment timestamp - Add CreatedAt to githubComment struct to parse GitHub API timestamps - Refactor fetchComments to return structured comments (with timestamps) - Add latestTriggerTime helper to find the most recent trigger comment - Update spawner dedup logic to delete and recreate completed tasks when a newer trigger comment is found - Add comprehensive tests for retrigger behavior Fixes #432 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When retrigger deletes a completed task but creation is later blocked by maxConcurrency or maxTotalTasks, the item will be picked up as new on the next poll cycle. Document this behavior in a code comment and clean up the verbose test comment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
TriggerCommentis configured and a completed (Succeeded/Failed) task exists, the spawner now compares the latest trigger comment's timestamp against the task'sCompletionTime. If the trigger comment is newer, the completed task is deleted and a new one is created.TriggerCommentis configured and a matching comment is found after task completion.Key changes
internal/source/source.go: AddedTriggerTimefield toWorkItemto carry the latest trigger comment timestamp from source to spawner.internal/source/github.go: AddedCreatedAttogithubComment, refactoredfetchCommentsto return structured comments (preserving timestamps), addedlatestTriggerTimehelper andconcatCommentBodiesutility.cmd/axon-spawner/main.go: Updated dedup logic — when a completed task exists and the trigger comment is newer thanCompletionTime, delete the old task and allow recreation. Existing concurrency and budget limits are still respected.Test plan
TestRunCycleWithSource_RetriggerCompletedTask— verifies completed task is deleted and new one created when trigger is newerTestRunCycleWithSource_RetriggerSkippedWhenTriggerBeforeCompletion— verifies no retrigger when trigger is older than completionTestRunCycleWithSource_RetriggerFailedTask— verifies retrigger works for failed tasks tooTestRunCycleWithSource_RetriggerSkippedWithoutTriggerComment— verifies no retrigger when TriggerComment not configuredTestRunCycleWithSource_RetriggerSkippedForRunningTask— verifies running tasks are never retriggeredTestRunCycleWithSource_RetriggerRespectsMaxConcurrency— verifies maxConcurrency is still enforced after retriggerTestLatestTriggerTime— unit tests for the timestamp extraction helperTestDiscoverSetsTriggerTime— integration test verifying TriggerTime is set on WorkItemTestDiscoverTriggerTimeZeroWithoutTriggerComment— verifies TriggerTime is zero when not configuredmake test,make verify)Fixes #432
🤖 Generated with Claude Code
Summary by cubic
Enable immediate re-triggering of completed tasks via TriggerComment. Satisfies axon-task-432 by recreating a task when a newer trigger comment is posted.
New Features
Refactors
Written for commit b6d383d. Summary will update on new commits.