From d978a6c89db89b73e32ab27f0147f1848ab7e4f8 Mon Sep 17 00:00:00 2001 From: Scott Werner Date: Sat, 22 Aug 2026 10:29:32 -0400 Subject: [PATCH] Route both create-run client methods through one submission helper create_run_from_manifest and create_run_from_intent were byte-identical apart from the body type; fold the shared request/retry plumbing into a private submit_create_run(CreateRunRequest) so the two public entry points stay thin. Co-Authored-By: Claude Fable 5 --- lib/foundation/fabro-client/src/client.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/foundation/fabro-client/src/client.rs b/lib/foundation/fabro-client/src/client.rs index 62c300861..56c4e0546 100644 --- a/lib/foundation/fabro-client/src/client.rs +++ b/lib/foundation/fabro-client/src/client.rs @@ -697,18 +697,16 @@ impl Client { } pub async fn create_run_from_manifest(&self, manifest: types::RunManifest) -> Result { - let response = self - .send_api( - |client| async move { client.create_run().body(manifest.clone()).send().await }, - ) - .await?; - let status = response.into_inner(); - Ok(status.id) + self.submit_create_run(manifest.into()).await } pub async fn create_run_from_intent(&self, intent: types::RunIntent) -> Result { + self.submit_create_run(intent.into()).await + } + + async fn submit_create_run(&self, body: types::CreateRunRequest) -> Result { let response = self - .send_api(|client| async move { client.create_run().body(intent.clone()).send().await }) + .send_api(|client| async move { client.create_run().body(body.clone()).send().await }) .await?; let status = response.into_inner(); Ok(status.id)