The rebase onto current main keeps the original entries and adds the three
user-facing changes merged after its base: the finding report_state field,
the ordered LLM health persistence, and the framed intent summaries.
The /system/llm/ badge read llm_profile_health, which only the failover
Pool wrote. A task pinned to an explicit chain, a bound agent with
failover off, and the global provider all call the provider directly, so
a dead backend stayed "Healthy".
One policy now lives in llmpool.Registry.RecordCall, used by the Pool and
by the task runtimes: a success clears the state, a failover-eligible
failure trips it, context cancellation and deterministic 400s do not, and
a stream that already delivered output is left alone. The selection
carries the profile whose breaker the call updates, and a provider
already wrapped in the Pool reports nothing to avoid double counting.
The LLM recording page also explains an empty list while the llm_record
toggle is off, after the settings call resolves.
Originally reported in #257.
The wake lines interpolated a planner-written intent summary into the trusted sentence, and the overview kept every summary in the plain JSON, so an inherited summary crossed tasks as if this planner had written it (#124, F3). Frame the summary on the wake lines and move the open/running/recent-done summaries into one framed block; the structured intent fields stay plain.
A newer state for the same profile replaces one that has not been written yet, and a failed write is logged instead of discarded on a detached goroutine.
The status line said the proxy does not apply rules yet. Replace it with
the request and response phases, what exchange_rewrites records and how
the hashes are formed (plain SHA-256, keyed HMAC for sensitive actions),
the SSE and WebSocket behaviour, the 5 MiB response pass-through, the
snapshot limits (live slots are never deleted by the TTL), and the fact
that replays go through the proxy and are rewritten like captures.
It now says that traffic_get shows the originals of a rewritten exchange
and that traffic_search never finds a value a rewrite rule wrote. As for
traffic_search, only the original built-in text is replaced.
The sink runs the request phase in the Request hook and the response phase
at the start of the Response hook; at SSEStart only status and header
actions apply. WebSocketStart comes after the client is upgraded, so the
handshake is traced "not rewritten: stream" and recorded as sent.
Exchanges keep what the client sent and what the target answered. The
original of a rewritten request lives in a per-flow snapshot slot (entry or
tombstone, 1024 entries / 64 MiB, 4096 tombstones), reserved before the
request is changed, released on Response, RequestError, SSEStart, a 5 MiB
response, or by a sweep of finished flows (ClientDisconnected, 1 s
debounce, 1 min period). Under pressure an entry older than 15 minutes is
turned into a tombstone in place, only when that frees room for the new
reservation; its exchange is recorded "original request unavailable".
record(), recordStreamStart() and insertExchange() clear any trace under
the id before INSERT OR REPLACE; the trace (exchange_rewrites, created
with CREATE TABLE IF NOT EXISTS) is written in the exchange's transaction,
its spilled values registered in blob_refs, and purged with the exchange.
The full-text index covers the originals only. Logs of a rewritten flow
name the host, the step or error class and the rule ids, never the URL or
the error text. A rewritten request's transport error never switches its
host to passthrough. traffic_get shows the rewritten flag and rule ids.
Without a rule that applies, what is recorded is unchanged byte for byte.
The request phase can fail after the engine is done: the rewritten request
does not reach the target. NoteError records that as the rule's last error,
under the new class transport_error.
A handler that installs its own MaxBytesReader and then calls decode lost the 413: decode converted the error to a plain one and the middleware's limitedBody had been replaced. Return the original *http.MaxBytesError and update the cap test to errors.As.
A task already inside the wrap-up reserve only has that reserve left. The worker estimate starts from the defaults because usage rows have no run boundary.
The listener closes before Wait, and a shutdown refuses new task operations. Wait also stays until detached runs finish. The activity insert and the outbox delete commit together, and a row that keeps failing is dropped after five attempts so it cannot block the rest.
The outbox migration is 0006 because 0005 is already traffic rewrite rules. A shutdown cancel leaves an in-flight intent claim running, so the next start can reset it to open instead of recording the interrupt as done or blocked.