mirror of
https://github.com/openai/codex.git
synced 2026-11-23 07:17:11 +00:00
[codex] Remove redundant SQLite dynamic tool storage (#24819)
## 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](https://github.com/openai/codex/blob/main/codex-rs/state/src/migrations.rs#L10-L11). ## 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`
This commit is contained in:
1 parent
0db49a7e6a
commit
304d15cab0
9 files changed
+101
-260
No files matched your search
@@ -61,8 +61,6 @@ impl ThreadMetadataSync {
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let dynamic_tools =
|
||||
(!params.dynamic_tools.is_empty()).then(|| params.dynamic_tools.clone());
|
||||
let update = ThreadMetadataPatch {
|
||||
model_provider: Some(params.metadata.model_provider.clone()),
|
||||
created_at: Some(created_at),
|
||||
@@ -76,7 +74,6 @@ impl ThreadMetadataSync {
|
||||
cli_version: Some(env!("CARGO_PKG_VERSION").to_string()),
|
||||
git_info: git_info.map(git_info_patch_from_observation),
|
||||
memory_mode: Some(params.metadata.memory_mode),
|
||||
dynamic_tools,
|
||||
..Default::default()
|
||||
};
|
||||
Self {
|
||||
@@ -228,9 +225,6 @@ impl ThreadMetadataSync {
|
||||
{
|
||||
update.memory_mode = Some(memory_mode);
|
||||
}
|
||||
if let Some(dynamic_tools) = meta_line.meta.dynamic_tools.clone() {
|
||||
update.dynamic_tools = Some(dynamic_tools);
|
||||
}
|
||||
}
|
||||
RolloutItem::TurnContext(turn_ctx) => {
|
||||
if !self.cwd_seen && !turn_ctx.cwd.as_os_str().is_empty() {
|
||||
@@ -365,7 +359,6 @@ fn update_has_metadata_facts(update: &ThreadMetadataPatch) -> bool {
|
||||
|| update.first_user_message.is_some()
|
||||
|| update.git_info.is_some()
|
||||
|| update.memory_mode.is_some()
|
||||
|| update.dynamic_tools.is_some()
|
||||
}
|
||||
|
||||
fn git_info_patch_from_observation(git_info: GitInfo) -> GitInfoPatch {
|
||||
|
||||
Reference in new issue
Block a user