initial surface projection for sandbox

This commit is contained in:
Roy Han
2026-03-11 12:07:33 -07:00
parent f5bb338fdb
commit 79d8f99a7f
13 changed files with 297 additions and 27 deletions

View File

@@ -88,10 +88,13 @@ async fn auto_compaction_local_emits_started_and_completed_items() -> Result<()>
let started = wait_for_context_compaction_started(&mut mcp).await?;
let completed = wait_for_context_compaction_completed(&mut mcp).await?;
let ThreadItem::ContextCompaction { id: started_id } = started.item else {
let ThreadItem::ContextCompaction { id: started_id, .. } = started.item else {
unreachable!("started item should be context compaction");
};
let ThreadItem::ContextCompaction { id: completed_id } = completed.item else {
let ThreadItem::ContextCompaction {
id: completed_id, ..
} = completed.item
else {
unreachable!("completed item should be context compaction");
};
@@ -177,10 +180,13 @@ async fn auto_compaction_remote_emits_started_and_completed_items() -> Result<()
let started = wait_for_context_compaction_started(&mut mcp).await?;
let completed = wait_for_context_compaction_completed(&mut mcp).await?;
let ThreadItem::ContextCompaction { id: started_id } = started.item else {
let ThreadItem::ContextCompaction { id: started_id, .. } = started.item else {
unreachable!("started item should be context compaction");
};
let ThreadItem::ContextCompaction { id: completed_id } = completed.item else {
let ThreadItem::ContextCompaction {
id: completed_id, ..
} = completed.item
else {
unreachable!("completed item should be context compaction");
};
@@ -240,10 +246,13 @@ async fn thread_compact_start_triggers_compaction_and_returns_empty_response() -
let started = wait_for_context_compaction_started(&mut mcp).await?;
let completed = wait_for_context_compaction_completed(&mut mcp).await?;
let ThreadItem::ContextCompaction { id: started_id } = started.item else {
let ThreadItem::ContextCompaction { id: started_id, .. } = started.item else {
unreachable!("started item should be context compaction");
};
let ThreadItem::ContextCompaction { id: completed_id } = completed.item else {
let ThreadItem::ContextCompaction {
id: completed_id, ..
} = completed.item
else {
unreachable!("completed item should be context compaction");
};

View File

@@ -200,6 +200,7 @@ async fn dynamic_tool_call_round_trip_sends_text_content_items_to_model() -> Res
content_items,
success,
duration_ms,
..
} = started.item
else {
panic!("expected dynamic tool call item");
@@ -253,6 +254,7 @@ async fn dynamic_tool_call_round_trip_sends_text_content_items_to_model() -> Res
content_items,
success,
duration_ms,
..
} = completed.item
else {
panic!("expected dynamic tool call item");

View File

@@ -67,6 +67,7 @@ async fn plan_mode_uses_proposed_plan_block_for_plan_item() -> Result<()> {
let expected_plan = ThreadItem::Plan {
id: format!("{}-plan", turn.id),
text: "# Final plan\n- first\n- second\n".to_string(),
metadata: None,
};
let expected_plan_id = format!("{}-plan", turn.id);
let streamed_plan = plan_deltas

View File

@@ -97,7 +97,7 @@ async fn review_start_runs_review_turn_and_emits_code_review_item() -> Result<()
let started: ItemStartedNotification =
serde_json::from_value(item_started.params.expect("params must be present"))?;
match started.item {
ThreadItem::EnteredReviewMode { id, review } => {
ThreadItem::EnteredReviewMode { id, review, .. } => {
assert_eq!(id, turn_id);
assert_eq!(review, "commit 1234567: Tidy UI colors");
saw_entered_review_mode = true;
@@ -123,7 +123,7 @@ async fn review_start_runs_review_turn_and_emits_code_review_item() -> Result<()
let completed: ItemCompletedNotification =
serde_json::from_value(review_notif.params.expect("params must be present"))?;
match completed.item {
ThreadItem::ExitedReviewMode { id, review } => {
ThreadItem::ExitedReviewMode { id, review, .. } => {
assert_eq!(id, turn_id);
review_body = Some(review);
break;

View File

@@ -1238,6 +1238,7 @@ async fn thread_resume_replays_pending_file_change_request_approval() -> Result<
diff: "new line\n".to_string(),
}],
status: PatchApplyStatus::InProgress,
metadata: None,
};
assert_eq!(original_started, expected_file_change);

View File

@@ -1548,6 +1548,7 @@ async fn turn_start_file_change_approval_v2() -> Result<()> {
ref id,
status,
ref changes,
..
} = started_file_change
else {
unreachable!("loop ensures we break on file change items");
@@ -1928,6 +1929,7 @@ async fn turn_start_file_change_approval_decline_v2() -> Result<()> {
ref id,
status,
ref changes,
..
} = started_file_change
else {
unreachable!("loop ensures we break on file change items");