Skip to content

app-server: source /feedback logs from sqlite at trace level#12969

Merged
charley-oai merged 8 commits intomainfrom
cc/app-server-sqlite-feedback-trace
Mar 3, 2026
Merged

app-server: source /feedback logs from sqlite at trace level#12969
charley-oai merged 8 commits intomainfrom
cc/app-server-sqlite-feedback-trace

Conversation

@charley-oai
Copy link
Collaborator

@charley-oai charley-oai commented Feb 27, 2026

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

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e760e931d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7547a70a03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c7697dac8a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99acc8e854

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 491bb6d6af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai charley-oai force-pushed the cc/app-server-sqlite-feedback-trace branch from 36ddcf2 to 40b3561 Compare February 27, 2026 20:09
@charley-oai
Copy link
Collaborator Author

@codex review this

@charley-oai
Copy link
Collaborator Author

@codex I said review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai charley-oai merged commit c4bd0aa into main Mar 3, 2026
31 of 33 checks passed
@charley-oai charley-oai deleted the cc/app-server-sqlite-feedback-trace branch March 3, 2026 19:17
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants