Commit Graph
25 Commits
  • feat(ci): give the review bot a severity scale and a tally
    REVIEW.md said what blocks and what does not, but never how to mark a finding,
    so every review invented its own shape and none carried a severity. It now
    names the three markers the hosted Code Review service uses - Important, Nit,
    Pre-existing - and keys them to what the pull request did rather than to how
    alarming a defect looks alone: a defect it introduces or worsens is Important,
    one it merely brought into view is Pre-existing and cannot be a reason to hold
    it. Pre-existing was missing entirely, and checking what this panel emits means
    reading far outside the diff, so those findings had nowhere to go except a
    wrong Important or silence.
    
    The volume cap said how many and never which. It now collapses a nit repeated
    across files into one finding, prefers a nit in code the pull request wrote
    over one in code it only moved, caps pre-existing findings at three, and states
    that Important findings are never capped - a section listing two caps otherwise
    reads as licence to trim what matters. The review opens with a tally so the
    author sees the shape before the detail.
    
    Two contradictions went with it. The file told the reviewer to skip what CI
    enforces and then to check that a new i18n key reaches all 13 locales, which
    i18n-dead-keys.test.ts pins in both directions - the rule moves to "Do not
    report" with the reason. "Anything CI already enforces: npm audit" overstated
    what runs; CI audits production dependencies at high and above, so a
    dev-dependency advisory is out of scope by design.
    
    The reviewer could not read its own CI. Only postgres-durable-first runs
    against PostgreSQL, and XRAY_E2E_BINARY and XUI_SCALE_TEST are set by no job,
    so a dialect or migration change can carry a wall of green while the paths it
    touches never executed. That belongs to the verification bar, next to the rule
    that a behaviour claim needs a file:line citation, and "CI passed" now needs a
    run actually read. Also names the two house choices no linter defends: neither
    golangci-lint nor oxlint rejects a testify or Tailwind import.
    
    Both kinds of claim rot on a rename, so a test pins them the way
    repo-context.md's claims are already pinned - the CI jobs REVIEW.md names must
    exist in ci.yml, the skip gates it calls unset must stay unset, and the locale
    count must match the directory.
    
    The review itself moves from high to max effort, and the prompt records why it
    names REVIEW.md at all: the code-review skill reads CLAUDE.md on its own but
    not REVIEW.md, so dropping that clause would silently stop the file applying.
    Drops a CLAUDE.md reference to tools/seedperf/, which no longer exists - the
    review reads that file as project context, so a stale path there misleads it.
  • fix(ci): give the review bot the pull request's own code and CI verdict
    Three consecutive review runs (#6105, #6265, #6272) posted accurate findings
    but ended with the same "nothing was verified" paragraph, and the transcripts
    show why: under pull_request_target the only checkout is the base branch, so
    every Read of a changed file returned the pre-merge version and the agent
    fell back to fetching blobs one at a time through the API — 452 Bash calls on
    #6105 alone. It tried `git fetch origin pull/N/head` in all three runs and was
    denied every time.
    
    Check the head out read-only beside the base tree and say so in the prompt, so
    the reviewer greps the code actually under review. Nothing builds or executes
    from pr-head/: this job carries a write-scoped token, which is exactly the
    pwn-request REVIEW.md classes as blocking.
    
    CI had already run the full gate on each head SHA, but no run ever looked —
    `check-runs` appears in none of the three transcripts. Point the reviewer at
    it so a red or missing required check becomes a finding instead of a
    disclaimer.
    
    Also pass an explicit review level: with none given the skill reuses the last
    one typed, which in CI does not exist (ReportFindings recorded level=null on
    #6272). And allow WebFetch/WebSearch — the PIA review was denied both while
    trying to confirm the bundled PIA public key, then had to file that same check
    as unverified.
  • fix(ci): repair the review comment and the conflict-resolution guard
    Two failures from the same afternoon, both in the bot workflow.
    
    The review of #6272 ran for 34 minutes across four subagents and posted
    "No issues found. Checked for bugs and CLAUDE.md compliance." — three
    lines for a 73-file diff. The agent had written a per-area coverage
    summary in its own last turn and then dropped it on the floor, because
    the code-review skill's comment template carries findings and nothing
    else. A comment that cannot distinguish a thorough clean review from a
    run that died early is not evidence, so REVIEW.md now states what the
    posted comment must show and the system prompt points the run at it.
    
    The same run logged 67 permission denials. Only the inline-comment MCP
    tool was named in --allowedTools, so `gh api`, writing the diff to a
    scratch file, and reading it back were all auto-denied: agents spent
    turns hunting for a writable directory, and the openapi.json copy check
    REVIEW.md calls blocking could not be run at all ("gh api was
    unavailable in this sandbox"). Name the tools the review actually uses.
    
    The conflict resolution on #6243 resolved both conflicted files
    correctly and was then rejected by its own guard: "Edits outside the
    conflicted set: CLAUDE.md". The agent never touched CLAUDE.md — it had
    Edit rights on exactly two paths and no shell. claude-code-action
    deletes and restores CLAUDE.md, .claude/, .mcp.json and friends from
    the base branch before it runs, because the PR head is untrusted, and
    that restore is what dirtied the tree. Name that set once, exclude it
    from the stray-edit check, and hand back rather than resolve when a
    conflict lands inside it — the restore would silently overwrite the
    resolution and stage the base copy.
  • fix(ci): make the review bot post its findings and acknowledge mentions
    Three separate ways the bot went silent after the move to the official
    code-review skill:
    
    - The skill skips a PR it has already commented on without comparing the
      reviewed head to the current one, so #6272 got no review of the commits
      pushed after the first pass. A prior review now only justifies a skip
      when its "Reviewed head:" SHA matches the current head, and never when
      the run came from an explicit "@claude review".
    - The review agent launched its subagents in the background and ended its
      turn to wait for them. A headless run terminates on end_turn, so the
      findings were discarded and the job still reported success. The prompt
      now requires foreground subagents, and a new step fails the job when a
      run posts nothing for the current head, instead of passing green.
    - A custom prompt puts claude-code-action in agent mode, which never adds
      the eyes reaction, so a mention gave no sign it had been picked up.
  • refactor(ci): replace the in-house review lanes with the official code-review skill
    The four pull_request_target review jobs in claude-bot.yml (Senior
    Developer / QA / Tester / Arbiter and their shared rubric) are replaced by
    a single review job running the official code-review plugin - the same
    skill behind Anthropic's hosted Code Review and the review workflow
    /install-github-app generates. The hosted service needs a Team/Enterprise
    organisation, so the plugin runs in CI on the maintainer's subscription
    instead: inline findings on PR open and ready-for-review, plus manual
    (re-)review when the owner or a collaborator comments "@claude review".
    
    The official example triggers on pull_request, but GitHub withholds
    secrets from fork runs and essentially every 3x-ui pull request is from a
    fork, so the job keeps the lanes' pull_request_target posture: the
    workspace is the base revision and nothing from the pull request is
    checked out or executed.
    
    What the lanes uniquely knew is distilled into REVIEW.md, handed to the
    skill via --append-system-prompt and pinned by bot_context_test.go the way
    repo-context.md is: the runtime.Runtime dispatch rule, migration and
    upgrade safety, the four-step route contract chain including the unchecked
    docs copy, the i18n rule, the three link implementations, and the
    wire-format verification bar. The mention job now ignores "@claude
    review" comments on pull requests so the review trigger does not also
    wake the generic bot, and the lane-only rubric file goes with the lanes.
    
    The remaining prompts also lose their tone micro-rules (no emoji, no
    exclamation marks, no filler) and the workflow's comment banners are
    removed.
  • fix(ci): resync the bot prompts with the repo and close the gaps an audit found
    The three prompts still enforced the comment ban CLAUDE.md replaced with
    the 2-line cap on Aug 1 (1ff90c5b), so the review bot would flag every
    legitimate short comment; frontend/CLAUDE.md and CONTRIBUTING.md carried
    the same stale rule. The PR reviewer's recipe for reading a post-change
    file (headRefOid + pr diff) was unfulfillable with its allowlist - it now
    fetches refs/pull/N/head and reads blobs via git show, object-only, no
    checkout. Conventions the reviewer checks now include the unchecked docs
    openapi.json copy step, the docs/lib/xray third link implementation, the
    both-ways route contract, and the i18n dead-key half of the rule.
    
    Also: drop the SUBPROCESS_ENV_SCRUB=0 override on the two untrusted-input
    jobs (the mention job proves gh works scrubbed); teach the triage prompt
    the issue forms (pre-applied labels, required fields, no re-asking); add
    a security-report exception plus SECURITY.md so vulnerabilities are not
    confirmed publicly; add a clarification follow-up job so a reporter's
    reply to "clarification needed" is actually processed; review PRs again
    on ready_for_review and skip drafts; stamp the reviewed head SHA so
    force-pushes visibly date a review; scope gh issue/pr edit to label and
    title flags; per-job concurrency; comment guards now match the actual
    bot login after the run started; artifact names survive re-runs; the
    mention prompt's repo map and env-var facts corrected (XUI_PORT,
    XUI_TUNNEL_HEALTH_*, distro env files, memory.high, encrypt-tokens).
    The bug and feature forms also referenced a "needs triage" label that
    does not exist in the repo and was silently never applied - dropped.
  • fix(ci): close the TOCTOU race in the conflict-resolution bot
    The resolve-conflicts job runs on issue_comment, a privileged trigger: it
    holds GITHUB_TOKEN, the Claude OAuth token and the push PAT, and it checks
    out fork code with `gh pr checkout`. The only gate was that the commenter
    is the repository owner, which says nothing about the code that ends up in
    the workspace. A contributor could force-push to the pull request head
    between the owner asking for the merge and the runner fetching it, so the
    owner reviews one tree and the job runs another.
    
    Verify before anything is checked out that the head repository was last
    pushed to before the triggering comment was written, and refuse the run
    otherwise. Pin the head SHA reported by that check and abort if the commit
    `gh pr checkout` lands on differs, which closes the remaining window
    between the check and the fetch. Require author_association to be OWNER
    alongside the existing login comparison.
    
    This also clears CodeQL actions/untrusted-checkout/high, which for
    issue_comment triggers demands both an actor/association check and a
    comment-vs-head-date check dominating the checkout.
  • fix(ci): harden the conflict resolver against the branch it checks out
    resolve-conflicts is the one job that puts a pull request's own tree in
    the working directory while holding CLAUDE_CODE_OAUTH_TOKEN,
    CLAUDE_BOT_PAT and a write-scoped token, which is what CodeQL alert 101
    (actions/untrusted-checkout) points at. Nothing in the job executes that
    tree and the trigger is gated on the repository owner, so the alert is
    not reachable as written, but two of its guards were weaker than they
    read.
    
    Git hooks were neutered only after gh pr checkout had already run, so
    the guard sat one step behind the checkout it exists to cover; it now
    precedes it. The conflicted paths are concatenated into the
    --allowedTools value handed to the model, so a path carrying a comma or
    a parenthesis would widen that allowlist. Only both-modified paths reach
    that code today, which means they already exist in the base repository,
    but the merge is now handed back to the maintainer unless every
    conflicted path is plain [A-Za-z0-9._/-].
    
    The file's header comment block is dropped.
  • fix(ci): stop the conflict job trusting the branch it is merging
    A second audit of the hardened workflow found the "no shell at all"
    claim in resolve-conflicts was still false, by two routes that live
    outside this file.
    
    The job runs the model in the workspace right after `gh pr checkout`,
    so for a fork pull request the working directory is attacker-controlled.
    claude-code-action writes `enableAllProjectMcpServers = true` into
    ~/.claude/settings.json before starting Claude Code
    (base-action/src/setup-claude-code-settings.ts), and the CLI honours a
    project `.mcp.json` unless `strictMcpConfig` is set, which the action
    never sets. A contributor branch carrying an `.mcp.json` therefore got
    its command spawned at session start, with --allowedTools gating tool
    calls but not server startup. The same tree also supplied CLAUDE.md and
    .claude/ as project instructions. The job now passes
    `--strict-mcp-config` and `--setting-sources user`, so nothing in the
    merged tree configures the session.
    
    The second route was `Edit` with no path scope, the only unscoped file
    grant left. Editing `.git/config` to set `core.fsmonitor` or a
    `credential.helper` gets a command run by the next step's git calls,
    which hold CLAUDE_BOT_PAT, and the stray-file guard could never see it
    because `git diff --name-only` lists tracked paths only. The merge step
    now emits one `Edit(//<workspace>/<file>)` rule per conflicted path and
    the model gets exactly those plus /tmp, with `.git/**` denied outright
    and Bash, WebFetch, WebSearch and Task denied by name. Hooks are
    disabled for the run (`core.hooksPath=/dev/null`, `commit --no-verify`).
    
    Conflict handling gets three real gaps closed: modify/delete, rename and
    both-added conflicts (git status DD/AU/UD/DU/AA/UA) leave no markers, so
    they used to sail through the marker check and get committed unresolved
    - they are now detected up front and handed back untouched; the marker
    scan covers `=======` and `|||||||`, not just the outer pair; and after
    staging, `git diff --diff-filter=U` must come back empty or nothing is
    committed. A `=======` markdown underline of exactly seven characters in
    a conflicted file will now hand the merge back rather than commit it,
    which is the safe direction.
    
    Smaller things the audit was right about:
    - the mutating gh rules are prefix rules, so `Bash(gh issue close:*)`
      reached every issue in the repository. They now carry the triggering
      number: `Bash(gh issue close ${{ github.event.issue.number }}:*)`.
    - `Write(//tmp/**)` is granted alongside `Edit(//tmp/**)`: the docs say a
      Write(path) rule is never matched by the file checks, so the Edit rule
      is what authorises it, but the tool has to be listed to exist at all.
      Without this the model could not create /tmp/comment.md.
    - the mention prompt lost its thread context when it moved to agent mode
      and referred to "<number>" literally; it now gets repo, number, title
      and whether the thread is a pull request.
    - `git log`/`git show` are gone from mention: `--output=<file>` makes
      them a file-write primitive.
    - `@claude resolve pr conflicts` on a plain issue matched no job at all.
    - the commit step gated on `skip != 'true'`, so it also ran when the
      merge step died before writing any output; it now needs `skip ==
      'false'`.
    - bot-authored pull requests (dependabot opens three ecosystems' worth)
      no longer start a review run that the action refuses to serve.
    - resolve-conflicts drops to `contents: read`, since the push is the
      PAT's job, and fails with a comment when that PAT is missing.
  • fix(ci): close the write paths an audit found still open in the bot
    Making the jobs read-only in the previous commit was not enough: two of
    the mechanisms that grant write access were invisible in the workflow
    file itself.
    
    Every job now passes a `prompt:` input. Without one, claude-code-action
    picks tag mode for a mention, and src/modes/tag/index.ts then appends
    `--permission-mode acceptEdits`, its own allowedTools including
    `Bash(git commit:*)` and a push wrapper, and calls setupBranch. So the
    mention job could edit files and commit them no matter what its own
    allowedTools said, and its system prompt claiming otherwise was simply
    wrong. A `prompt:` selects agent mode, which adds nothing. It also
    removes tag mode's hidden requirement that the comment contain the
    trigger phrase, which would have made resolve-conflicts a no-op for a
    comment that said only "resolve pr conflicts".
    
    resolve-conflicts no longer hands git to the model. `Bash(git:*)` is a
    prefix rule, so it permitted `git push origin HEAD:main`, `--force`,
    `git remote set-url`, and shell execution through `git config alias.x
    '!sh -c ...'` - the action ships scripts/git-push.sh precisely because
    `git push:*` allows `--receive-pack='sh -c ...'`. The job now splits in
    three: a step checks out the PR branch, merges the base and collects the
    conflicted paths; the model gets Read/Glob/Grep/Edit and no shell at all;
    a final step verifies and pushes. That step refuses to commit if a
    conflict marker survives, if the model wrote /tmp/ABORT, or if anything
    outside the conflicted set was touched, and it stages those paths
    individually instead of `git add -A`. The PAT is now written to the push
    URL only in that last step, after the model's session has ended, instead
    of sitting in .git/config while untrusted branch content is read.
    
    The bare `Write` grant in the three answering jobs becomes
    `Edit(//tmp/**)`, since only prose kept it out of the checkout and out of
    $GITHUB_ACTION_PATH, whose scripts run after the model step. Each prompt
    now says to fall back to an inline --body if the write is refused, so a
    denied write cannot silently cost a reply. mention gains the transcript
    upload and the no-reply guard the other jobs already have, keyed to the
    triggering comment's timestamp.
    
    Restores the header note about the 21000-character expression cap, with
    the current block sizes.
  • refactor(ci): make the bot read-only except for PR conflict resolution
    The bot is meant to investigate and explain, not to write code. It could
    do considerably more than that: handle-pr-fix applied fixes and pushed
    them to any trusted author's PR, an @claude mention on a pull request
    could edit files, and an @claude mention on an issue opened a pull
    request against main. All of it is gone.
    
    Now every job that answers automatically runs with a contents: read
    token, so pushing is impossible rather than merely forbidden:
    
    - handle-pr-fix is deleted. handle-pr-review takes every pull request
      instead of only the ones from outside contributors, and it comments.
    - mention drops contents: write, the push-URL routing step, and the
      Edit tool. Its Bash allowlist is now an explicit read-only set - the
      gh subcommands it needs plus git log/show/diff/blame - so gh api,
      gh pr merge and gh pr create are no longer reachable. Asked for a
      fix, it now writes the change out in full instead of applying it.
    
    One narrow exception replaces all of that: resolve-conflicts. It runs
    only when the repository owner comments "resolve pr conflicts" on a
    pull request, and it may merge the base branch into that PR's head
    branch and resolve the conflicts, nothing else. It keeps both sides of
    every conflict, takes the base version of generated artifacts it cannot
    regenerate here, and aborts the merge rather than guess when a hunk
    needs a human. It never force-pushes, merges, or closes.
    
    Also removes the pull-request-opening step whose guard never worked:
    gh api prints the 404 body on stdout, so `ahead=$(gh api ... || echo 0)`
    became `{"message":"Not Found",...}0`, never equal to "0", and every
    reply-only mention run ended red on `gh pr create`. Uploads the
    handle-pr-review transcript the way handle-issue already does, so a run
    that dies inside the sandbox leaves evidence.
  • fix(ci): unbreak the issue-triage bot, which answered nothing
    Since 2026-07-20 every `issues` run reported success while posting no
    comment at all - #6094 through #6103 carry zero replies. The cause is
    the sandbox, not the prompt or the model.
    
    `handle-issue` and `handle-pr-review` pass allowed_non_write_users,
    which is what lets the bot run for reporters who have no write access.
    claude-code-action reacts to that input by turning subprocess isolation
    on and installing bubblewrap, and that sandbox cannot start on the
    runner: every Bash call dies during setup, before the command itself
    runs, with
    
        bwrap: Can't create file at /home/.mcp.json: Permission denied
    
    `gh` is reachable only through Bash, so the triage investigated the
    issue, wrote its reply to /tmp/comment.md, and could never post it.
    The action itself did not crash, so the job stayed green.
    
    Opt both jobs out with CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0. The scrub is
    a best-effort wipe of secrets from subprocess environments, not an
    access control; what actually bounds these jobs is unchanged - a
    contents: read token that cannot push, and a Bash allowlist holding
    only specific `gh issue`, `gh label`, `gh search` and `gh release`
    subcommands. Code changes stay confined to handle-pr-fix and mention,
    which only trusted actors and the owner can trigger.
    
    Add a step to each job that fails the run when no bot comment landed on
    the issue or pull request, so the next silent breakage shows up red
    instead of green, and lower retention-days to the repository maximum of
    7 so the artifact upload stops warning.
  • fix(ci): keep the triage prompt under the 21000-char expression cap
    The previous commit pushed handle-issue's prompt to 21587 characters and
    GitHub stopped parsing the file: "(Line: 39, Col: 19): Exceeded max
    expression length 21000". Because the prompt interpolates ${{ }}, GitHub
    treats the whole block scalar as a single expression, and the cap applies
    per expression. The failure mode is quiet and total - no job fails,
    the workflow itself disappears, its registered name reverts from "Claude
    Bot" to the file path, and the only signal is a run attributed to the
    push with no jobs in it.
    
    Drop the hand-written stack description, repository map and runtime-fact
    list from that prompt and point at CLAUDE.md and docs/architecture.md
    instead. Both are maintained, both are already in the checkout, and the
    copy in the prompt had drifted from them anyway - it still described the
    mtg worker, omitted internal/tunnelmonitor/ and memory.high, and filed
    internal/web/runtime/ under "wiring". Only the support-facing facts that
    live in neither file are kept: the install one-liner, the random initial
    credentials, the distro-dependent env file, the Docker image and the
    capabilities fail2ban needs.
    
    handle-issue is now 15069 characters, and a header comment records the
    limit so the next edit does not rediscover it in production.
  • fix(ci): repair the Claude bot and narrow what it can reach
    Three problems, all in .github/workflows/claude-bot.yml.
    
    It was silently dead. No comment had been posted since 2026-07-20 while
    every run reported success: roughly twenty issues and pull requests each
    burned 18-56 turns and up to $2.59, ended with permission denials, and
    published nothing. Comment bodies are markdown, markdown is full of
    backticks, and inside a quoted `--body "..."` backticks are command
    substitution, so the write was rejected and a failed triage looked
    exactly like a clean one. The body now goes to /tmp through Write and out
    through --body-file, in every branch of both jobs, and each job re-reads
    the thread afterwards so a rejected write fails loudly instead of
    reporting success. The run transcript is kept as an artifact.
    
    It could reach much further than it claimed. Both jobs that any GitHub
    user can trigger declared themselves READ-ONLY in prose while holding
    Bash(gh:*), which is not a GitHub-scoped allowlist: `gh alias set --shell`
    runs its argument through sh -c and `gh extension install` fetches and
    executes code, both as single commands whose first token is gh. That is a
    general shell on a runner holding CLAUDE_CODE_OAUTH_TOKEN, which does not
    expire with the job. `gh api` accepted any method, issues: write is
    repo-scoped rather than issue-scoped, and `gh pr review --approve`,
    `gh pr close` and `gh pr checkout` were forbidden in prose only. Those two
    jobs now list the subcommands they actually run. The untrusted title and
    body are fenced in tags carrying github.run_id, unguessable at the time
    the issue is written, and the invariants an allowlist cannot express -
    one issue number, labels and title only, /tmp as the sole writable path,
    never $GITHUB_ENV - are stated explicitly. Both checkouts get
    persist-credentials: false. handle-pr-fix and mention keep their
    wildcards: only owners, members and collaborators can trigger them, and
    narrowing the maintainer's own path risks more than it protects.
    
    Its review hid findings and its triage quoted stale facts. "Prefer a few
    high-signal findings over many low-value ones" is read literally by
    Opus - it finds the bug, judges it below the stated bar and says
    nothing - while the Severity and Confidence tiers already existed to do
    that filtering. The review also never said that the working directory is
    the base revision, so it could assert that a case was unhandled in code
    the pull request had already rewritten, and label it confirmed, on an
    outside contributor's first patch. Four CLAUDE.md conventions were
    missing, each a guaranteed miss: openapigen's StructAllow allowlist, the
    layering rules including the runtime.Runtime dispatch requirement that
    silently breaks multi-node when bypassed, the assertion standard, and
    golden share-link fixtures regenerated to turn a red test green. On the
    triage side the invalid and duplicate branches were gated three times
    over and so never fired, leaving spam to collect a full investigation and
    a courteous reply; /etc/default/x-ui was given as the env file when it is
    distro-dependent, making the PostgreSQL migration advice a silent no-op
    on RHEL and Arch; an env list labelled "full" omitted XUI_PORT and the
    XUI_TUNNEL_HEALTH_* family; XTLS was offered as a security option the
    panel does not have. docs/architecture.md was invisible to both prompts
    despite being maintained and already in the checkout. From the bot's own
    output: it published a trigger only the maintainer can use, retitled
    issues without saying so, asked for screenshots it cannot open, and once
    invented a reason for a number it had miscounted.
    
    All four jobs move to Opus 5, at xhigh effort rather than max - the
    recommended tier for agentic work, and one below the overthinking that
    max invites on routine triage.
  • ci(claude-bot): structure PR review and issue triage prompts
    Rework the handle-pr-review, handle-pr-fix, and handle-issue prompts to produce professional, structured output. The review job now rates findings by severity and confidence across explicit review areas and reports a Summary, Findings, and a text-only verdict in one plain comment; the fix job reuses the same lens to prioritize what it applies versus leaves for the author; issue triage gains a structured bug-confirmation format and explicit outcomes for mislabeled and not-a-bug reports, closing conservatively. Severity uses text labels to respect the no-emoji house style, and the adapted ignore-list keeps i18n and generated files flaggable.
  • ci(claude-bot): auto-open the PR after an owner @claude fix on an issue
    claude-code-action only pushes a branch and posts a Create PR link by design; it never opens the PR itself. Add a post-step to the mention job that opens a PR from the action's branch_name output when the trigger was an issue (guarded against no-op branches and against an existing PR).
    
    Simplify the mention prompt so the agent just makes edits with Edit/Write and lets the workflow commit and open the PR, instead of running git/gh pr create itself (which fought the action's built-in flow and left only a link).
  • ci(claude-bot): gate write capability to trusted actors
    Make every automatic, untrusted trigger read-only and require an explicit trusted actor for any code change.
    
    - handle-issue (issue opened): read-only triage; confirm bugs and tag the maintainer, never edit code or open a PR. Authenticates as GITHUB_TOKEN so replies post as github-actions[bot], not a personal account.
    
    - handle-pr-fix (PR opened): applies fixes only for owner/member/collaborator authors; dropped allowed_non_write_users so the default write gate also applies.
    
    - handle-pr-review (PR opened, external authors): read-only review comment only.
    
    - mention (@claude comment): runs only for the repository owner; may open a PR from an issue or commit to a PR on explicit request.
    
    No job authenticates as the static PAT anymore; the PAT is used only to route git pushes for the trusted PR-fix and owner-mention paths.
  • ci(claude-bot): auto-fix trusted PRs and easy issue bugs
    Split the review-only handle-pr job into handle-pr-fix (owner/member/collaborator PRs: apply refactors and bug fixes directly, commit to the PR branch, no suggestion blocks) and handle-pr-review (external/fork PRs: one review-only comment, no suggestions, no code checkout).
    
    Upgrade handle-issue to open a fix PR for easy bugs (pushed via CLAUDE_BOT_PAT so pull_request CI runs on it), confirm the root cause and tag the maintainer for big bugs, and never open a PR for feature or enhancement requests.
  • chore(ci): upgrade claude-bot to Sonnet 5 and set explicit effort levels
    Sonnet 5 reaches near-Opus quality on coding/agentic work at lower cost;
    pin effort explicitly (xhigh/max) instead of relying on model defaults.
  • ci(claude-bot): tune models, Copilot-style PR review, issue research mode
    - handle-issue: use Sonnet 4.6 and raise max-turns 150 to 250
    
    - handle-pr: use Opus 4.8; rewrite review as inline comments stating the problem plus a suggestion block, posted as one COMMENT review
    
    - mention: use Opus 4.8; on issues do research only (never commit) with full comment/history context and feature-request feasibility analysis; PR commit-on-request behavior unchanged
    
    - reformat the mention append-system-prompt into a readable multi-line block (verified it still parses as a single CLI argument)
  • feat(ci): let mention bot push commits to fork PR branches
    claude-code-action checks out the PR head branch and pushes Claude's
    commits with `git push origin ...`. For PRs opened from a fork the head
    branch lives on the contributor's repo, and the workflow GITHUB_TOKEN
    cannot push there, so commits ended up as a stray branch on this repo
    and never landed on the PR.
    
    Redirect origin's push URL to the PR head repository (the fork for fork
    PRs, this repo otherwise) using a PAT secret (CLAUDE_BOT_PAT) that has
    push access; fetches still come from origin. persist-credentials is
    disabled so the PAT in the push URL is used instead of the GITHUB_TOKEN
    auth header. Requires the fork PR to have "Allow edits by maintainers"
    enabled.
  • feat(ci): add PR review job and commit-capable mention bot
    Rename claude-issue-bot.yml to claude-bot.yml and broaden it beyond
    issues:
    
    - handle-pr: review pull requests on open (read diff, label, post one
      grounded review comment); review-only, no code changes.
    - mention: allow committing. Add Edit/Write and git tools, contents:
      write, and instruct it to make the smallest correct change and commit
      to the current branch only on an explicit code-change request. Kept
      default user gating (no allowed_non_write_users) so only write-access
      users can trigger commits.
    - Refresh the repository map (add internal/eventbus and the
      service/email subpackage) across all three prompts.
    - Raise max-turns.
    @