test(app-server): annotate inbox resume literals

This commit is contained in:
Friel
2026-03-28 11:56:40 -07:00
parent ebc45db194
commit 73418e2882
2 changed files with 28 additions and 11 deletions

View File

@@ -145,7 +145,7 @@ async fn thread_resume_returns_rollout_history() -> Result<()> {
.map(|elem| serde_json::to_value(elem).expect("serialize text element"))
.collect(),
Some("mock_provider"),
None,
/*git_info*/ None,
)?;
let mut mcp = McpProcess::new(codex_home.path()).await?;
@@ -342,7 +342,9 @@ stream_max_retries = 0
)?;
let state_db =
StateRuntime::init(codex_home.path().to_path_buf(), "mock_provider".into()).await?;
state_db.mark_backfill_complete(None).await?;
state_db
.mark_backfill_complete(/*last_watermark*/ None)
.await?;
let mut mcp = McpProcess::new(codex_home.path()).await?;
timeout(DEFAULT_READ_TIMEOUT, mcp.initialize()).await??;
@@ -403,7 +405,7 @@ async fn thread_resume_and_read_interrupt_incomplete_rollout_turn_when_thread_is
"Saved user message",
Vec::new(),
Some("mock_provider"),
None,
/*git_info*/ None,
)?;
let rollout_file_path = rollout_path(codex_home.path(), filename_ts, &conversation_id);
let persisted_rollout = std::fs::read_to_string(&rollout_file_path)?;
@@ -990,7 +992,12 @@ async fn thread_resume_rejoins_running_thread_even_with_override_mismatch() -> R
async fn thread_resume_replays_pending_command_execution_request_approval() -> Result<()> {
let responses = vec![
create_final_assistant_message_sse_response("seeded")?,
create_shell_command_sse_response(fast_shell_command(), None, Some(1000), "call-1")?,
create_shell_command_sse_response(
fast_shell_command(),
/*workdir*/ None,
Some(1000),
"call-1",
)?,
create_final_assistant_message_sse_response("done")?,
];
let server = create_mock_responses_server_sequence_unchecked(responses).await;
@@ -1108,7 +1115,7 @@ async fn thread_resume_replays_pending_command_execution_request_approval() -> R
primary.read_stream_until_notification_message("turn/completed"),
)
.await??;
wait_for_mock_request_count(&server, 3).await?;
wait_for_mock_request_count(&server, /*expected*/ 3).await?;
Ok(())
}
@@ -1274,7 +1281,7 @@ async fn thread_resume_replays_pending_file_change_request_approval() -> Result<
primary.read_stream_until_notification_message("turn/completed"),
)
.await??;
wait_for_mock_request_count(&server, 3).await?;
wait_for_mock_request_count(&server, /*expected*/ 3).await?;
Ok(())
}
@@ -1469,7 +1476,7 @@ async fn thread_resume_surfaces_cloud_requirements_load_errors() -> Result<()> {
"Saved user message",
Vec::new(),
Some("mock_provider"),
None,
/*git_info*/ None,
)?;
let refresh_token_url = format!("{}/oauth/token", server.uri());
let mut mcp = McpProcess::new_with_env(
@@ -1937,7 +1944,7 @@ fn setup_rollout_fixture(codex_home: &Path, server_uri: &str) -> Result<RolloutF
preview,
Vec::new(),
Some("mock_provider"),
None,
/*git_info*/ None,
)?;
let rollout_file_path = rollout_path(codex_home, filename_ts, &conversation_id);
set_rollout_mtime(rollout_file_path.as_path(), expected_updated_at_rfc3339)?;

View File

@@ -888,7 +888,7 @@ async fn turn_start_uses_migrated_pragmatic_personality_without_override_v2() ->
"2025-01-01T00:00:00Z",
"history user message",
Some("mock_provider"),
None,
/*git_info*/ None,
)?;
let mut mcp = McpProcess::new(codex_home.path()).await?;
@@ -1025,9 +1025,19 @@ async fn turn_start_exec_approval_toggle_v2() -> Result<()> {
// Mock server: first turn requests a shell call (elicitation), then completes.
// Second turn same, but we'll set approval_policy=never to avoid elicitation.
let responses = vec![
create_shell_command_sse_response(fast_shell_command(), None, Some(1000), "call1")?,
create_shell_command_sse_response(
fast_shell_command(),
/*workdir*/ None,
Some(1000),
"call1",
)?,
create_final_assistant_message_sse_response("done 1")?,
create_shell_command_sse_response(fast_shell_command(), None, Some(1000), "call2")?,
create_shell_command_sse_response(
fast_shell_command(),
/*workdir*/ None,
Some(1000),
"call2",
)?,
create_final_assistant_message_sse_response("done 2")?,
];
let server = create_mock_responses_server_sequence(responses).await;