Skip to content

cloud render fallback is invisible in the report; add render mode and fallback reason to output #1664

Description

@nc9

When cloud rendering falls back (out of credits, server failures, race lost), cloud-fetcher.ts latches fallbackActive (~350) and the reason is only a logger.warn. The render mode itself is chosen in controllers/audit.ts:359-440 from five inputs. A user paying for render can get plain-HTTP pages with no report-level note, and an agent can't tell which pages were rendered. Per-waiter state is three booleans (settled, dispatched, racing, cloud-fetcher.ts:143-170) whose legal combinations live only in comments.

Related: #1285.

Approach: report JSON and LLM output carry render: { requested, mode, fallbackReason?, pagesRendered, pagesFetchedPlain }. Replace the waiter booleans with WaiterState = queued | racing | settled. terminalFallbackReason is already a pure function; reuse it.

Acceptance Criteria

  • Report JSON and LLM output state the render mode used, how many pages were rendered vs fetched plain, and the fallback reason when one happened
  • Console output prints one line when render fell back, with the reason
  • Waiter state is one union, not three booleans; existing cloud-fetcher tests pass
  • docs: report JSON reference lists the render block

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clisize: S

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions