Provider errors are saved as wiki text, so page retries never run
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.