feat(ci): pin Claude workflows to Opus 4.7 1M, allow test-skip on doc fixes#208
Merged
Conversation
3 tasks
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.
What this does
Two improvements to the three Claude integration workflows.
1. Pin to Opus 4.7 with 1M-context, model controlled by a repo variable
All three workflows (
claude-pr-review.yml,claude-implement-fixes.yml,extract-claude-lessons.yml) now pass--modelviaclaude_args, evaluating to:--model ${{ vars.CLAUDE_MODEL || 'claude-opus-4-7[1m]' }}claude-opus-4-7[1m]— Opus 4.7 with the 1M-context variant. Largest context, top-tier reasoning.CLAUDE_MODEL(Settings → Secrets and variables → Actions → Variables) to any model alias the action accepts. Bumping models = changing one variable, no PR. Useful when Anthropic ships a newer Opus.claude-opus-4-7(no date suffix) auto-tracks the latest snapshot of Opus 4.7. Cross-major-version bumps (4.7 → 4.8 → 5.x) still need an explicit update — but that's a once-a-quarter-ish thing, not a per-PR concern.Previously only
claude-pr-reviewhad--modelset; the other two ran on whatever the action's default was.2. Test-skip discretion in
claude-implement-fixesStep 4 of the implement-fixes prompt was rigid: "Run the test command from CLAUDE.md before pushing." The CPU suite alone takes ~9 min and is wasted on doc-only / comment-only / formatting fixes, blowing each
@claude fixcycle out to 15-20 min.New step 4 gives Claude discretion + an audit trail:
tests: skipped — <one-sentence reason>.tests: passed — <exact command run>. Scope to the changed subtree where possible (pytest tests/policies/test_pi05.pyfor a pi05 change) to keep the run fast.The audit-trail line in the commit body lets reviewers second-guess if Claude underestimated risk.
How it was tested
actionlintclean on all three files (exit 0).pre-commit(typos, gitleaks, zizmor, end-of-file-fixer, trailing-whitespace) all pass.[1m]model-ID syntax has not been verified against the action's--modelparser yet. If the CLI rejects it, fall back toclaude-opus-4-7(no[1m]) by setting theCLAUDE_MODELrepo variable to that — no code change needed.@claude fixon a doc-only change and confirming the commit body containstests: skippedand total runtime drops below ~3 minutes.Note for the reviewer: This PR's own
Claude PR Reviewcheck will fail withApp token exchange failed: 401 Unauthorized — Workflow validation failed.This is expected: the action enforces a security check that rejects any PR which modifies the workflow file calling it. All other CI passes normally.How to checkout & try? (for the reviewer)
```bash
gh pr checkout
git diff origin/main -- .github/workflows/claude-.yml
actionlint .github/workflows/claude-.yml
```
After merge:
CLAUDE_MODELto override the default.@claude fixcomment on any future doc-only PR; expect the run to finish in ~2-3 min withtests: skipped — ...in the commit body.Checklist