mirror of
https://github.com/openai/codex.git
synced 2026-11-03 08:22:30 +00:00
feat: async shell snapshot (#9600)
This commit is contained in:
1 parent
16b9380e99
commit
b75024c465
8 files changed
+113
-68
No files matched your search
@@ -723,18 +723,12 @@ impl Session {
|
||||
let mut default_shell = shell::default_user_shell();
|
||||
// Create the mutable state for the Session.
|
||||
if config.features.enabled(Feature::ShellSnapshot) {
|
||||
let timer = otel_manager.start_timer("codex.shell_snapshot.duration_ms", &[]);
|
||||
default_shell.shell_snapshot =
|
||||
ShellSnapshot::try_new(&config.codex_home, conversation_id, &default_shell)
|
||||
.await
|
||||
.map(Arc::new);
|
||||
let success = if default_shell.shell_snapshot.is_some() {
|
||||
"true"
|
||||
} else {
|
||||
"false"
|
||||
};
|
||||
let _ = timer.map(|timer| timer.record(&[("success", success)]));
|
||||
otel_manager.counter("codex.shell_snapshot", 1, &[("success", success)])
|
||||
ShellSnapshot::start_snapshotting(
|
||||
config.codex_home.clone(),
|
||||
conversation_id,
|
||||
&mut default_shell,
|
||||
otel_manager.clone(),
|
||||
);
|
||||
}
|
||||
let state = SessionState::new(session_configuration.clone());
|
||||
|
||||
|
||||
Reference in new issue
Block a user