Add axon-pr-reviewer TaskSpawner to replace cubic-dev-ai#409
Closed
axon-agent[bot] wants to merge 9 commits intomainfrom
Closed
Add axon-pr-reviewer TaskSpawner to replace cubic-dev-ai#409axon-agent[bot] wants to merge 9 commits intomainfrom
axon-agent[bot] wants to merge 9 commits intomainfrom
Conversation
gjkim42
requested changes
Feb 22, 2026
Collaborator
gjkim42
left a comment
There was a problem hiding this comment.
I'd like to review the latest diff every time the pr is updated.
Collaborator
|
/reset-worker |
774db87 to
b52cfaf
Compare
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="self-development/axon-pr-reviewer.yaml">
<violation number="1" location="self-development/axon-pr-reviewer.yaml:52">
P2: Guard the `capture` call so comments without a "Reviewed commit" line don’t make the jq command fail and force re-reviews.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
5 tasks
gjkim42
requested changes
Feb 23, 2026
| name: axon-agent | ||
| model: opus | ||
| type: claude-code | ||
| ttlSecondsAfterFinished: 0 |
Collaborator
There was a problem hiding this comment.
so... this will constantly spawn tasks for the same PR even if it doesn't actually code review it.
it will consume tokens continuously.
What would be the better solution?
Introduce a new TaskSpawner that watches for pull requests labeled ok-to-test and performs automated code reviews, replacing the external cubic-dev-ai GitHub App. The reviewer reads the full PR diff, checks it against project conventions, evaluates correctness, test coverage, style, security, and simplicity, then posts a structured review comment on the PR. Closes #408 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove excludeLabels and axon/needs-input labeling so the PR reviewer re-triggers after Task TTL expires. Add a new-commits check so the agent skips posting if nothing changed since the last review. Closes #408 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Set ttlSecondsAfterFinished to 0 so the review task is deleted immediately after finishing. This lets the spawner rediscover the PR on the next poll cycle and re-review within ~1 minute of new commits being pushed, instead of waiting up to 1 hour for the old TTL to expire. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace date-based comparison with SHA comparison when deciding whether to skip a review. The reviewer now compares the PR head SHA against the commit_id from the last axon review, which is more reliable across rebases and force pushes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace broken {owner}/{repo} placeholders with dynamic repo
detection via `gh repo view` and `gh pr view`
- Add null check for LAST_REVIEWED_SHA so the first review always runs
- Match review comments by "Axon PR Reviewer" instead of "Axon Agent"
to align with the actual review comment format
- Include reviewed commit SHA in review output for reliable comparison
- Add diagnostic logging for review decisions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch review posting from `gh pr review --comment` to `gh pr comment` so that the skip-review check can reliably find prior reviews via `gh pr view --json comments`. The previous approach used the reviews API which required fragile jq filters on user login and body content. The new approach parses the reviewed commit SHA directly from comment bodies, making skip detection consistent with the posting mechanism. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the jq try operator (?) to the capture() call so that comments matching "Axon PR Reviewer" but lacking a "Reviewed commit" line silently produce no output instead of erroring and forcing unnecessary re-reviews. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the PR has been reviewed before, the reviewer now fetches the incremental diff (LAST_REVIEWED...HEAD_SHA) in addition to the full PR diff. Follow-up review comments use a distinct format that shows the "Changes since" SHA and focuses feedback on the new commits while noting whether prior feedback has been addressed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address review feedback: ttlSecondsAfterFinished: 0 caused the spawner to continuously create new review tasks every poll cycle (1 minute), wasting tokens even when the PR had not changed. Switch to TTL 3600s (matching axon-workers) so the Task persists after completion and prevents re-spawning. Re-reviews can be triggered via /reset-worker. Remove the skip-if-already-reviewed logic from the prompt since the spawner's own deduplication (by task name) now handles this. The agent still detects previous reviews for incremental diff purposes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
405e1c3 to
85ceeff
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.
Summary
axon-pr-reviewerTaskSpawner that watches for open PRs labeledok-to-testand performs automated code reviewsDetails
The cubic-dev-ai app provides automated code reviews, PR description summaries, and codebase memory. This PR replaces that functionality with a native axon TaskSpawner that:
githubIssues.types: ["pulls"]withlabels: ["ok-to-test"]to watch for PRs ready for reviewThe reviewer is read-only — it does not push code or modify files.
Closes #408
Test plan
ok-to-test🤖 Generated with Claude Code