Skip to content

Commit 40f1144

Browse files
authored
ci: bypass AI Gateway cache for Bonk reviews (#268)
Bonk routes through a Cloudflare AI Gateway. With response caching enabled on the gateway, re-running `/bonk review` on a PR returns the first run's cached completion, so the review stays stale even after new commits are pushed (observed on #264 after a force-push: three re-runs all returned an identical review of the pre-split code). Inject cf-aig-skip-cache via OpenCode's provider.options.headers so every model request bypasses the gateway cache and reflects the current PR.
1 parent 7004cca commit 40f1144

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/bonk.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ jobs:
3535
CLOUDFLARE_GATEWAY_ID: ${{ secrets.CF_AI_GATEWAY_NAME }}
3636
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_AI_GATEWAY_TOKEN }}
3737
# Auto-approve tool calls in CI so Bonk doesn't stall on prompts.
38-
OPENCODE_CONFIG_CONTENT: '{"permission":"allow"}'
38+
# cf-aig-skip-cache bypasses the AI Gateway response cache: without
39+
# it, re-running `/bonk review` on the same PR returns the first
40+
# run's cached completion, so reviews go stale after a force-push.
41+
# OpenCode forwards provider.<id>.options.headers on every request.
42+
OPENCODE_CONFIG_CONTENT: '{"permission":"allow","provider":{"cloudflare-ai-gateway":{"options":{"headers":{"cf-aig-skip-cache":"true"}}}}}'
3943
with:
4044
# Workers AI reasoning model: works with the gateway creds above.
4145
# anthropic/* routing needs the gateway's stored Anthropic key (BYOK),

0 commit comments

Comments
 (0)