Repository navigation
feat(lanes): record limit resets and turn headroom; gate intake by author - #755
Conversation
…thor report-lane-outcome now puts a run record on its annotation line: resets=<ISO> on class rate-limit (from the newest rejected rate_limit_event), credential=<secret name> and max-turns=<n> from new optional inputs, turns=<num_turns> and models=<modelUsage keys> from the result message. A completed run gets a notice carrying the same record. The class= behavior is unchanged; a resets-at output is added. intake-triage starts a run only for OWNER or MEMBER authors, or a bot whose sender id is in the new allowed-bot-sender-ids input (the review lanes' rule). The default --max-turns rises from 15 to 30: the last 50 claude-code-plugins runs used a median of 11 turns and at most 18, and all 7 failures among them finished past the cap of 15. The Actions-expression test evaluator moves to a shared module used by both job-gate tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude-code-action fails a run whose result reports more turns than
--max-turns ("Claude reported a successful result after N turns,
exceeding the configured maximum of M"), but the result message reads as
a success, so classify fell through to `other`. With the caller's
max-turns input known, num_turns above it is now `max-turns`, beside the
existing error_max_turns subtype. Timeout and API status still decide
first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ened Security review follow-ups: - resets= now comes only from the newest rejected rate_limit_event, with resets-window=<rateLimitType> beside it. A 429 with no rejected event carries no reset, so the caller's fallback delay applies instead of an allowed or warning event's earlier reset from another window. - intake-triage starts a run only on the opened action, and a listed bot only when it is the issue's author (issue.user.id == sender.id), in the job gate and in allowed_bots. A caller triggering on edited, labeled, reopened or transferred can no longer let a listed bot start a run on someone else's issue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 5m 36s —— View job Code review complete
Scoped to the files changed in this PR, against Finding (posted inline)
The Otherwise
Not verified: I could not execute |
|
Claude finished @kyle-sexton's task in 3m 4s —— View job Security review — PR #755
No security issues found. This is a security-hardening PR, and it holds up under adversarial reading:
No CRITICAL, IMPORTANT, or SUGGESTION findings to report. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a794ce65f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-security-review has reviewed this pull request through 1231f3c; a later push is reviewed from there. |
|
claude-review has reviewed this pull request through 1231f3c; a later push is reviewed from there. |
…cess results
The intake compose step now accepts a quoted --max-turns value ("30" or
'30'), which the action's shell-quote tokenizer passes through as the cap.
The num_turns-over-cap disjunct in classify.cjs now applies only to a
success-subtype result, so an error-subtype result that overshoots the cap
keeps the class its errors[] carry (an auth failure stays auth).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
|
Claude finished @kyle-sexton's task in 1m 22s —— View job Security review — PR #755 (incremental)
Scoped to what changed since this lane's last review of
No security issues found. Both changes are fixes for findings this lane and Codex's review raised on
Not re-reported (already raised, now addressed): Codex's P2 note that the quote-handling regex still doesn't use the pinned action's |
|
Claude finished @kyle-sexton's task in 2m 15s —— View job Code review complete
Scoped to the incremental diff ( No new findings. This increment closes out both outstanding issues from the prior review round:
Checked for regressions: the existing success-subtype max-turns test, the unquoted-cap test cases, and the three prior sabotage checks (reset-event preference, Not verified: could not run |
Closes #772 ## Summary Since #755 the intake lane admitted a human author only when `github.event.issue.author_association` was `OWNER` or `MEMBER`. A webhook payload computes that with no viewer, so the org owner, whose membership is private, reads `CONTRIBUTOR` (an anonymous `GET /repos/melodic-software/claude-code-plugins/issues/7871` returns `"author_association": "CONTRIBUTOR"`; an authenticated one returns `MEMBER`). Every claude-code-plugins intake run since 2026-10-17 22:27 UTC went green with the triage job skipped. ## Fix - New input `allowed-author-ids`: comma-separated numeric user ids, same malformed-list guards as `allowed-bot-sender-ids`. A person is admitted when the sender opened the issue, is its author, and their id is listed. Ids, not logins, since a login can be renamed and re-registered. - The `OWNER`/`MEMBER` path is dropped, not kept beside the list. It is the field that failed here, it depends on each member's visibility setting, and claude-code-plugins is the only caller (`gh search code` over the org), so one admit rule is simpler and nothing else loses runs. A caller that passes no ids gets no human runs (fails closed). - New job `claude-intake-triage-skipped` (`needs: claude`, runs when that job was skipped on an opened issue, which only its author gate can cause): posts a notice and a run-summary line naming the reason (sender is not the author, list empty or malformed, or author id not listed), and applies the new optional `skipped-label` when it exists in the repository. Its only grant is `issues: write`, within the caller's existing grant. Breaking for a caller that relied on `OWNER`/`MEMBER`: it must pass `allowed-author-ids`. Release as a minor on the v0.x line. ## Verification - `node --test .github/scripts/*.test.cjs`: 434 pass, 0 fail. `intake-triage-gate.test.cjs` now covers a listed author whose payload reads `CONTRIBUTOR` (admitted), unlisted `OWNER`/`MEMBER` (skipped), id-prefix matches, malformed lists, a listed person acting on someone else's issue, a person's id in the bot list, and the skipped job's wiring. - `actionlint .github/workflows/intake-triage.yml`: clean. `zizmor --offline`: no findings. - Left out: a live run. The skipped job's label write and summary have not run on GitHub; the caller repin will exercise both, and the post-merge live check is tracked as an issue in claude-code-plugins. ## Related - #755 introduced the gate. - A follow-up PR adds `workflow_dispatch` intake for issues created by a `GITHUB_TOKEN` (which start no `issues` run). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_019bQ8pL7fJgVy7YjQ7wK1Zw --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
No related issue: ci-workflows half of the owner-approved lane credentials design (components C1 and C7), tracked in a design document rather than an issue.
Summary
report-lane-outcomewrites a run record on the same annotation line asclass=:resets=<ISO>onclass=rate-limit,credential=<secret name>,turns=<n>,max-turns=<n>,models=<modelUsage keys>. A completed run gets a notice carrying the same record, so turn headroom and models show on every lane run.intake-triagestarts a run only for issues authored by anOWNERorMEMBER, or by a bot whose sender id is listed in a newallowed-bot-sender-idsinput.--max-turnsrises from 15 to 30.Fix
Run record (
classify.cjs,action.yml).resets=andresets-window=<rateLimitType>come only from the newestrate_limit_eventwhoserate_limit_info.statusisrejected. With no rejected event there is noresets=, so the consumer's fallback delay applies; an allowed or warning event's reset belongs to another window and would restart too early. Epoch seconds and epoch milliseconds are both accepted. Both are printed only onclass=rate-limit; the time is also exposed as a newresets-atoutput.class=max-turnsnow also covers a run that finished past its cap. claude-code-action fails such a run with "Claude reported a successful result after N turns, exceeding the configured maximum of M", but its result message reads as a success (subtype: success,is_error: false), so it used to classify asother. When themax-turnsinput is known andnum_turnsexceeds it, the class ismax-turns, beside the existingerror_max_turnssubtype;turns=andmax-turns=sit on the same line. A timeout or an API status still decides first. The status step names it as a red failure, never a limit.turns=andmodels=come from the result message'snum_turnsandmodelUsagekeys.credential=andmax-turns=come from new optional inputs.class=tokens, their order and their messages are unchanged. The tokens are inserted right afterclass=<token>.Intake author gate (
intake-triage.yml).openedaction starts a run. Edited, labeled, reopened or transferred events never do, whatever the caller triggers on.if:admits a non-bot actor only whenissue.author_associationisOWNERorMEMBER.allowed-bot-sender-idsand it is the issue's author (issue.user.id == sender.id); only that bot's login reachesallowed_bots. The id-list expression is the one the review lanes use.issuesevent still reaches the reject step.CONTRIBUTORorNONEin the webhook payload and be skipped. That fails closed (no run, the issue waits for a person); it is unverified.Intake max-turns.
--max-turnschanges from 15 to 30.--max-turns) and passes it, withcredential: CLAUDE_CODE_OAUTH_TOKEN, to the outcome step.Basis: turns used by the last 50
intake-triageruns in claude-code-plugins (2026-10-16T14:28Z to 2026-10-17T13:53Z), read from each run log's"num_turns"line viagh run view --log:Shared test evaluator. The Actions-expression evaluator in
claude-lane-job-gates.test.cjsmoved unchanged into.github/scripts/actions-expression.cjs. That test and the new intake gate test both use it.Verification
node --test .github/actions/report-lane-outcome/*.test.cjs .github/scripts/*.test.cjs: 417 tests, 0 failures.actionlintover the repo: clean. Biome 2.5.11 with the CI config: clean.SDKRateLimitEventand the result message. The fixture timestamp 1767225600 is 2026-01-01T00:00:00Z.author_associationvalue, listed and unlisted bot ids, malformed lists, a missing sender, and a non-issues event.resets=print on any class, and dropping the preference forrejectedevents, failed 3 tests.MEMBERclause from the gate failed the gate test.max-turnsrule failed 2 tests (the classifier case and the outcome line from run 39038437240's shape).action == 'opened'failed 1; dropping the bot author check failed 1.rate_limit_eventthrough this composite yet, soresets=is unproven against a real execution file.author_associationreportsMEMBERfor an org member whose membership is private (fails closed if not).Consumers of
class=(origin/main of both repos)Each treats
max-turnslikeother: red, never retried as a limit.max-turnstherepr-review.yml,pr-review-security.ymlstatus stepsfailure-classoutput in acasemax-turnsarm ("raise it in claude-args"); goes red; onlyrate-limitgets the skipped wordingintake-triage.ymlstatus stepfailure-class, any non-empty failure is redfailure-class=max-turnsintake-triage.ymlapply stepbabysit_merge.py(RATE_LIMIT_CLASS_RE,\bclass=rate-limit\b, the 5-hour re-run)babysit_review_evidence.py(_rate_limited, same regex; record by titleclaude-lane-review-complete)pr-unblock/dispatch.mjs,feedback-dispatch/address-feedback.mjs,review-dependency.mjsclass=readwork-resolve-issue/report-outcome.mjs,work-unblock/label-unblocked.mjsclass=read today (C2/C4 will addrate-limitonly)Related
credentialandmax-turnsare not yet passed bypr-review.ymlorpr-review-security.yml, which ci-workflows#756 owns; until they are, those lanes classify a past-cap run asother.claude-lane-review-complete.test.cjs(here: onenoticestub in its mock core); whichever merges second rebases.class=,resets=andresets-at.🤖 Generated with Claude Code