The page leanprompt report --html writes for duanyytop/agents-radar at commit 7c5355e, audited 2026-11-27. Every figure on this page is an estimate from reading the code, not a measurement of the app in use. Corrections and takedown: email info@podwarden.com or open an issue. Back to the audit of duanyytop/agents-radar

leanprompt audit of duanyytop/agents-radar

Unattended audit: nobody was asked during the run, so priority, volume and prices were left open; the questions for the owner are listed at the end.

3 places where this app pays for tokens it doesn't need

The biggest, at src/providers/openai-compatible.ts:17, about 23k tokens per 1,000 calls: the OpenAI client is created with the SDK defaults, which silently retry 408, 409, 429 and every 5xx twice before callLlm sees the error. report.ts:191-196 says a 5xx must not be retried because it risks a duplicate generation that was already billed, so the SDK does exactly what the app's policy rules out, and callLlm's own 429 and connection ladders run on top of it (up to 3 x 7 = 21 HTTP attempts per call).

Together about 29k tokens per 1,000 calls An estimate from the code, not a measurement.

Tokens per 1,000 calls, by finding, and each one's share of the total

Plus 1 finding that costs no tokens today, listed with the findings and not counted as places.

Plus 3 other problems the audit found, listed after the findings. Not scored.

What this costs you

Every figure here is an estimate from the code, not a measurement. Findings can overlap (one failed call can show up in two), so the sum may count some tokens twice. Money is not part of the score. The table lists this app's findings first, largest first, then its open questions, then the questions for the server's administrator, then the findings the project already knows about, which are not in the totals.

FindingWhereTokens per 1,000 calls
LP-GE-05src/providers/openai-compatible.ts:1714k prompt, 8.8k output
LP-GE-04src/providers/openai-compatible.ts:174.1k output
LP-GE-05src/index.ts:6282k output

To see this in money, add to leanprompt.yaml:

  • volume: {calls_per_month: N}: how many calls the app makes a month (with targets:, on each entry)
  • prices: per model: input, cached_input and output per 1M tokens (US dollars, or set currency), with source and checked date (or, self-hosted, engine: {prefill_tokens_per_second: N})

leanprompt never guesses a volume or a price. Your coding agent can look up the provider's current price page and add it with the date; how.

What's wrong and what to change

4 open, 0 fixed. Largest first, by the audit's estimate of tokens lost per 1,000 calls.

The OpenAI client is created with the SDK defaults, which silently retry 408, 409, 429 and every 5xx twice before callLlm sees the error. report.ts:191-196 says a 5xx must not be retried because it risks a duplicate generation that was already billed, so the SDK does exactly what the app's policy rules out, and callLlm's own 429 and connection ladders run on top of it (up to 3 x 7 = 21 HTTP attempts per call).

Finding 1. src/providers/openai-compatible.ts:17 medium LP-GE-05 how often is assumed

What to change
Pass maxRetries: 0 to new OpenAI(...) in openai-compatible.ts (and to new Anthropic() in anthropic.ts), so callLlm's ladder is the only retry layer.
Why it matters
Each SDK retry of a 5xx resends the full prompt and, if the provider had started generating, pays for the output again.
How often it happens
The code shows the problem; how often it happens is assumed. To measure it: How often DashScope returns a 5xx or 408/409 on this endpoint, from the Actions logs or the Model Studio console; a 5xx retried by the SDK leaves no line in the app's log.
Estimate
about 23k tokens per 1,000 calls if 2 in 1,000 calls hit a billed 5xx (estimate)
What the estimate assumes

2 of 1,000 calls get a 5xx after generation started; a digest call is about 7,000 prompt and 2,200 output tokens; each SDK retry repeats both. Connection failures, the common case here, cost no tokens and are not counted.

How to check the fix In a unit test with a fake fetch that returns 500, the provider makes exactly one HTTP request and callLlm throws without retrying.

No timeout is set, so each request may wait the SDK default of 10 minutes, and a timed-out request is retried twice by the SDK and then counted by isConnectionError (report.ts:183) as a connection failure, which callLlm retries 6 more times.

Finding 2. src/providers/openai-compatible.ts:17 medium LP-GE-04 how often is assumed

One stalled request can therefore hold a concurrency slot for well over the 40-minute job limit (daily-digest.yml:63), and the job is killed before anything is committed.

What to change
Set timeout to about 3 minutes on the client (a 4,096-token qwen-flash answer takes well under a minute), together with maxRetries: 0.
Why it matters
A request that times out after the provider generated the answer is billed and thrown away, and the run loses the whole day.
How often it happens
The code shows the problem; how often it happens is assumed. To measure it: Whether any run logged an APIConnectionTimeoutError, from the Actions logs; none of the last 40 runs took longer than 21 minutes.
Estimate
about 4k output tokens per 1,000 calls if 1 in 1,000 calls stalls (estimate)
What the estimate assumes

1 stalled call per 1,000; the stalled call is billed for a full 4,096-token answer. Observed runs take 5 to 21 minutes, so stalls have been rare or absent.

How to check the fix With a fake fetch that never answers, callLlm gives up within the new timeout times the retry ladder, well inside 40 minutes.

attemptJson retries the highlights call when the JSON does not parse, with the same 2,048-token limit.

Finding 3. src/index.ts:628 low LP-GE-05 how often is assumed

If the parse failed because the reply was cut off at the limit, the retry is cut off the same way and both attempts are billed.

What to change
Read finish_reason in the provider, and when it is length raise the limit for the second attempt (for example to 4,096) instead of repeating it unchanged.
Why it matters
A truncated reply sent again unchanged usually stops at the same place.
How often it happens
The code shows the problem; how often it happens is assumed. To measure it: How often a highlights reply is cut at 2,048 tokens; the provider returns finish_reason, which the app discards.
Estimate
about 2k output tokens per 1,000 calls (estimate)
What the estimate assumes

The English highlights reply is about 900 tokens and the translated one similar, so truncation is rare; assumed once per 1,000 calls.

How to check the fix A test where the provider returns a cut-off JSON with finish_reason length shows the second attempt sent with the larger limit.

Model Studio's Batch API bills qwen-flash at 50% of the real-time price, and this is a nightly job no user waits on.

Finding 4. src/report.ts:201 low LP-GE-07

It is not recommended here: the batch window is at least 24 hours with no stated turnaround, and the run has four dependent stages (summaries, translations, comparisons, highlights) that must finish by about 07:00 CST.

What to change
No change recommended. Revisit only if the delivery time can move by a day.
Why it matters
The same tokens at half price, about 0.25 yuan a day at the project's stated 0.5 yuan per run.
Estimate
no tokens saved; price only
What the estimate assumes

Batch facts from help.aliyun.com/zh/model-studio/batch-interfaces-compatible-with-openai, read 2026-11-26: qwen-flash supported in Beijing, 50% price, completion window 24h to 336h.

How to check the fix Not applicable.

Other problems the audit found

Problems the audit checked in the code that cost no tokens of their own, such as a spend meter that ignores cache tokens or a cut-off answer accepted as complete. They are not scored. Check each one before you change anything.

Telegram and Feishu highlights are extracted from only the first 2,000 characters of each report

Note 1. src/prompts-data.ts:303 not scored

buildHighlightsPrompt sends content.slice(0, 2000) of each report. For ai-cli, ai-agents and ai-infra that is the title, the list of project links and the start of the comparison, cut mid-table, but the model is asked for 6 highlights per report. Over 2026-10-27 to 2026-11-26, 66 of 558 highlights for these three reports name a project whose text was not in the excerpt (only its link), e.g. 'ZeroClaw introduces new agent sandbox' on 2026-11-25, while the ZeroClaw section never mentions a sandbox.

What to change
For the three repo reports, build the excerpt from each project's 'Today's Highlights' paragraph (or the comparison without the link list) instead of the head of the file; keep the 2,000-character slice for the single-topic reports.
Why it matters
The highlights are the push notification subscribers read; a claim invented from a project name is worse than no claim.

How to check the fix Rerun scripts/regen-highlights.ts on a past day and check that every ai-cli, ai-agents and ai-infra highlight is supported by that day's report text.

A reply cut off at the output limit is published as complete

Note 2. src/providers/openai-compatible.ts:29 LP-GE-12 high not scored

The provider returns message.content and drops finish_reason, so a summary, comparison or translation that stopped at max_completion_tokens is published as if whole, with no line in llmStats or the step summary. A scan of the 1,444 report files committed since 2026-09-01 found no cut-off endings, so this is currently rare.

What to change
Return finish_reason with the text and log a warning (and count it in llmStats) when it is length.

How to check the fix A test where the fake provider returns finish_reason length shows the warning in the step summary.

Fix it with your coding agent

Paste this into Claude Code, Codex, Cursor or any coding assistant. It will check each finding against your code and propose fixes one at a time, asking before it changes anything.

Please check and fix the LLM-call findings from a leanprompt audit of this repository.

1. If the leanprompt skills are not installed for you here, install them: npx leanprompt@0.1.0-dev.15 install
2. Read .leanprompt/findings.json and leanprompt-report.md. If they are missing, use the list below.
3. Check each finding against the code before you change anything. The audit can be wrong: if a finding does not hold, tell me why and leave that code alone.
4. Fix one finding at a time. Show me the change as a small diff and apply it only after I say yes.
5. Prove each fix with the measure-loop skill: a before and after on the same scenario. Ask me before running anything that sends real, billed requests.
6. When a fix is proved, set "fixed": true on its finding in .leanprompt/findings.json and run npx leanprompt@0.1.0-dev.15 score.

Findings, largest first:
1. LP-GE-05 at src/providers/openai-compatible.ts:17: The OpenAI client is created with the SDK defaults, which silently retry 408, 409, 429 and every 5xx twice before callLlm sees the error. report.ts:191-196 says a 5xx must not be retried because it risks a duplicate generation that was already billed, so the SDK does exactly what the app's policy rules out, and callLlm's own 429 and connection ladders run on top of it (up to 3 x 7 = 21 HTTP attempts per call).
2. LP-GE-04 at src/providers/openai-compatible.ts:17: No timeout is set, so each request may wait the SDK default of 10 minutes, and a timed-out request is retried twice by the SDK and then counted by isConnectionError (report.ts:183) as a connection failure, which callLlm retries 6 more times. One stalled request can therefore hold a concurrency slot for well over the 40-minute job limit (daily-digest.yml:63), and the job is killed before anything is committed.
3. LP-GE-05 at src/index.ts:628: attemptJson retries the highlights call when the JSON does not parse, with the same 2,048-token limit. If the parse failed because the reply was cut off at the limit, the retry is cut off the same way and both attempts are billed.
4. LP-GE-07 at src/report.ts:201: Model Studio's Batch API bills qwen-flash at 50% of the real-time price, and this is a nightly job no user waits on. It is not recommended here: the batch window is at least 24 hours with no stated turnaround, and the run has four dependent stages (summaries, translations, comparisons, highlights) that must finish by about 07:00 CST.

Other problems found (check each against the code first; not scored):
- Telegram and Feishu highlights are extracted from only the first 2,000 characters of each report (src/prompts-data.ts:303): buildHighlightsPrompt sends content.slice(0, 2000) of each report. For ai-cli, ai-agents and ai-infra that is the title, the list of project links and the start of the comparison, cut mid-table, but the model is asked for 6 highlights per report. Over 2026-10-27 to 2026-11-26, 66 of 558 highlights for these three reports name a project whose text was not in the excerpt (only its link), e.g. 'ZeroClaw introduces new agent sandbox' on 2026-11-25, while the ZeroClaw section never mentions a sandbox. Change: For the three repo reports, build the excerpt from each project's 'Today's Highlights' paragraph (or the comparison without the link list) instead of the head of the file; keep the 2,000-character slice for the single-topic reports.
- A reply cut off at the output limit is published as complete (src/providers/openai-compatible.ts:29) [LP-GE-12]: The provider returns message.content and drops finish_reason, so a summary, comparison or translation that stopped at max_completion_tokens is published as if whole, with no line in llmStats or the step summary. A scan of the 1,444 report files committed since 2026-09-01 found no cut-off endings, so this is currently rare. Change: Return finish_reason with the text and log a warning (and count it in llmStats) when it is length.

Score

One number from 0 to 100 for how well this app avoids paying for the same tokens twice; higher is better. It is computed from the findings above (static) or from your usage log (measured).

99static
E, prefill reuse
1.00
S, prefix stability
1.00
G, generation waste
0.01
Default shares
0 of 4

Findings scored with severity defaults, not estimates. The fewer, the more the static score says about this app.

A static score is an estimate from the audit's findings, not a measurement.

Scored 2026-11-27 (the date on the machine that ran it).

Questions for the owner

These were not answered during the audit. Until they are, the page shows tokens only and ranks the advice without a priority.

  • Priority: which matters most for this app, cost, speed or quality (or weights)? Not set, so the advice uses equal weights. Answer with priority: in leanprompt.yaml.
  • Volume: how many calls does the app make a month? Answer with volume: {calls_per_month: N, source: "..."} in leanprompt.yaml.
  • Prices: what does each model cost (input, cached input, output per 1M tokens, with the source and the date it was read, and the currency if not US dollars)? Answer with prices: in leanprompt.yaml.