Skip to content

[codex] Soften SQLite metadata sync failures#22899

Merged
wiltzius-openai merged 3 commits into
mainfrom
wiltzius/codex/thread-store-sqlite-soft-fail
May 15, 2026
Merged

[codex] Soften SQLite metadata sync failures#22899
wiltzius-openai merged 3 commits into
mainfrom
wiltzius/codex/thread-store-sqlite-soft-fail

Conversation

@wiltzius-openai
Copy link
Copy Markdown
Contributor

@wiltzius-openai wiltzius-openai commented May 15, 2026

Summary

  • keep transcript-derived local thread metadata SQLite failures best-effort
  • preserve hard failures for explicit git-only metadata updates that still require SQLite state
  • add regression coverage for the soft-vs-hard metadata update policy

Root cause

The live thread metadata sync introduced after v0.131.0-alpha.8 moved append-derived metadata writes above the rollout writer. Those SQLite writes now propagated through the live thread flush path, so a corrupted optional state DB could surface as a transcript persistence warning even when JSONL writes still succeeded.

The hard failures were introduced in #22236

@wiltzius-openai
Copy link
Copy Markdown
Contributor Author

@codex review

}

fn sqlite_write_failure_should_block(patch: &ThreadMetadataPatch) -> bool {
// Before live metadata sync moved above the rollout writer, SQLite sync failures for
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this sucks, but appears to be how the previous code worked? @owenlin0 does this seem correct to you (sqlite is required for app server metadata updates but not implicit metadata updates from core)?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yeah, i guess so. this has been ~rare (and I haven't encountered it personally) but sounds right to me

Copy link
Copy Markdown
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: 2015820064

ℹ️ 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".

Comment thread codex-rs/thread-store/src/local/update_thread_metadata.rs
@wiltzius-openai wiltzius-openai marked this pull request as ready for review May 15, 2026 21:08
@bolinfest
Copy link
Copy Markdown
Collaborator

@wiltzius-openai if it's not too much trouble, can you link the PR that introduced the change in the PR body?

@bolinfest bolinfest requested a review from owenlin0 May 15, 2026 21:10
@wiltzius-openai
Copy link
Copy Markdown
Contributor Author

@wiltzius-openai if it's not too much trouble, can you link the PR that introduced the change in the PR body?

done!

@wiltzius-openai wiltzius-openai enabled auto-merge (squash) May 15, 2026 21:30
@wiltzius-openai wiltzius-openai merged commit 249d50a into main May 15, 2026
31 checks passed
@wiltzius-openai wiltzius-openai deleted the wiltzius/codex/thread-store-sqlite-soft-fail branch May 15, 2026 21:37
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 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.

3 participants