feat(core): HTTP status header line in -f llm/text/json output

Webclaw previously emitted URL, Title, Description, and Word count in
the -f llm header but no HTTP status. On a 404 response, the caller
had no signal apart from inspecting the body (e.g. dailysabah.com/
business/economy returns a 404 page; webclaw was extracting '13 words'
of the error page without flagging the 404 status).

New behavior: every -f llm/text/json output includes a 'Status: <code>'
header line (after URL: per phase A's placement). Emitted on all
responses including 200 for consistency — callers can't otherwise
distinguish 'webclaw saw 200' from 'webclaw missed status info'.

For -f json: top-level "status": <code> field added.

Modes --mode summary and --mode toc are exempt: the status line would
clutter the link-list and outline outputs.
M3 fast-fails (known-bad-sites) also skip the status line because
they exit before the formatter is reached.

7 new tests in webclaw-core (workspace total 671 -> 678).
This commit is contained in:
devnen 2026-05-23 21:29:26 +02:00
parent 66974366d7
commit dfcd51d9e0
14 changed files with 208 additions and 8 deletions

View file

@ -65,6 +65,7 @@ fn empty_metadata() -> Metadata {
image: None,
favicon: None,
word_count: 0,
http_status: None,
}
}