v0.20.0: free-tier operating mode — deterministic Radar Sweep, 429 rounds, call pacing#77
Conversation
…unds, call pacing The 2026-07-21 migration to Vercel AI Gateway free-tier models broke the pipeline two ways (Issue #76): free-pool 429s killed source-sweep and promote-candidates (primary and fallback shared one exhausted pool), and the weak synthesis models failed the mainstream-recall gate or produced hollow day blocks. The owner chose to stay on free models; this release adapts the pipeline: - Deterministic Radar Sweep: the runner builds section 7 from the screening pool after the recall gates; the model stops echoing ~70 one-liners that consumed its output budget. Covered URLs dedup out; 中文 block gets a pointer. - 429-aware retry: walk the fallback chain for AI_GATEWAY_429_ROUNDS (3) rounds, honoring Retry-After else 30s/round escalating backoff. - Call pacing: AI_GATEWAY_CALL_INTERVAL (10s) minimum gap between gateway calls. - Cross-vendor fallback chains in the workflow so one exhausted pool cannot kill the whole chain. - Quality gates unchanged (MIN_MAINSTREAM_RECALL 0.5). 257 tests pass; prompts updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JXjb8D4NrsgUXAvQodQSum
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4be5a8ad3d
ℹ️ 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".
| f"MIN_MAINSTREAM_RECALL ({min_mainstream}). " | ||
| "Cover high-confidence mainstream candidates before emerging repos." | ||
| ) | ||
| inject_deterministic_radar_sweep(result) |
There was a problem hiding this comment.
Inject the deterministic sweep before recall gates
Because this call happens only after compute_synthesis_recall_details and the weighted/mainstream recall checks above, candidates that the runner is about to cover in the auto-generated Radar Sweep still count as missed. With the default 20 prompt candidates plus up to 100 sweep candidates, a broad daily screening pass can be rejected for low weighted recall even though the injected section would satisfy that breadth, so move injection before computing recall or include SHARED_SWEEP_LINES in the recall haystack.
AGENTS.md reference: AGENTS.md:L10-L14
Useful? React with 👍 / 👎.
| lines = [ | ||
| line | ||
| for line in SHARED_SWEEP_LINES | ||
| if not (" | " in line and line.rsplit(" | ", 1)[1].strip() in block) |
There was a problem hiding this comment.
Ignore old sweep content when skipping duplicates
When the model ignores the new instruction and writes real #### 7. Radar Sweep lines, this duplicate filter searches the entire block, including the very section that is about to be replaced. Any generated line whose URL already appears only in the old sweep is filtered out and then the old sweep is deleted, silently dropping that candidate from the final daily note; strip the existing sweep section before testing whether a URL was covered elsewhere.
AGENTS.md reference: AGENTS.md:L10-L14
Useful? React with 👍 / 👎.
Summary
Adapts the pipeline to the Vercel AI Gateway free-tier models (owner's decision: no rollback), fixing both failure axes from today's Issue #76:
429 rate limits (killed source-sweep + promote-candidates):
AI_GATEWAY_429_ROUNDS(default 3) rounds with real backoff — honorsRetry-After, else 30s escalating per round (cap 180s). Free per-minute quotas refill; the old single pass never gave them the chance.AI_GATEWAY_CALL_INTERVAL(default 10s) between gateway calls — the 4-shard screening burst was self-inflicting 429s.google/gemini-2.5-flash-liteinterleaved) so one exhausted OpenAI free pool can't kill primary and fallback together.Weak-model quality (daily refused at mainstream recall 0.2; hollow 10.5k-char day block published overnight):
#### 7. Radar Sweepis now generated deterministically by the runner from the screening pool — the model stops echoing ~70 one-liners that consumed most of a free model's output budget. Injection happens after the recall gates, soMIN_MAINSTREAM_RECALL 0.5still measures the model's real MUST coverage; the freed budget goes exactly where the gate demands it. Covered URLs dedup out of the sweep; 中文 block gets a pointer. Sweep breadth is now guaranteed regardless of model strength.Validation
Retry-After: 45; deterministic sweep replaces the model's placeholder section, dedups model-covered URLs, and inserts the 中文 pointer.python scripts/agent_radar.py validatepasses; workflow YAML parses.🤖 Generated with Claude Code
https://claude.ai/code/session_01JXjb8D4NrsgUXAvQodQSum
Generated by Claude Code