mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-06 01:17:46 +08:00
Fix usage records filtering and pool trace display
This commit is contained in:
@@ -795,6 +795,10 @@ impl<'a> PoolKeyCursor<'a> {
|
||||
if self.skip_candidate_if_runtime_cooldown(&candidate).await {
|
||||
continue;
|
||||
}
|
||||
if candidate.orchestration.candidate_group_id.is_none() {
|
||||
candidate.orchestration.candidate_group_id =
|
||||
Some(pool_cursor_candidate_group_id(&self.group));
|
||||
}
|
||||
candidate.orchestration.pool_key_index = Some(self.next_pool_key_index);
|
||||
self.next_pool_key_index = self.next_pool_key_index.saturating_add(1);
|
||||
return Some(candidate);
|
||||
@@ -1539,6 +1543,17 @@ fn pool_candidate_facts(candidate: &EligibleLocalExecutionCandidate) -> PoolCand
|
||||
}
|
||||
}
|
||||
|
||||
fn pool_cursor_candidate_group_id(group: &EligibleLocalExecutionCandidate) -> String {
|
||||
format!(
|
||||
"provider={}|endpoint={}|model={}|selected_model={}|api_format={}|singleton_key=*",
|
||||
group.candidate.provider_id,
|
||||
group.candidate.endpoint_id,
|
||||
group.candidate.model_id,
|
||||
group.candidate.selected_provider_model_name,
|
||||
group.provider_api_format,
|
||||
)
|
||||
}
|
||||
|
||||
fn pool_scheduling_config(
|
||||
config: AdminProviderPoolConfig,
|
||||
provider_type: &str,
|
||||
@@ -2813,6 +2828,12 @@ mod tests {
|
||||
.expect("cursor should skip disallowed pool key and return allowed key");
|
||||
assert_eq!(candidate.candidate.key_id, "key-b");
|
||||
assert_eq!(candidate.orchestration.pool_key_index, Some(0));
|
||||
assert_eq!(
|
||||
candidate.orchestration.candidate_group_id.as_deref(),
|
||||
Some(
|
||||
"provider=provider-pool|endpoint=endpoint-1|model=model-1|selected_model=gpt-5|api_format=openai:chat|singleton_key=*"
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
cursor
|
||||
.skip_reason_counts
|
||||
|
||||
Reference in New Issue
Block a user