core-agent-ide/codex-rs/tui
Charley Cunningham c4bd0aa3b9
app-server: source /feedback logs from sqlite at trace level (#12969)
## Summary
- write app-server SQLite logs at TRACE level when SQLite is enabled
- source app-server `/feedback` log attachments from SQLite for the
requested thread when available
- flush buffered SQLite log writes before `/feedback` queries them so
newly emitted events are not lost behind the async inserter
- include same-process threadless SQLite rows in those `/feedback` logs
so the attachment matches the process-wide feedback buffer more closely
- keep the existing in-memory ring buffer fallback unchanged, including
when the SQLite query returns no rows

## Details
- add a byte-bounded `query_feedback_logs` helper in `codex-state` so
`/feedback` does not fetch all rows before truncating
- scope SQLite feedback logs to the requested thread plus threadless
rows from the same `process_uuid`
- format exported SQLite feedback lines with the log level prefix to
better match the in-memory feedback formatter
- add an explicit `LogDbLayer::flush()` control path and await it in
app-server before querying SQLite for feedback logs
- pass optional SQLite log bytes through `codex-feedback` as the
`codex-logs.log` attachment override
- leave TUI behavior unchanged apart from the updated `upload_feedback`
call signature
- add regression coverage for:
  - newest-within-budget ordering
  - excluding oversized newest rows
  - including same-process threadless rows
  - keeping the newest suffix across mixed thread and threadless rows
  - matching the feedback formatter shape aside from span prefixes
  - falling back to the in-memory snapshot when SQLite returns no logs
  - flushing buffered SQLite rows before querying

## Follow-up
- SQLite feedback exports still do not reproduce span prefixes like
`feedback-thread{thread_id=...}:`; there is a `TODO(ccunningham)` in
`codex-rs/state/src/log_db.rs` for that follow-up.

## Testing
- `cd codex-rs && cargo test -p codex-state`
- `cd codex-rs && cargo test -p codex-app-server`
- `cd codex-rs && just fmt`
2026-03-03 11:17:06 -08:00
..
frames Login flow polish (#3632) 2025-09-15 00:42:53 -07:00
src app-server: source /feedback logs from sqlite at trace level (#12969) 2026-03-03 11:17:06 -08:00
tests fix: package models.json for Bazel tests (#13129) 2026-02-28 17:21:02 +01:00
BUILD.bazel fix: package models.json for Bazel tests (#13129) 2026-02-28 17:21:02 +01:00
Cargo.toml tui: restore visible line numbers for hidden file links (#12870) 2026-02-26 10:29:54 +00:00
prompt_for_init_command.md chore: rename INIT.md to prompt_for_init_command.md and move closer to usage (#1886) 2025-08-06 11:58:57 -07:00
styles.md fix: stop using ANSI blue (#2421) 2025-08-18 16:02:25 +00:00
tooltips.txt Add /statusline tooltip entry (#12005) 2026-02-17 18:04:33 +00:00