-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Extract rollout into its own crate #15548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
94b0e35
Move string truncation helpers into codex-utils-string
aibrahim-oai b24d7f3
Extract rollout into its own crate
aibrahim-oai 6623c52
codex: fix CI failure on PR #15548
aibrahim-oai 0c2b689
codex: fix CI failure on PR #15548
aibrahim-oai df2fb2b
fix
aibrahim-oai cd07c48
Keep truncate_tests module rename
aibrahim-oai 6e52dee
Merge origin/main into codex/extract-rollout-recorder-crate
aibrahim-oai 51be026
fix
aibrahim-oai d70dfd7
fix
aibrahim-oai 7d1a4bd
fix
aibrahim-oai 1bbd4bd
fix
aibrahim-oai f87f78e
Merge branch 'main' into codex/extract-rollout-recorder-crate
aibrahim-oai e10b310
Remove unrelated PR cleanup changes
aibrahim-oai 47b533a
Revert unrelated tui auth changes
aibrahim-oai bd4e057
feedback
aibrahim-oai c0d34c8
init
aibrahim-oai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| use crate::config::Config; | ||
| pub use codex_rollout::ARCHIVED_SESSIONS_SUBDIR; | ||
| pub use codex_rollout::INTERACTIVE_SESSION_SOURCES; | ||
| pub use codex_rollout::RolloutRecorder; | ||
| pub use codex_rollout::RolloutRecorderParams; | ||
| pub use codex_rollout::SESSIONS_SUBDIR; | ||
| pub use codex_rollout::SessionMeta; | ||
| pub use codex_rollout::append_thread_name; | ||
| pub use codex_rollout::find_archived_thread_path_by_id_str; | ||
| #[deprecated(note = "use find_thread_path_by_id_str")] | ||
| pub use codex_rollout::find_conversation_path_by_id_str; | ||
| pub use codex_rollout::find_thread_name_by_id; | ||
| pub use codex_rollout::find_thread_path_by_id_str; | ||
| pub use codex_rollout::find_thread_path_by_name_str; | ||
| pub use codex_rollout::rollout_date_parts; | ||
|
|
||
| impl codex_rollout::RolloutConfigView for Config { | ||
|
aibrahim-oai marked this conversation as resolved.
|
||
| fn codex_home(&self) -> &std::path::Path { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Separately, we should be moving all of these things to |
||
| self.codex_home.as_path() | ||
| } | ||
|
|
||
| fn sqlite_home(&self) -> &std::path::Path { | ||
| self.sqlite_home.as_path() | ||
| } | ||
|
|
||
| fn cwd(&self) -> &std::path::Path { | ||
| self.cwd.as_path() | ||
| } | ||
|
|
||
| fn model_provider_id(&self) -> &str { | ||
| self.model_provider_id.as_str() | ||
| } | ||
|
|
||
| fn generate_memories(&self) -> bool { | ||
| self.memories.generate_memories | ||
| } | ||
| } | ||
|
|
||
| pub mod list { | ||
| pub use codex_rollout::list::*; | ||
| } | ||
|
|
||
| pub(crate) mod metadata { | ||
| pub(crate) use codex_rollout::metadata::builder_from_items; | ||
| } | ||
|
|
||
| pub mod policy { | ||
| pub use codex_rollout::policy::*; | ||
| } | ||
|
|
||
| pub mod recorder { | ||
| pub use codex_rollout::recorder::*; | ||
| } | ||
|
|
||
| pub mod session_index { | ||
| pub use codex_rollout::session_index::*; | ||
| } | ||
|
|
||
| pub(crate) use crate::session_rollout_init_error::map_session_init_error; | ||
|
|
||
| pub(crate) mod truncation { | ||
| pub(crate) use crate::thread_rollout_truncation::*; | ||
| } | ||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| use codex_rollout::state_db as rollout_state_db; | ||
| pub use codex_rollout::state_db::StateDbHandle; | ||
| pub use codex_rollout::state_db::apply_rollout_items; | ||
| pub use codex_rollout::state_db::find_rollout_path_by_id; | ||
| pub use codex_rollout::state_db::get_dynamic_tools; | ||
| pub use codex_rollout::state_db::list_thread_ids_db; | ||
| pub use codex_rollout::state_db::list_threads_db; | ||
| pub use codex_rollout::state_db::mark_thread_memory_mode_polluted; | ||
| pub use codex_rollout::state_db::normalize_cwd_for_state_db; | ||
| pub use codex_rollout::state_db::open_if_present; | ||
| pub use codex_rollout::state_db::persist_dynamic_tools; | ||
| pub use codex_rollout::state_db::read_repair_rollout_path; | ||
| pub use codex_rollout::state_db::reconcile_rollout; | ||
| pub use codex_rollout::state_db::touch_thread_updated_at; | ||
| pub use codex_state::LogEntry; | ||
|
|
||
| use crate::config::Config; | ||
|
|
||
| pub async fn get_state_db(config: &Config) -> Option<StateDbHandle> { | ||
| rollout_state_db::get_state_db(config).await | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| pub mod path_utils; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| pub use codex_utils_path::*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| load("//:defs.bzl", "codex_rust_crate") | ||
|
|
||
| codex_rust_crate( | ||
| name = "rollout", | ||
| crate_name = "codex_rollout", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| [package] | ||
| edition.workspace = true | ||
| license.workspace = true | ||
| name = "codex-rollout" | ||
| version.workspace = true | ||
|
|
||
| [lib] | ||
| doctest = false | ||
| name = "codex_rollout" | ||
| path = "src/lib.rs" | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [dependencies] | ||
| anyhow = { workspace = true } | ||
| async-trait = { workspace = true } | ||
| chrono = { workspace = true, features = ["serde"] } | ||
| codex-file-search = { workspace = true } | ||
| codex-git-utils = { workspace = true } | ||
| codex-login = { workspace = true } | ||
| codex-otel = { workspace = true } | ||
| codex-protocol = { workspace = true } | ||
| codex-state = { workspace = true } | ||
| codex-utils-path = { workspace = true } | ||
| codex-utils-string = { workspace = true } | ||
| serde = { workspace = true, features = ["derive"] } | ||
| serde_json = { workspace = true } | ||
| time = { workspace = true, features = [ | ||
| "formatting", | ||
| "local-offset", | ||
| "macros", | ||
| "parsing", | ||
| ] } | ||
| tokio = { workspace = true, features = [ | ||
| "fs", | ||
| "io-util", | ||
| "macros", | ||
| "process", | ||
| "rt", | ||
| "sync", | ||
| "time", | ||
| ] } | ||
| tracing = { workspace = true } | ||
| uuid = { workspace = true } | ||
|
|
||
| [dev-dependencies] | ||
| pretty_assertions = { workspace = true } | ||
| tempfile = { workspace = true } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relatedly, will all these re-exports get removed in a mechanical follow-up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes