mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
V5
This commit is contained in:
@@ -2331,9 +2331,9 @@ async fn handle_response_item(
|
||||
input,
|
||||
call_id,
|
||||
)
|
||||
.await,
|
||||
.await,
|
||||
)
|
||||
},
|
||||
}
|
||||
ResponseItem::FunctionCallOutput { .. } => {
|
||||
debug!("unexpected FunctionCallOutput from stream");
|
||||
None
|
||||
|
||||
@@ -112,7 +112,6 @@ use codex_git_tooling::create_ghost_commit;
|
||||
use codex_git_tooling::restore_ghost_commit;
|
||||
use codex_utils_readiness::Readiness;
|
||||
use codex_utils_readiness::ReadinessFlag;
|
||||
use tokio::task::spawn_blocking;
|
||||
use tracing::warn;
|
||||
|
||||
const MAX_TRACKED_GHOST_COMMITS: usize = 20;
|
||||
@@ -1139,28 +1138,23 @@ impl ChatWidget {
|
||||
tokio::spawn(async move {
|
||||
let readiness_token = readiness_to_mark.subscribe().await.ok();
|
||||
if capture_snapshot {
|
||||
let event = match spawn_blocking(move || {
|
||||
let options = CreateGhostCommitOptions::new(repo_path.as_path());
|
||||
create_ghost_commit(&options)
|
||||
})
|
||||
.await
|
||||
{
|
||||
Ok(Ok(commit)) => {
|
||||
let event = match create_ghost_commit(&CreateGhostCommitOptions::new(
|
||||
repo_path.as_path(),
|
||||
)) {
|
||||
Ok(commit) => {
|
||||
AppEvent::GhostSnapshotResult(GhostSnapshotEvent::Success(commit))
|
||||
}
|
||||
Ok(Err(err)) => {
|
||||
Err(err) => {
|
||||
warn!("failed to create ghost snapshot: {err}");
|
||||
let (message, hint) = match &err {
|
||||
GitToolingError::NotAGitRepository { .. } => (
|
||||
"Snapshots disabled: current directory is not a Git repository."
|
||||
.to_string(),
|
||||
"Snapshots disabled: current directory is not a Git repository.".to_string(),
|
||||
None,
|
||||
),
|
||||
_ => (
|
||||
format!("Snapshots disabled after error: {err}"),
|
||||
Some(
|
||||
"Restart Codex after resolving the issue to re-enable snapshots."
|
||||
.to_string(),
|
||||
"Restart Codex after resolving the issue to re-enable snapshots.".to_string(),
|
||||
),
|
||||
),
|
||||
};
|
||||
@@ -1169,16 +1163,6 @@ impl ChatWidget {
|
||||
hint,
|
||||
})
|
||||
}
|
||||
Err(err) => {
|
||||
warn!("failed to join ghost snapshot task: {err}");
|
||||
AppEvent::GhostSnapshotResult(GhostSnapshotEvent::Disabled {
|
||||
message: format!("Snapshots disabled after internal error: {err}"),
|
||||
hint: Some(
|
||||
"Restart Codex after resolving the issue to re-enable snapshots."
|
||||
.to_string(),
|
||||
),
|
||||
})
|
||||
}
|
||||
};
|
||||
app_event_tx.send(event);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user