Skip to content

v0.20.0: free-tier operating mode — deterministic Radar Sweep, 429 rounds, call pacing#77

Merged
hxddh merged 1 commit into
mainfrom
claude/report-code-content-review-9yv40q
Jul 22, 2026
Merged

v0.20.0: free-tier operating mode — deterministic Radar Sweep, 429 rounds, call pacing#77
hxddh merged 1 commit into
mainfrom
claude/report-code-content-review-9yv40q

Conversation

@hxddh

@hxddh hxddh commented Jul 22, 2026

Copy link
Copy Markdown
Owner

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):

  • Retry walks the fallback chain for AI_GATEWAY_429_ROUNDS (default 3) rounds with real backoff — honors Retry-After, else 30s escalating per round (cap 180s). Free per-minute quotas refill; the old single pass never gave them the chance.
  • Minimum AI_GATEWAY_CALL_INTERVAL (default 10s) between gateway calls — the 4-shard screening burst was self-inflicting 429s.
  • Cross-vendor fallback chains in the workflow (google/gemini-2.5-flash-lite interleaved) 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 Sweep is 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, so MIN_MAINSTREAM_RECALL 0.5 still 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.
  • Synthesis prompt slimmed (~70 pool lines removed); MUST-coverage instruction sharpened.
  • All quality gates unchanged.

Validation

  • 257 tests pass, including new tests: 429 chain walks a second round and honors Retry-After: 45; deterministic sweep replaces the model's placeholder section, dedups model-covered URLs, and inserts the 中文 pointer.
  • python scripts/agent_radar.py validate passes; workflow YAML parses.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JXjb8D4NrsgUXAvQodQSum


Generated by Claude Code

…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
@hxddh
hxddh merged commit 39c8716 into main Jul 22, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants