Skip to content

Commit c798241

Browse files
committed
Finalize fork fixes for v0.144.3
1 parent 7188da2 commit c798241

42 files changed

Lines changed: 256 additions & 205 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎codex-rs/Cargo.lock‎

Lines changed: 136 additions & 136 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎codex-rs/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ members = [
134134
resolver = "2"
135135

136136
[workspace.package]
137-
version = "0.144.2"
137+
version = "0.144.3"
138138
# Track the edition for all workspace crates in one place. Individual
139139
# crates can still override this value, but keeping it here means new
140140
# crates created with `cargo new -w ...` automatically inherit the 2024

‎codex-rs/cli/src/main.rs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ type HostSandboxArgs = UnsupportedSandboxArgs;
440440
#[derive(Debug, Parser)]
441441
struct UnsupportedSandboxArgs {
442442
/// Layer $CODEX_HOME/<name>.config.toml on top of the base user config.
443-
#[arg(long = "profile", short = 'p')]
443+
#[arg(long = "profile", alias = "profile-v2", short = 'p')]
444444
pub config_profile: Option<ProfileV2Name>,
445445

446446
#[clap(skip)]
@@ -2927,6 +2927,16 @@ mod tests {
29272927
);
29282928
}
29292929

2930+
#[test]
2931+
fn profile_v2_alias_remains_accepted() {
2932+
assert_eq!(
2933+
profile_v2_for_args(&["codex", "--profile-v2", "work", "resume"])
2934+
.expect("legacy profile-v2 alias should parse")
2935+
.as_deref(),
2936+
Some("work")
2937+
);
2938+
}
2939+
29302940
#[test]
29312941
fn root_initial_goal_prompt_parses_as_interactive_option() {
29322942
let cli = MultitoolCli::try_parse_from([

‎codex-rs/core/src/session/rollout_reconstruction_tests.rs‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,8 @@ async fn reconstruct_history_rollback_counts_typed_inter_agent_metadata_turns()
815815
codex_protocol::protocol::TurnCompleteEvent {
816816
turn_id: first_turn_id,
817817
last_agent_message: None,
818+
error: None,
819+
started_at: None,
818820
completed_at: None,
819821
duration_ms: None,
820822
time_to_first_token_ms: None,
@@ -838,6 +840,8 @@ async fn reconstruct_history_rollback_counts_typed_inter_agent_metadata_turns()
838840
codex_protocol::protocol::TurnCompleteEvent {
839841
turn_id: assistant_turn_id,
840842
last_agent_message: None,
843+
error: None,
844+
started_at: None,
841845
completed_at: None,
842846
duration_ms: None,
843847
time_to_first_token_ms: None,
@@ -1140,6 +1144,8 @@ async fn reconstruct_history_rollback_after_compaction_drops_latest_user_turn_an
11401144
codex_protocol::protocol::TurnCompleteEvent {
11411145
turn_id: first_turn_id,
11421146
last_agent_message: None,
1147+
error: None,
1148+
started_at: None,
11431149
completed_at: None,
11441150
duration_ms: None,
11451151
time_to_first_token_ms: None,
@@ -1174,6 +1180,8 @@ async fn reconstruct_history_rollback_after_compaction_drops_latest_user_turn_an
11741180
codex_protocol::protocol::TurnCompleteEvent {
11751181
turn_id: second_turn_id,
11761182
last_agent_message: None,
1183+
error: None,
1184+
started_at: None,
11771185
completed_at: None,
11781186
duration_ms: None,
11791187
time_to_first_token_ms: None,
@@ -1200,6 +1208,8 @@ async fn reconstruct_history_rollback_after_compaction_drops_latest_user_turn_an
12001208
codex_protocol::protocol::TurnCompleteEvent {
12011209
turn_id: compact_turn_id,
12021210
last_agent_message: None,
1211+
error: None,
1212+
started_at: None,
12031213
completed_at: None,
12041214
duration_ms: None,
12051215
time_to_first_token_ms: None,
@@ -1262,6 +1272,8 @@ async fn reconstruct_history_rollback_after_compaction_trims_compacted_history()
12621272
codex_protocol::protocol::TurnCompleteEvent {
12631273
turn_id: compact_turn_id,
12641274
last_agent_message: None,
1275+
error: None,
1276+
started_at: None,
12651277
completed_at: None,
12661278
duration_ms: None,
12671279
time_to_first_token_ms: None,
@@ -1321,6 +1333,8 @@ async fn reconstruct_rollback_counts_raw_turns_before_trimming_compaction() {
13211333
codex_protocol::protocol::TurnCompleteEvent {
13221334
turn_id: compact_turn_id,
13231335
last_agent_message: None,
1336+
error: None,
1337+
started_at: None,
13241338
completed_at: None,
13251339
duration_ms: None,
13261340
time_to_first_token_ms: None,
@@ -1341,6 +1355,8 @@ async fn reconstruct_rollback_counts_raw_turns_before_trimming_compaction() {
13411355
codex_protocol::protocol::TurnCompleteEvent {
13421356
turn_id: raw_turn_id,
13431357
last_agent_message: None,
1358+
error: None,
1359+
started_at: None,
13441360
completed_at: None,
13451361
duration_ms: None,
13461362
time_to_first_token_ms: None,

‎codex-rs/core/tests/suite/stream_no_completed.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ async fn stalled_stream_retries_after_idle_timeout() {
235235
}
236236

237237
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
238-
async fn connection_failure_pauses_retry_budget_until_provider_is_reachable() -> anyhow::Result<()> {
238+
async fn connection_failure_pauses_retry_budget_until_provider_is_reachable() -> anyhow::Result<()>
239+
{
239240
skip_if_no_network!(Ok(()));
240241

241242
let bootstrap_server = responses::start_mock_server().await;

‎codex-rs/tui/src/app/event_dispatch.rs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ impl App {
112112
self.undo_last_turn();
113113
tui.frame_requester().schedule_frame();
114114
}
115-
AppEvent::ExportTranscript => {
116-
self.export_transcript_to_markdown();
117-
tui.frame_requester().schedule_frame();
118-
}
119115
AppEvent::ImportTranscript { path } => {
120116
self.import_transcript_from_markdown(tui, &path);
121117
tui.frame_requester().schedule_frame();

‎codex-rs/tui/src/app/transcript_import.rs‎

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ use super::*;
22
use crate::history_cell::AgentMarkdownCell;
33
use crate::history_cell::HistoryCell;
44
use crate::history_cell::PlainHistoryCell;
5+
use crate::history_cell::ReasoningSummaryCell;
56
use crate::history_cell::UserHistoryCell;
7+
use crate::history_cell::new_proposed_plan;
68
use crate::history_cell::raw_lines_from_source;
79
use std::path::Path;
810
use std::path::PathBuf;
@@ -14,8 +16,10 @@ const SECTION_MARKER_SUFFIX: &str = "-->";
1416
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1517
enum ImportSectionKind {
1618
User,
17-
Codex,
18-
Event,
19+
Assistant,
20+
Plan,
21+
Reasoning,
22+
Activity,
1923
}
2024

2125
#[derive(Debug)]
@@ -115,16 +119,30 @@ fn imported_section_cell(section: ImportSection, cwd: &Path) -> Arc<dyn HistoryC
115119
local_image_paths: Vec::new(),
116120
remote_image_urls: Vec::new(),
117121
}),
118-
ImportSectionKind::Codex => Arc::new(AgentMarkdownCell::new(section.body, cwd)),
119-
ImportSectionKind::Event => {
122+
ImportSectionKind::Assistant => Arc::new(
123+
AgentMarkdownCell::new_with_inline_visualizations(section.body, cwd, None),
124+
),
125+
ImportSectionKind::Plan => Arc::new(new_proposed_plan(section.body, cwd)),
126+
ImportSectionKind::Reasoning => Arc::new(ReasoningSummaryCell::new(
127+
"Reasoning".to_string(),
128+
section.body,
129+
cwd,
130+
/*transcript_only*/ false,
131+
)),
132+
ImportSectionKind::Activity => {
120133
Arc::new(PlainHistoryCell::new(raw_lines_from_source(&section.body)))
121134
}
122135
}
123136
}
124137

125138
fn parse_exported_transcript(markdown: &str) -> Result<Vec<ImportSection>, String> {
126139
let body = markdown.strip_prefix('\u{feff}').unwrap_or(markdown);
127-
let Some(after_header) = body.strip_prefix(super::transcript_export::EXPORT_HEADER) else {
140+
let Some(after_header) = [
141+
"# Codex conversation",
142+
super::transcript_export::EXPORT_HEADER,
143+
]
144+
.iter()
145+
.find_map(|header| body.strip_prefix(header)) else {
128146
return Err("file is not a Codex chat export".to_string());
129147
};
130148

@@ -231,8 +249,10 @@ fn section_kind_from_heading(line: &str) -> Option<ImportSectionKind> {
231249
fn section_kind_from_name(name: &str) -> Option<ImportSectionKind> {
232250
match name {
233251
"User" => Some(ImportSectionKind::User),
234-
"Codex" => Some(ImportSectionKind::Codex),
235-
"Event" => Some(ImportSectionKind::Event),
252+
"Assistant" | "Codex" => Some(ImportSectionKind::Assistant),
253+
"Plan" => Some(ImportSectionKind::Plan),
254+
"Reasoning" => Some(ImportSectionKind::Reasoning),
255+
"Activity" | "Event" => Some(ImportSectionKind::Activity),
236256
_ => None,
237257
}
238258
}

‎codex-rs/tui/src/app/transcript_import_tests.rs‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn parses_marked_export_without_splitting_markdown_headings() {
2323
.collect::<Vec<_>>(),
2424
vec![
2525
(ImportSectionKind::User, "hello"),
26-
(ImportSectionKind::Codex, "## Assistant heading\n\nbody"),
26+
(ImportSectionKind::Assistant, "## Assistant heading\n\nbody"),
2727
]
2828
);
2929
}
@@ -41,7 +41,35 @@ fn parses_legacy_heading_export() {
4141
.collect::<Vec<_>>(),
4242
vec![
4343
(ImportSectionKind::User, "hello"),
44-
(ImportSectionKind::Codex, "hey"),
44+
(ImportSectionKind::Assistant, "hey"),
45+
]
46+
);
47+
}
48+
49+
#[test]
50+
fn parses_current_export_headings() {
51+
let markdown = concat!(
52+
"# Codex conversation\n\n",
53+
"## User\n\nhello\n\n",
54+
"## Assistant\n\nresponse\n\n",
55+
"## Plan\n\nstep\n\n",
56+
"## Reasoning\n\nthought\n\n",
57+
"## Activity\n\n file changed\n",
58+
);
59+
60+
let sections = parse_exported_transcript(markdown).expect("valid export");
61+
62+
assert_eq!(
63+
sections
64+
.iter()
65+
.map(|section| (section.kind, section.body.as_str()))
66+
.collect::<Vec<_>>(),
67+
vec![
68+
(ImportSectionKind::User, "hello"),
69+
(ImportSectionKind::Assistant, "response"),
70+
(ImportSectionKind::Plan, "step"),
71+
(ImportSectionKind::Reasoning, "thought"),
72+
(ImportSectionKind::Activity, " file changed"),
4573
]
4674
);
4775
}

‎codex-rs/tui/src/app_backtrack.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl App {
219219
return;
220220
};
221221
let Some(nth_user_message) = user_count(&self.transcript_cells).checked_sub(1) else {
222-
self.app_event_tx.send(AppEvent::NewSession);
222+
self.app_event_tx.send(AppEvent::NewSession { name: None });
223223
return;
224224
};
225225

‎codex-rs/tui/src/app_event.rs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ pub(crate) enum AppEvent {
329329
/// Roll back the latest user turn, or start a new session when there is no turn to undo.
330330
UndoLastTurn,
331331

332-
/// Export the visible transcript to a markdown file in the current working directory.
333-
ExportTranscript,
334-
335332
/// Import a markdown transcript previously written by `/export`.
336333
ImportTranscript {
337334
path: String,

0 commit comments

Comments
 (0)