Skip to content

perf(ci): stop runner inventory retries after HTTP 401 - #13477

Merged
EffortlessSteven merged 2 commits into
mainfrom
perf/8858-runner-auth-failfast
Nov 11, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
perf/8858-runner-auth-failfast

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Stop runner-inventory retries immediately after an HTTP 401. Retain the failure, redacted warning, and GitHub-hosted fallback. HTTP 403, 429, 502 and opaque failures retain bounded retries.

Swarm / Source Boundary

  • swarm-only CI routing

Source-of-truth Links

Proposal: #8858 bounded runner-inventory retry improvement.
Spec: existing runner routing and redaction contract in .github/workflows/routed-rust.yml.
ADR: none; existing route owner retained.
Plan item: avoid repeating an unchanged rejected-credential request; preserve transient retries and fallback.
Governing issue or accepted claim: #8858 (partial only).
Acceptance delta (one sentence): A parsed HTTP 401 stops the runner query before another query or sleep while preserving failure diagnostics and hosted fallback.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): perf/8858-runner-auth-failfast; 439385e.
Stack parent or prerequisite PR (if any): none.
Proposed replacement of PR (if any; not yet accepted): none.
Acceptance retained from a replaced candidate (if any): not applicable.
Accepted winner and losing candidate disposition (when decided): this bounded candidate; no competing implementation identified.

Scope

Three files: route shell, existing Linux execution tests, changelog. No credentials, settings, permissions, timeout or protected-result changes.

Proof

PASS: pinned Rust 1.95.0 on WSL Linux compiled and executed tools/repo-policy/tests/runner_inventory_diagnostics.rs directly: 10 passed. The harness executes the actual workflow Bash body with a local gh stub and GNU timeout. Two new controls failed before the fix: 401 continued to attempt three and a 99-second delay hit the 5-second test timeout. Both pass after the fix. Existing transient recovery, persistent failure, 403, redaction and untrusted-PR controls pass.

PASS: git diff --check.

NOT ESTABLISHED: full ci-policy, check-fast, native product build, hosted qualification. Native formatting/build invocations lost tool responses during host stalls; no pass is claimed. This is a Draft handoff, not merge clearance.

Claim Boundary

Only parsed HTTP 401 retry behavior changes. This does not repair the credential or prove whole-route time savings. Under the existing default delays it avoids up to 15 seconds of retry sleep on that response. HTTP 403 remains retryable because it can represent rate limiting.

Review

Exact-source inspection covered shell error propagation, existing status parsing, warning/redaction consumers, success and fallback selection, untrusted PR behavior, and retry limits. The unchanged shell function returns the native failing code, and its caller records failure as before. Tests execute the production shell and discriminate the old behavior. Overall REVIEW_INCOMPLETE for missing policy and hosted evidence.

Policy Impact

No new process or network surface. Existing test harness and route command retained.

Changelog

changelog.d/8858-runner-auth-failfast.md uses Internal / CI and references #8858.

CI Economics

  • LEM impact: avoids two requests and default 15 seconds of sleep after HTTP401; whole-route impact unmeasured.
  • Workflows touched: routed-rust.yml.
  • Branch protection impact: none.
  • Failure mode caught: repeated rejected-credential query.
  • Required/advisory/on-demand lanes: routing only; qualification unchanged.
  • Artifacts and labels: unchanged.
  • Rollback: revert the three-file patch.

Continuation

Owner: repository maintenance lane. Next transition: run ci-policy and check-fast on this exact head, complete published-head review, then request qualification through the normal merge-ready route. No CI request or merge clearance is made by this draft.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 10 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 151 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: e0b21b50-e131-4712-bdd0-e4b447c53e18
Commits

Reviewing files that changed from the base of the PR and between 466b58c and 6f6bffd.

Files selected for processing: 3

  • .github/workflows/routed-rust.yml
  • changelog.d/8858-runner-auth-failfast.md
  • tools/repo-policy/tests/runner_inventory_diagnostics.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs one verification check before upstream.

Verification questions

  • Confirm no broad sibling-route scan is evidenced for other runner-inventory callers or status parsers.

Refuted

  • The changelog and PR body narrowly describe parsed HTTP 401 behavior and do not claim that 403, 429, or 502 are terminal.

Evidence gaps

  • External workflow validation and full repository policy/build evidence remain incomplete because actionlint and ripr failed, cargo-test receipt is absent, and heavy witnesses were skipped.
  • Model proof intent was rejected by deterministic validation.
  • The claimed focused execution is not independently evidenced by the shared packet.
  • The added tests cover both an immediate 401 and a 401 following one transient failure, but their execution receipt is not present.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head review (head 439385e)

Verified

  • I read the full diff at this head against merge-base a5fca18: the routed-rust.yml retry loop, the changelog and two new runner-inventory tests. The governing-issue (#8858, partial) and acceptance-delta lines are present.
  • The new guard [ "$runner_query_http" != 401 ] || return "$rc" (.github/workflows/routed-rust.yml:89) runs before the bounded-retry and sleep branch. A parsed 401 therefore returns at once with the recorded exit code. Transient failures keep the three-attempt path, and the failure summary, warning and GitHub-hosted fallback are unchanged.
  • The test harness runs the literal workflow shell, extracted from the YAML, under GNU timeout with a stubbed gh (tools/repo-policy/tests/runner_inventory_diagnostics.rs:60-129). The oracle therefore exercises the real embedded script.
  • unauthorized_inventory_stops_before_retry_or_sleep sets RUNNER_QUERY_RETRY_DELAY=99 and asserts exactly one call, runner_query_http=401, the hosted fallback and a redacted summary with no SECRET text.
  • unauthorized_after_transient_failure_stops_at_that_attempt asserts that a 502 followed by a 401 stops at attempt 2. The existing persistent-failure test remains the non-401 control.
  • Not run here: these repo-policy tests need bash, GNU timeout and Unix permissions, and this host is Windows. I report them as not run, not as passed.

Findings

  • None blocking.

Reviewed; no blocking findings.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amended exact-head evidence (head 6f6bffd)

Delta since 439385e: rustfmt-only reformat of the new test array in runner_inventory_diagnostics.rs (cargo fmt -p repo-policy; fmt --check now pass). No shell or behavior change.

Refreshed proof at 6f6bffd:

  • WSL Ubuntu, Rust 1.95.0: cargo test -p repo-policy --test runner_inventory_diagnostics: 10 passed, 0 failed. Pins 401 stops at attempt 1, 502 then 401 stops at attempt 2, non-401 persistent failure retries 3 times, transient recovery, redaction and fallback preserved.
  • cargo xtask check-workflows: pass. cargo xtask check-fast: exit 0 (12 gates, selector 3 files). cargo xtask ci-policy: exit 0 (final user-text gate needed the built ripr binary placed in target/ripr/drivers/ due to xtask self-relocation; instrument prerequisite, no gate weakened).
  • Sibling scan: exactly one production runner-inventory caller (query_runners in routed-rust.yml) and one caller site; no other workflow shares this retry loop. Downstream 401/403 warning and hosted fallback consume the preserved runner_query_http value.
  • Automated-review gaps reconciled: sibling-route scan (done, above), Linux execution receipt (WSL, above), workflow policy (check-workflows/ci-policy, above). Zero review threads on this PR at last GraphQL inventory; will re-verify before merge.
  • This candidate modifies routed-rust.yml, so its workflow tuple (f7b41a68..., 7252587f..., 782208fb...) differs from base and is unaudited; recorded on #12817. Guard not invoked; ordinary protected expected-head route after required qualification.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW_READY

Current-head source attestation for 6f6bffd. Evidence on this PR: amended exact-head review today (WSL Linux 10 tests passed at this head, check-workflows pass, ci-policy exit 0, check-fast exit 0 with 3-file selector, sibling-caller scan complete), zero unresolved review threads. No blocking findings.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 8, 2026 13:10
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

ripr static exposure check

Commit 6f6bffd099d1 · run · advisory, static evidence only (not a mutation run).

#ripr agent static-advisory base=466b58c245d1592ccfdad7c6ad77915534211d86 findings=0 gaps=0
done=no changed behavior found in scope; static advisory, not runtime proof

Took 5s.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Qualification run 42483649321 (attempt 1 and failed-jobs rerun): Rust gates and all four test shards passed; Ripr Rust Small Result failed only at Require the extension e2e result. The e2e failure is deterministic and identical in both attempts: Real multi-root server acceptance expects the server-generated assert_eq!(alpha_discount(100, 100), 90) but receives the placeholder form, i.e. the real server did not produce the concrete draft. This candidate changes only the routed-rust.yml runner-inventory shell, its repo-policy diagnostics test, and a changelog; it cannot affect extension server behavior. Classification: inherited from the integration subject at request time, not candidate-caused. Since that run, main has landed b364cf9 fix(vscode): start the server in tsconfig/jsconfig-only workspaces (#13635). Re-requesting qualification on the current merge subject (head unchanged at 6f6bffd); passing child jobs from run 42483649321 remain evidence for the unchanged head.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Qualification blocked by an independent prerequisite defect (not candidate-caused). Runs 42483649321 (two attempts) and 42491330467: Rust gates pass, all four test shards pass, Ripr Rust Small Result fails only at Require the extension e2e result. The e2e is selected because this PR touches .github/workflows/routed-rust.yml (routed-rust.yml:600). Failure is deterministic and identical across attempts and integration subjects: Real multi-root server acceptance expects assert_eq!(alpha_discount(100, 100), 90) and receives the placeholder assert_eq!(alpha_discount(/* boundary input where amount >= threshold /), / expected */) (742 passing, 1 failing). This candidate changes only the runner-inventory shell, its diagnostics test, and a changelog; it cannot affect extension server behavior. Recorded on the multi-root acceptance owner #1873. Resume condition: once that e2e passes on a current main subject, re-add merge-ready for the unchanged head 6f6bffd (attestation and local proof remain current for that head). I am removing the merge-ready label to park the request; the PR stays Ready. This PR is not merged and #8858 is not yet advanced by it.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW_READY

Joining this parked candidate from the CI-efficiency lane (claim: resume and finish #13477; branch perf/8858-runner-auth-failfast, head 6f6bffd099d12570b9ade4eee0fa353da8230cca unchanged; state: requesting qualification). No push is made to this branch.

Exact-head review, refreshed against current main cb95c5b0e15b1d5f37fdb4c4c8f0b63098377d10

Inspected: the complete three-file diff (routed-rust.yml one added guard line plus comment, tools/repo-policy/tests/runner_inventory_diagnostics.rs, changelog fragment), and the surrounding Select runner step on current main, including the consumers of runner_query_attempts / runner_query_http (step outputs, step summary, the 401/403 warning). The guard returns the original gh exit code before the attempt bound and before sleep, so the failure record, the redacted status, the warning and the GitHub-hosted fallback are unchanged; 403/429/5xx/opaque failures still take the bounded retry path. The summary line then reads attempts: 1 of 3, which is accurate.

Executed on native Linux x86_64, pinned Rust 1.95.0, on a local merge of this head into cb95c5b0 (clean merge, tree 8e281fc88d1d6fb127008ac4db51e1caf0957712):

  • cargo test -p repo-policy --test runner_inventory_diagnostics: 10 passed, 0 failed.
  • Negative control, guard line removed and nothing else changed: 8 passed, 2 failed (unauthorized_inventory_stops_before_retry_or_sleep, unauthorized_after_transient_failure_stops_at_that_attempt). The two new tests discriminate the fix.
  • cargo xtask check-workflows: pass.

Why now: every routed run sampled on 2026-11-10/11 records RUNNER_QUERY_HTTP: 401 with RUNNER_QUERY_ATTEMPTS: 3, and the Select runner step takes about 19 s (run 42952169315) before admission can start. This removes the two sleeps from every request while the credential stays rejected.

Resume condition from the 2026-11-08 park note: the extension e2e (Real multi-root server acceptance) had to pass on a current main subject. #14019 and #12974 both touch editors/vscode and landed on 2026-11-09 and 2026-11-10 through the same required Result, so that e2e is passing on current main subjects.

Not established here: hosted qualification on the current merge subject (requested next), and no claim about runner-token health or self-hosted capacity. Review threads: zero, read back just before this review.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant