The page leanprompt report --html writes for AsyncFuncAI/deepwiki-open at commit 327da97, audited 2026-11-28. 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 AsyncFuncAI/deepwiki-open

leanprompt audit of AsyncFuncAI/deepwiki-open

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.

The audit found no place where this app pays for tokens it doesn't need

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

What's wrong and what to change

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

No confirmed findings.

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.

Provider errors are saved as wiki text, so page retries never run

Note 1. api/services/research.py:283 not scored

research_chat turns any provider failure (rate limit, bad key, timeout, context too large) into streamed text (lines 283-287, 278-281). Wiki generation concatenates every chunk (tasks.py:398-400) and stores it, so the error becomes the page body (or 'No valid <wiki_structure> XML found' for the structure step). _generate_page_with_retry (tasks.py:270-285) only retries on exceptions, so its WIKI_PAGE_RETRIES budget never fires for a provider error, and the finished wiki is cached and served by wiki_cache_exists (tasks.py:176-186).

What to change
Add a keyword-only raise_errors flag to research_chat (default False, so chat is unchanged) and pass it from the structure and page steps; the existing retry and placeholder then work.
Why it matters
A transient 429 costs a whole page for good, and every page of a rate-limited run can be an error string inside a cached 'completed' wiki.

How to check the fix Make the streamer raise once: with the change the page is generated again on the second attempt; before it the error text is the page content.

The Bedrock client returns its errors as a string, which is streamed as the answer

Note 2. api/clients/bedrock.py:369 not scored

call() catches every exception around invoke_model (line 357) and returns f'Error: {e}' (line 369). BedrockChatStreamer yields that string as the model's reply (_stream.py:268), so access-denied and throttling reach a wiki page as text, and the @backoff.on_exception decorator at line 301 never sees an exception to retry.

What to change
Re-raise inside call() (or return the error in a separate field) so the streamer and the backoff can see it.

How to check the fix Call with an unauthorised model id: the call raises instead of returning a string starting 'Error:'.

Bedrock answers are capped at 4,096 tokens and the stop reason is never read

Note 3. api/clients/bedrock.py:210 LP-GE-12 medium not scored

The Claude request body hard-codes max_tokens 4096 (lines 210, 219; 4096 for the other families at 226-239) and _extract_response_text (lines 247-258) returns only content[0].text, never stop_reason. A page that needs more is cut mid-sentence and stored as complete. How often this happens depends on page length.

What to change
Read stop_reason ('max_tokens') and retry once with a larger limit, or let the model config set max_tokens.

How to check the fix Ask for a page longer than 4,096 tokens: stop_reason is max_tokens and the stored page ends mid-sentence.

Several default and listed model ids are scheduled for or past retirement

Note 4. api/config/generator.json:45 LP-GE-13 medium not scored

The openai default is gpt-5-nano (also the openrouter default, line 78); against models/retirements.md (read 2026-11-27) gpt-5-nano is scheduled for 2026-12-11, and listed ids o1, o4-mini, gpt-4, gpt-4-turbo and gpt-35-turbo are retired. The Bedrock default is anthropic.claude-3-sonnet-20240229-v1:0 (line 146), whose Bedrock schedule is not on the Anthropic page. The table was read through a summarising fetch tool and must be re-checked before anyone relies on it.

What to change
Update the defaults after checking the providers' own pages.

How to check the fix Compare each id with the provider's deprecations page.

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.

Other problems found (check each against the code first; not scored):
- Provider errors are saved as wiki text, so page retries never run (api/services/research.py:283): research_chat turns any provider failure (rate limit, bad key, timeout, context too large) into streamed text (lines 283-287, 278-281). Wiki generation concatenates every chunk (tasks.py:398-400) and stores it, so the error becomes the page body (or 'No valid <wiki_structure> XML found' for the structure step). _generate_page_with_retry (tasks.py:270-285) only retries on exceptions, so its WIKI_PAGE_RETRIES budget never fires for a provider error, and the finished wiki is cached and served by wiki_cache_exists (tasks.py:176-186). Change: Add a keyword-only raise_errors flag to research_chat (default False, so chat is unchanged) and pass it from the structure and page steps; the existing retry and placeholder then work.
- The Bedrock client returns its errors as a string, which is streamed as the answer (api/clients/bedrock.py:369): call() catches every exception around invoke_model (line 357) and returns f'Error: {e}' (line 369). BedrockChatStreamer yields that string as the model's reply (_stream.py:268), so access-denied and throttling reach a wiki page as text, and the @backoff.on_exception decorator at line 301 never sees an exception to retry. Change: Re-raise inside call() (or return the error in a separate field) so the streamer and the backoff can see it.
- Bedrock answers are capped at 4,096 tokens and the stop reason is never read (api/clients/bedrock.py:210) [LP-GE-12]: The Claude request body hard-codes max_tokens 4096 (lines 210, 219; 4096 for the other families at 226-239) and _extract_response_text (lines 247-258) returns only content[0].text, never stop_reason. A page that needs more is cut mid-sentence and stored as complete. How often this happens depends on page length. Change: Read stop_reason ('max_tokens') and retry once with a larger limit, or let the model config set max_tokens.
- Several default and listed model ids are scheduled for or past retirement (api/config/generator.json:45) [LP-GE-13]: The openai default is gpt-5-nano (also the openrouter default, line 78); against models/retirements.md (read 2026-11-27) gpt-5-nano is scheduled for 2026-12-11, and listed ids o1, o4-mini, gpt-4, gpt-4-turbo and gpt-35-turbo are retired. The Bedrock default is anthropic.claude-3-sonnet-20240229-v1:0 (line 146), whose Bedrock schedule is not on the Anthropic page. The table was read through a summarising fetch tool and must be re-checked before anyone relies on it. Change: Update the defaults after checking the providers' own pages.

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

100static
E, prefill reuse
1.00
S, prefix stability
1.00
G, generation waste
0.00
Default shares
0 of 0

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-28 (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.