Repository navigation
ci(fix-vulnerabilities): resume Copilot session when disabling the age gate - #4465
Conversation
…e gate Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Agent evals
|
…e gate Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Agent evals
|
Description
When advisories remain after the first Copilot pass, the fix-vulnerabilities action starts a second, fresh Copilot session with the age gate (
npmMinimalAgeGate) disabled. That session has to rediscover the whole dependency tree, so it costs about as much as the first one.The age-gate-disabled pass now resumes the first session instead. The follow-up prompt (
resume.template.md) lists only the remaining advisories and tells Copilot what happened to its earlier changes: kept, reverted (with the verification failures), or none made. That way it only retries what could change now that newer versions are allowed. If the first session fails, the second pass falls back to a fresh session with the full prompt, as before. The report is unchanged: it still has separate "Copilot" and "Copilot (age gate disabled)" sections, and each pass's changes are verified on their own.Alternatives considered:
YARN_NPM_MINIMAL_AGE_GATE=0). It was slightly cheaper in benchmarks, but it means letting the agent set environment variables, which weakens the command allowlist. Copilot never actually used the bypass in testing, so it's also unclear whether the allowlist would even permit it.Benchmarks from dry-run workflow runs of the final code against
main, both instrumented only to print Copilot's stats (3 alternating runs per variant; averages, ranges in parentheses). zod was fixed in the first pass in every run; the remaining advisories all need a major bump, so the age-gate-disabled pass fixed nothing:main)The resumed pass alone took 8.6–12.3s, compared with 19.8–32.6s for a fresh age-gate-disabled session.
Test plan
Fix vulnerabilitiesworkflow on temporary branches with this change: 43867073265, 43870617371, 43874609365 and 43875196616 all succeeded. The resumed pass treated zod as already fixed and only retried glob, minimatch and deepmerge.main: 43870317795, 43870882584 and 43874883817.yarn format: passed.action.mtswithtsc --strict --module nodenext(no tsconfig covers.github/actions): passed.