mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
fix clippy large_enum_variant and rename ARC_ env vars in .env.example
Box the Usage field in Turn::Assistant to satisfy clippy::large_enum_variant. Rename ARC_ prefixed env vars to FABRO_ in .env.example. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5b18680d57
commit
48eb867ce2
7 changed files with 22 additions and 22 deletions
|
|
@ -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=
|
||||
FABRO_SLACK_APP_TOKEN=
|
||||
FABRO_SLACK_BOT_TOKEN=
|
||||
|
|
@ -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(),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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<ContentPart>,
|
||||
usage: Usage,
|
||||
usage: Box<Usage>,
|
||||
response_id: String,
|
||||
timestamp: SystemTime,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue