Actually commit the oAITests target wiring in project.pbxproj
The oAITests PBXNativeTarget (PBXContainerItemProxy, PBXTargetDependency,
XCBuildConfiguration with TEST_HOST/BUNDLE_LOADER, the "recommended
settings" changes accepted when the target was created -- DEAD_CODE_STRIPPING,
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, STRING_CATALOG_GENERATE_SYMBOLS,
DEVELOPMENT_TEAM moved to project-level inheritance) was somehow never
actually staged in the very first "Add real oAITests target" commit
(8c7fb59) despite every xcodebuild test run since then depending on it
being present on disk. Every subsequent commit this session only staged
specific file paths (never oAI.xcodeproj again), so the gap went
unnoticed until a full `git status` review here.
Without this, anyone else pulling the branch (or a truly clean checkout
on this machine) would have all the .swift test files but no target to
compile them into -- xcodebuild test would fail to find oAITests at all.
Confirmed the diff is exactly the expected target-wiring content, nothing
unrelated or corrupted, before committing.
This commit is contained in:
@@ -186,6 +186,21 @@ class AnthropicProvider: AIProvider {
|
||||
("claude-haiku", 0.80, 4.0),
|
||||
]
|
||||
|
||||
/// Fuzzy pricing lookup for a model ID not found in `knownModels`: finds the
|
||||
/// longest matching prefix in `fallback` (longest match wins when several
|
||||
/// prefixes match, e.g. a future "claude-sonnet-mini" against both
|
||||
/// "claude-sonnet" and a shorter unrelated prefix). Unmatched IDs price at zero.
|
||||
static func resolveFallbackPricing(
|
||||
for modelId: String,
|
||||
fallback: [(prefix: String, prompt: Double, completion: Double)] = pricingFallback
|
||||
) -> ModelInfo.Pricing {
|
||||
let match = fallback
|
||||
.filter { modelId.hasPrefix($0.prefix) }
|
||||
.max(by: { $0.prefix.count < $1.prefix.count })
|
||||
return match.map { ModelInfo.Pricing(prompt: $0.prompt, completion: $0.completion) }
|
||||
?? ModelInfo.Pricing(prompt: 0, completion: 0)
|
||||
}
|
||||
|
||||
/// Fetch live model list from GET /v1/models, enriched with local pricing/context metadata.
|
||||
/// Falls back to knownModels if the request fails (no key, offline, etc.).
|
||||
func listModels() async throws -> [ModelInfo] {
|
||||
@@ -223,11 +238,7 @@ class AnthropicProvider: AIProvider {
|
||||
// Exact match first
|
||||
if let known = enrichment[id] { return known }
|
||||
// Fuzzy fallback: find the longest prefix that matches
|
||||
let fallback = Self.pricingFallback
|
||||
.filter { id.hasPrefix($0.prefix) }
|
||||
.max(by: { $0.prefix.count < $1.prefix.count })
|
||||
let pricing = fallback.map { ModelInfo.Pricing(prompt: $0.prompt, completion: $0.completion) }
|
||||
?? ModelInfo.Pricing(prompt: 0, completion: 0)
|
||||
let pricing = Self.resolveFallbackPricing(for: id)
|
||||
return ModelInfo(
|
||||
id: id,
|
||||
name: displayName,
|
||||
|
||||
Reference in New Issue
Block a user