Skip to content

perf(autotuner): replace power-of-2 token buckets with hybrid spacing & fix missing routing_replay_out arg #13706

perf(autotuner): replace power-of-2 token buckets with hybrid spacing & fix missing routing_replay_out arg

perf(autotuner): replace power-of-2 token buckets with hybrid spacing & fix missing routing_replay_out arg #13706

Workflow file for this run

name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Check team membership
id: check-permission
env:
# GITHUB_TOKEN cannot access org team membership API (HTTP 403)
# Use a PAT with read:org scope stored as FLASHINFER_GITHUB_TOKEN secret
GH_TOKEN: ${{ secrets.FLASHINFER_GITHUB_TOKEN }}
ORG: ${{ github.repository_owner }}
TEAM: agent-users
shell: bash
run: |
# Get the username based on the event type
if [[ "${{ github.event_name }}" == "issue_comment" ]] || [[ "${{ github.event_name }}" == "pull_request_review_comment" ]]; then
ACTOR="${{ github.event.comment.user.login }}"
elif [[ "${{ github.event_name }}" == "pull_request_review" ]]; then
ACTOR="${{ github.event.review.user.login }}"
elif [[ "${{ github.event_name }}" == "issues" ]]; then
ACTOR="${{ github.event.issue.user.login }}"
else
ACTOR="${{ github.actor }}"
fi
echo "Checking if $ACTOR is a member of $ORG/$TEAM team..."
# Verify token is set
if [[ -z "$GH_TOKEN" ]]; then
echo "❌ Error: FLASHINFER_GITHUB_TOKEN secret is not set"
echo "authorized=false" >> "$GITHUB_OUTPUT"
exit 0
fi
# List team members and check if PR author is in the list
MEMBERS=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
--paginate \
"/orgs/${ORG}/teams/${TEAM}/members" \
--jq '.[].login' 2>&1) || {
echo "❌ Error calling GitHub API: $MEMBERS"
echo "authorized=false" >> "$GITHUB_OUTPUT"
exit 0
}
if echo "$MEMBERS" | grep -qx "$ACTOR"; then
echo "✅ $ACTOR is a member of $TEAM"
echo "authorized=true" >> "$GITHUB_OUTPUT"
else
echo "❌ $ACTOR is not a member of $TEAM"
echo "authorized=false" >> "$GITHUB_OUTPUT"
fi
- name: Checkout repository
if: steps.check-permission.outputs.authorized == 'true'
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Python
if: steps.check-permission.outputs.authorized == 'true'
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pre-commit
if: steps.check-permission.outputs.authorized == 'true'
run: |
pip install pre-commit
pre-commit install
- name: Run Claude Code
if: steps.check-permission.outputs.authorized == 'true'
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
claude_args: |
--system-prompt "IMPORTANT: Before making any git commit, ALWAYS run `pre-commit run --all-files` first to auto-fix formatting issues. If pre-commit modifies files, stage them before committing. If pre-commit reports errors that cannot be auto-fixed, analyze the errors, fix them manually, then re-run pre-commit and commit again."