Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .repository-projection.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"projection": "deixic-code",
"projectionSchemaVersion": 1,
"sourceRepository": "dx-corp/mono",
"sourceSha": "80416a066acccdb2394733a9db4adcae19d88f23",
"sourceSha": "d8306b05ea2444bec1b093cd59f640459ffffc66",
"destinationRepository": "dx-corp/code",
"priorProjectedBase": "cb29d92a07316cffe6bf950c4ad77b0ed7ee921b",
"priorProjectedBase": "0cb305ad096c8c2fb8190a07dd0a0754e19a7fe8",
"definitionDigest": "82936441c776e3e8edb5d215a75007ec9714a233f489d460075d79d5ef5ba32f",
"toolDigest": "ab19140af8e449c04288cb7c52e992982833e3882ddce59d22314d971feaf946",
"contentDigest": "5525064be7ac0064bf34bda4542c3731edd92950be4fd2addcfee4ede4e2f02e",
"contentDigest": "2ae3cdf620189fde5a33c386615c14e5d476c2cf1946a5332c3c64ee238584ea",
"publicationEligible": true
}
45 changes: 26 additions & 19 deletions packages/local-host-rs/src/agent/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ pub struct AgentHarness {
hook_log: PathBuf,
}

/// Upper bound for an event a test expects to arrive. `wait_for_event` returns
/// as soon as the event is observed, so this only bounds a failing test. The
/// previous 2-12 s limits expired on a loaded host during the full
/// maestro-local-host suite (9 of 3232 tests on dev-desktop, 2026-09-25) while
/// the same tests passed when run alone.
const EVENT_WAIT: Duration = Duration::from_secs(30);

impl AgentHarness {
/// Create a harness with a scripted client and hook logging enabled.
pub fn with_scripted(responses: Vec<ScriptedResponse>) -> anyhow::Result<Self> {
Expand Down Expand Up @@ -229,7 +236,7 @@ async fn scripted_stream_error_dispatches_stop_failure() {
.expect("prompt");

let saw_error = harness
.wait_for_event(Duration::from_secs(5), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(event, FromAgent::Error { terminal: true, .. })
})
.await;
Expand Down Expand Up @@ -291,7 +298,7 @@ async fn scripted_provider_error_preserves_kind_and_never_completes_turn() {

assert!(matches!(
harness
.wait_for_event(Duration::from_secs(5), |event| matches!(
.wait_for_event(EVENT_WAIT, |event| matches!(
event,
FromAgent::ProviderError { .. }
))
Expand Down Expand Up @@ -333,7 +340,7 @@ async fn scripted_partial_text_eof_is_transient_protocol_error() {
.expect("prompt");

let snapshot = harness
.wait_for_event(Duration::from_secs(2), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(event, FromAgent::ConversationSnapshot { .. })
})
.await
Expand All @@ -349,7 +356,7 @@ async fn scripted_partial_text_eof_is_transient_protocol_error() {
);
assert!(matches!(
harness
.wait_for_event(Duration::from_secs(5), |event| matches!(
.wait_for_event(EVENT_WAIT, |event| matches!(
event,
FromAgent::ProviderError { .. }
))
Expand Down Expand Up @@ -396,7 +403,7 @@ async fn scripted_completed_tool_block_eof_is_transient_protocol_error() {

assert!(matches!(
harness
.wait_for_event(Duration::from_secs(5), |event| matches!(
.wait_for_event(EVENT_WAIT, |event| matches!(
event,
FromAgent::ProviderError { .. }
))
Expand Down Expand Up @@ -432,7 +439,7 @@ async fn successful_native_loop_emits_explicit_turn_completed() {

assert!(
harness
.wait_for_event(Duration::from_secs(5), |event| matches!(
.wait_for_event(EVENT_WAIT, |event| matches!(
event,
FromAgent::TurnCompleted { .. }
))
Expand Down Expand Up @@ -465,7 +472,7 @@ async fn continue_preserves_provider_error_kind_and_does_not_complete() {
.expect("prompt");
assert!(
harness
.wait_for_event(Duration::from_secs(5), |event| matches!(
.wait_for_event(EVENT_WAIT, |event| matches!(
event,
FromAgent::TurnCompleted { .. }
))
Expand All @@ -476,7 +483,7 @@ async fn continue_preserves_provider_error_kind_and_does_not_complete() {
harness.agent.continue_execution().expect("continue");
assert!(matches!(
harness
.wait_for_event(Duration::from_secs(5), |event| matches!(
.wait_for_event(EVENT_WAIT, |event| matches!(
event,
FromAgent::ProviderError { .. }
))
Expand Down Expand Up @@ -515,7 +522,7 @@ async fn cancelled_native_loop_emits_explicit_turn_interrupted() {
.expect("prompt");
assert!(
harness
.wait_for_event(Duration::from_secs(5), |event| matches!(
.wait_for_event(EVENT_WAIT, |event| matches!(
event,
FromAgent::ResponseStart { .. }
))
Expand All @@ -526,7 +533,7 @@ async fn cancelled_native_loop_emits_explicit_turn_interrupted() {

assert!(matches!(
harness
.wait_for_event(Duration::from_secs(5), |event| matches!(
.wait_for_event(EVENT_WAIT, |event| matches!(
event,
FromAgent::TurnInterrupted { .. }
))
Expand Down Expand Up @@ -573,7 +580,7 @@ async fn side_question_eof_reports_structured_transient_protocol_error() {

assert!(matches!(
harness
.wait_for_event(Duration::from_secs(5), |event| matches!(
.wait_for_event(EVENT_WAIT, |event| matches!(
event,
FromAgent::SideQuestionEnd { .. }
))
Expand Down Expand Up @@ -605,7 +612,7 @@ async fn scripted_empty_response_is_terminal_error_without_response_end() {
.expect("prompt");

let error = harness
.wait_for_event(Duration::from_secs(12), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(event, FromAgent::Error { terminal: true, .. })
})
.await
Expand Down Expand Up @@ -656,7 +663,7 @@ async fn scripted_empty_response_retries_before_terminal_success() {

assert!(
harness
.wait_for_event(Duration::from_secs(5), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(event, FromAgent::Status { message } if message.contains("Retrying"))
})
.await
Expand All @@ -665,7 +672,7 @@ async fn scripted_empty_response_retries_before_terminal_success() {
);
assert!(
harness
.wait_for_event(Duration::from_secs(5), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(event, FromAgent::ResponseEnd { response_id, .. } if response_id == "done")
})
.await
Expand Down Expand Up @@ -700,7 +707,7 @@ async fn scripted_billed_empty_completion_steers_once_then_completes() {

assert!(
harness
.wait_for_event(Duration::from_secs(5), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(
event,
FromAgent::Status { message }
Expand All @@ -713,7 +720,7 @@ async fn scripted_billed_empty_completion_steers_once_then_completes() {
);
assert!(
harness
.wait_for_event(Duration::from_secs(5), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(event, FromAgent::ResponseEnd { response_id, .. } if response_id == "done")
})
.await
Expand Down Expand Up @@ -756,7 +763,7 @@ async fn scripted_tool_side_effect_is_not_repeated_by_later_empty_retry() {
.expect("prompt");
assert!(
harness
.wait_for_event(Duration::from_secs(8), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(event, FromAgent::ResponseEnd { response_id, .. } if response_id == "done")
})
.await
Expand Down Expand Up @@ -786,7 +793,7 @@ async fn scripted_text_response_still_completes() {

assert!(
harness
.wait_for_event(Duration::from_secs(5), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(event, FromAgent::ResponseEnd { response_id, .. } if response_id == "done")
})
.await
Expand Down Expand Up @@ -821,7 +828,7 @@ async fn scripted_tool_only_turn_is_not_rejected_as_empty() {

assert!(
harness
.wait_for_event(Duration::from_secs(5), |event| {
.wait_for_event(EVENT_WAIT, |event| {
matches!(event, FromAgent::ResponseEnd { response_id, .. } if response_id == "done")
})
.await
Expand Down
2 changes: 1 addition & 1 deletion packages/local-host-rs/src/agent/native_codex_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ async fn native_provider_checkpoint_survives_process_death_and_restores_tool_con
let sessions = tempfile::tempdir().expect("sessions");
let mut recorder =
crate::headless::SessionRecorder::new(sessions.path()).expect("session recorder");
let snapshot = tokio::time::timeout(std::time::Duration::from_secs(5), async {
let snapshot = tokio::time::timeout(std::time::Duration::from_secs(30), async {
loop {
match source_events.recv().await {
Some(FromAgent::ConversationSnapshot { messages, .. }) => break messages,
Expand Down
Loading
Loading