Skip to content

[codex] Remove redundant SQLite dynamic tool storage#24819

Merged
sayan-oai merged 3 commits into
mainfrom
dev/sayan/remove-thread-dynamic-tools-state
May 28, 2026
Merged

[codex] Remove redundant SQLite dynamic tool storage#24819
sayan-oai merged 3 commits into
mainfrom
dev/sayan/remove-thread-dynamic-tools-state

Conversation

@sayan-oai
Copy link
Copy Markdown
Collaborator

@sayan-oai sayan-oai commented May 27, 2026

Why

Dynamic tools are defined at thread start and already stored in rollout SessionMeta, which restores resumed and forked sessions. Persisting the same tools through SQLite creates a second runtime persistence path that is unnecessary prework for the explicit namespace refactor.

What changed

  • Restore missing thread-start dynamic tools directly from rollout history, including when SQLite is enabled.
  • Remove SQLite dynamic-tool reads, writes, backfill, and thread metadata patch plumbing.
  • Add SQLite-enabled resume integration coverage that verifies a rollout-defined dynamic tool is still sent after resume.

Compatibility

The existing thread_dynamic_tools table is intentionally not dropped even though it's now unused. Older Codex binaries are allowed to open databases migrated by newer binaries and still reference this table; dropping it would break that mixed-version path. See here.

Verification

  • just test -p codex-state -p codex-rollout -p codex-thread-store
  • just test -p codex-core --test all resume_restores_dynamic_tools_from_rollout_with_sqlite_enabled

@sayan-oai sayan-oai marked this pull request as ready for review May 27, 2026 21:40
@sayan-oai sayan-oai requested a review from a team as a code owner May 27, 2026 21:40
@sayan-oai
Copy link
Copy Markdown
Collaborator Author

@codex review this

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: 3dd599cb93

ℹ️ 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/state/migrations/0036_drop_thread_dynamic_tools.sql Outdated
@sayan-oai sayan-oai merged commit 304d15c into main May 28, 2026
45 of 47 checks passed
@sayan-oai sayan-oai deleted the dev/sayan/remove-thread-dynamic-tools-state branch May 28, 2026 00:57
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 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