diff --git a/.env.example b/.env.example index eb18e7b2c..bd2b4753f 100644 --- a/.env.example +++ b/.env.example @@ -8,13 +8,13 @@ MINIMAX_API_KEY= OPENAI_API_KEY= ZAI_API_KEY= -ARC_JWT_PRIVATE_KEY= -ARC_JWT_PUBLIC_KEY= +FABRO_JWT_PRIVATE_KEY= +FABRO_JWT_PUBLIC_KEY= SESSION_SECRET= GITHUB_APP_CLIENT_SECRET= GITHUB_APP_WEBHOOK_SECRET= GITHUB_APP_PRIVATE_KEY= -ARC_SLACK_APP_TOKEN= -ARC_SLACK_BOT_TOKEN= \ No newline at end of file +FABRO_SLACK_APP_TOKEN= +FABRO_SLACK_BOT_TOKEN= \ No newline at end of file diff --git a/lib/crates/fabro-agent/src/compaction.rs b/lib/crates/fabro-agent/src/compaction.rs index 939737150..699a6bc5e 100644 --- a/lib/crates/fabro-agent/src/compaction.rs +++ b/lib/crates/fabro-agent/src/compaction.rs @@ -262,7 +262,7 @@ mod tests { serde_json::json!({"path": "foo.rs"}), )], provider_parts: vec![], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp_1".into(), timestamp: SystemTime::now(), }, diff --git a/lib/crates/fabro-agent/src/history.rs b/lib/crates/fabro-agent/src/history.rs index e47ccb2f5..b9de2706f 100644 --- a/lib/crates/fabro-agent/src/history.rs +++ b/lib/crates/fabro-agent/src/history.rs @@ -231,7 +231,7 @@ mod tests { content: "Hi there".into(), tool_calls: vec![], provider_parts: vec![], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp_1".into(), timestamp: SystemTime::now(), }); @@ -249,7 +249,7 @@ mod tests { content: "Let me read that".into(), tool_calls: vec![tc], provider_parts: vec![], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp_2".into(), timestamp: SystemTime::now(), }); @@ -275,7 +275,7 @@ mod tests { content: "The answer is 42".into(), tool_calls: vec![], provider_parts: vec![thinking], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp_3".into(), timestamp: SystemTime::now(), }); @@ -300,7 +300,7 @@ mod tests { content: "The answer".into(), tool_calls: vec![], provider_parts: vec![thinking], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp_4".into(), timestamp: SystemTime::now(), }); @@ -331,7 +331,7 @@ mod tests { content: String::new(), tool_calls: vec![tc], provider_parts: vec![reasoning_item], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp_1".into(), timestamp: SystemTime::now(), }); @@ -397,7 +397,7 @@ mod tests { content: "Second".into(), tool_calls: vec![], provider_parts: vec![], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp_1".into(), timestamp: SystemTime::now(), }); @@ -423,12 +423,12 @@ mod tests { signature: None, redacted: false, })], - usage: Usage { + usage: Box::new(Usage { input_tokens: 10, output_tokens: 5, total_tokens: 15, ..Default::default() - }, + }), response_id: "resp_1".into(), timestamp: SystemTime::now(), }); @@ -467,7 +467,7 @@ mod tests { content: "response".into(), tool_calls: vec![tc], provider_parts: vec![reasoning], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp_1".into(), timestamp: SystemTime::now(), }); @@ -514,7 +514,7 @@ mod tests { content: "answer".into(), tool_calls: vec![], provider_parts: vec![thinking], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp_1".into(), timestamp: SystemTime::now(), }); @@ -551,7 +551,7 @@ mod tests { kind: ContentPart::OPENAI_REASONING.into(), data: serde_json::json!({"type": "reasoning", "id": format!("rs_{i}")}), }], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: format!("resp_{i}"), timestamp: SystemTime::now(), }); @@ -580,7 +580,7 @@ mod tests { content: "reply".into(), tool_calls: vec![], provider_parts: vec![], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "r1".into(), timestamp: SystemTime::now(), }, @@ -624,7 +624,7 @@ mod tests { content: "assistant msg".into(), tool_calls: vec![], provider_parts: vec![], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "r1".into(), timestamp: SystemTime::now(), }); diff --git a/lib/crates/fabro-agent/src/loop_detection.rs b/lib/crates/fabro-agent/src/loop_detection.rs index 2bc06e92b..e00940139 100644 --- a/lib/crates/fabro-agent/src/loop_detection.rs +++ b/lib/crates/fabro-agent/src/loop_detection.rs @@ -102,7 +102,7 @@ mod tests { content: String::new(), tool_calls: vec![ToolCall::new("call_1", name, args)], provider_parts: vec![], - usage: Usage::default(), + usage: Box::new(Usage::default()), response_id: "resp".into(), timestamp: SystemTime::now(), } diff --git a/lib/crates/fabro-agent/src/session.rs b/lib/crates/fabro-agent/src/session.rs index 1951f30fd..6d63f1950 100644 --- a/lib/crates/fabro-agent/src/session.rs +++ b/lib/crates/fabro-agent/src/session.rs @@ -697,7 +697,7 @@ impl Session { content: text.clone(), tool_calls: tool_calls.clone(), provider_parts, - usage, + usage: Box::new(usage), response_id: response.id.clone(), timestamp: SystemTime::now(), }); diff --git a/lib/crates/fabro-agent/src/types.rs b/lib/crates/fabro-agent/src/types.rs index e09196aae..3423b78f9 100644 --- a/lib/crates/fabro-agent/src/types.rs +++ b/lib/crates/fabro-agent/src/types.rs @@ -38,7 +38,7 @@ pub enum Turn { /// `Anthropic` thinking blocks with signatures) preserved for round-tripping. /// Reasoning/thinking text is stored here as `ContentPart::Thinking`. provider_parts: Vec, - usage: Usage, + usage: Box, response_id: String, timestamp: SystemTime, }, diff --git a/lib/crates/fabro-workflows/src/cli/backend.rs b/lib/crates/fabro-workflows/src/cli/backend.rs index 1f34a769f..c77f5ab48 100644 --- a/lib/crates/fabro-workflows/src/cli/backend.rs +++ b/lib/crates/fabro-workflows/src/cli/backend.rs @@ -560,7 +560,7 @@ impl CodergenBackend for AgentApiBackend { let mut total_usage = fabro_llm::types::Usage::default(); for turn in &session.history().turns()[turns_before..] { if let Turn::Assistant { usage, .. } = turn { - total_usage = total_usage + usage.clone(); + total_usage = total_usage + *usage.clone(); } }