turn: simplify run_turn match arms

This commit is contained in:
damocles 2026-05-25 21:47:40 +02:00 committed by Mara
commit 76533b0c20

View file

@ -491,9 +491,9 @@ pub async fn wait_for_login(
/// doesn't stall mid-turn — hyperhive owns compaction.
pub async fn run_turn(prompt: &str, files: &TurnFiles, bus: &Bus) -> TurnOutcome {
match run_claude(prompt, files, bus).await {
Ok((too_long, _, _)) if too_long => TurnOutcome::PromptTooLong,
Ok((_, rate_limited, _)) if rate_limited => TurnOutcome::RateLimited,
Ok((_, _, auth_failed)) if auth_failed => TurnOutcome::AuthFailed,
Ok((true, _, _)) => TurnOutcome::PromptTooLong,
Ok((_, true, _)) => TurnOutcome::RateLimited,
Ok((_, _, true)) => TurnOutcome::AuthFailed,
Ok(_) => TurnOutcome::Ok,
Err(e) => TurnOutcome::Failed(e),
}