The best way to control Claude Code, Codex and more from any computer or phone
fix(ci): agent context budget compares with the PR's own base, not a newer main (#40035)
Julius Marminge committed
Nov 20, 2026 at 17:32 UTC
90c0766a163b91697679fd512ab7a9f886184673
1 file changed
+5
-3
.github/workflows/agent-context-budget.yml
+5
-3
@@ -25,15 +25,17 @@ jobs:
25
with:
26
sparse-checkout: apps/server/src/provider/agentContextBudget.json
27
sparse-checkout-cone-mode: false
28
+ fetch-depth: 2
29
30
+ # The checkout is the PR merged onto main; compare with that merge's main parent. A fresh
31
+ # fetch of main can be newer and lower, which reports the PR as growing what main just cut.
32
- name: Compare with main
33
run: |
31
- git fetch --quiet --depth=1 origin main
32
- if ! git cat-file -e "FETCH_HEAD:$BUDGET" 2>/dev/null; then
34
+ if ! git cat-file -e "HEAD^1:$BUDGET" 2>/dev/null; then
35
echo "main has no agent context budget yet."
36
exit 0
37
fi
36
- git show "FETCH_HEAD:$BUDGET" > "$RUNNER_TEMP/main.json"
38
+ git show "HEAD^1:$BUDGET" > "$RUNNER_TEMP/main.json"
39
grown=$(jq -r --slurpfile main "$RUNNER_TEMP/main.json" '
40
to_entries[]
41
| select($main[0][.key] != null and .value > $main[0][.key])