fix: address Cubic findings for provider preserve fallback
- Reorder resolveFallbackProviderID: providerHint now checked before global connected-provider cache
- Revert require('bun:test') hack to standard ESM import in fallback-chain-from-models.test.ts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -177,16 +177,16 @@ export function createEventHandler(args: {
|
||||
return lastKnownModel.providerID;
|
||||
}
|
||||
|
||||
const connectedProvider = readConnectedProvidersCache()?.[0];
|
||||
if (connectedProvider) {
|
||||
return connectedProvider;
|
||||
}
|
||||
|
||||
const normalizedProviderHint = providerHint?.trim();
|
||||
if (normalizedProviderHint) {
|
||||
return normalizedProviderHint;
|
||||
}
|
||||
|
||||
const connectedProvider = readConnectedProvidersCache()?.[0];
|
||||
if (connectedProvider) {
|
||||
return connectedProvider;
|
||||
}
|
||||
|
||||
return "opencode";
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
declare const require: (name: string) => any
|
||||
const { describe, test, expect } = require("bun:test")
|
||||
import { describe, test, expect } from "bun:test"
|
||||
import { buildFallbackChainFromModels, parseFallbackModelEntry } from "./fallback-chain-from-models"
|
||||
|
||||
describe("fallback-chain-from-models", () => {
|
||||
|
||||
Reference in New Issue
Block a user