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
13 changes: 11 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,6 @@ fn report_harness_or_core<R: CommandRunner, W: Write>(
if let Some(failure) =
probe_failure_from_value(harness_label, "harness::status", &value)
{
writeln!(out, "{harness_label}: unavailable: {}", failure.error)?;
failure
} else {
writeln!(out, "{harness_label}: ok")?;
Expand All @@ -1283,7 +1282,6 @@ fn report_harness_or_core<R: CommandRunner, W: Write>(
}
Err(err) => {
let error = err.to_string();
writeln!(out, "{harness_label}: unavailable: {error}")?;
ProbeFailure {
label: harness_label.to_string(),
error,
Expand All @@ -1299,9 +1297,15 @@ fn report_harness_or_core<R: CommandRunner, W: Write>(
Ok(value) => {
let missing = missing_core_runtime_functions(&value);
if missing.is_empty() {
writeln!(out, "{harness_label}: unavailable; using core stack")?;
writeln!(out, "core stack: ok")?;
Ok(None)
} else {
writeln!(
out,
"{harness_label}: unavailable: {}",
harness_failure.error
)?;
let missing = missing.join(", ");
writeln!(out, "core stack: error: missing {missing}")?;
Ok(Some(ProbeFailure {
Expand All @@ -1315,6 +1319,11 @@ fn report_harness_or_core<R: CommandRunner, W: Write>(
}
Err(err) => {
let error = err.to_string();
writeln!(
out,
"{harness_label}: unavailable: {}",
harness_failure.error
)?;
writeln!(out, "core stack: error: {error}")?;
Ok(Some(ProbeFailure {
label: "core stack".to_string(),
Expand Down
5 changes: 3 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub struct ChatArgs {
#[arg(long, default_value_t = 750)]
pub poll_interval_ms: u64,

#[arg(long, default_value_t = 600_000)]
#[arg(long, default_value_t = 1_800_000)]
pub stream_timeout_ms: u64,

#[arg(long)]
Expand All @@ -157,7 +157,7 @@ impl Default for ChatArgs {
idle_timeout_secs: 300,
max_turns: 20,
poll_interval_ms: 750,
stream_timeout_ms: 600_000,
stream_timeout_ms: 1_800_000,
wait: false,
}
}
Expand Down Expand Up @@ -628,6 +628,7 @@ mod tests {
Command::Chat(args) => {
assert_eq!(args.session_id.as_deref(), Some("s1"));
assert_eq!(args.prompt.as_deref(), Some("hi"));
assert_eq!(args.stream_timeout_ms, 1_800_000);
}
_ => panic!("expected chat command"),
}
Expand Down
6 changes: 2 additions & 4 deletions src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ pub fn build_user_message(prompt: &str) -> Value {
}

pub fn build_worker_aware_user_message(prompt: &str) -> Value {
build_user_message(&format!(
"{III_CODE_CLIENT_CONTEXT}\n\nUser request:\n{prompt}"
))
build_user_message(&format!("{prompt}\n\n{III_CODE_CLIENT_CONTEXT}"))
}

pub fn build_auth_payload(provider: &str, key: &str) -> Value {
Expand Down Expand Up @@ -441,10 +439,10 @@ mod tests {
let message = build_worker_aware_user_message("fix the repo");
let text = message["content"][0]["text"].as_str().unwrap();

assert!(text.starts_with("fix the repo"));
assert!(text.contains("Installed iii workers"));
assert!(text.contains("engine::functions::list"));
assert!(text.contains("skill::fetch"));
assert!(text.contains("fix the repo"));
}

#[test]
Expand Down