core-agent-ide/codex-rs/state
Charley Cunningham ebbbc52ce4
Align SQLite feedback logs with feedback formatter (#13494)
## Summary
- store a pre-rendered `feedback_log_body` in SQLite so `/feedback`
exports keep span prefixes and structured event fields
- render SQLite feedback exports with timestamps and level prefixes to
match the old in-memory feedback formatter, while preserving existing
trailing newlines
- count `feedback_log_body` in the SQLite retention budget so structured
or span-prefixed rows still prune correctly
- bound `/feedback` row loading in SQL with the retention estimate, then
apply exact whole-line truncation in Rust so uploads stay capped without
splitting lines

## Details
- add a `feedback_log_body` column to `logs` and backfill it from
`message` for existing rows
- capture span names plus formatted span and event fields at write time,
since SQLite does not retain enough structure to reconstruct the old
formatter later
- keep SQLite feedback queries scoped to the requested thread plus
same-process threadless rows
- restore a SQL-side cumulative `estimated_bytes` cap for feedback
export queries so over-retained partitions do not load every matching
row before truncation
- add focused formatting coverage for exported feedback lines and parity
coverage against `tracing_subscriber`

## Testing
- cargo test -p codex-state
- just fix -p codex-state
- just fmt

codex author: `codex resume 019ca1b0-0ecc-78b1-85eb-6befdd7e4f1f`

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-18 22:44:31 +00:00
..
logs_migrations Align SQLite feedback logs with feedback formatter (#13494) 2026-03-18 22:44:31 +00:00
migrations Feat: CXA-1831 Persist latest model and reasoning effort in sqlite (#14859) 2026-03-17 10:14:34 -07:00
src Align SQLite feedback logs with feedback formatter (#13494) 2026-03-18 22:44:31 +00:00
BUILD.bazel fix bazel build (#13787) 2026-03-06 12:12:20 -08:00
Cargo.toml feat: simplify DB further (#13771) 2026-03-07 03:48:36 -08:00