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:
YeonGyu-Kim
2026-03-12 11:05:31 +09:00
parent 7870e43578
commit 2912b6598c
2 changed files with 6 additions and 7 deletions

View File

@@ -177,16 +177,16 @@ export function createEventHandler(args: {
return lastKnownModel.providerID; return lastKnownModel.providerID;
} }
const connectedProvider = readConnectedProvidersCache()?.[0];
if (connectedProvider) {
return connectedProvider;
}
const normalizedProviderHint = providerHint?.trim(); const normalizedProviderHint = providerHint?.trim();
if (normalizedProviderHint) { if (normalizedProviderHint) {
return normalizedProviderHint; return normalizedProviderHint;
} }
const connectedProvider = readConnectedProvidersCache()?.[0];
if (connectedProvider) {
return connectedProvider;
}
return "opencode"; return "opencode";
}; };

View File

@@ -1,5 +1,4 @@
declare const require: (name: string) => any import { describe, test, expect } from "bun:test"
const { describe, test, expect } = require("bun:test")
import { buildFallbackChainFromModels, parseFallbackModelEntry } from "./fallback-chain-from-models" import { buildFallbackChainFromModels, parseFallbackModelEntry } from "./fallback-chain-from-models"
describe("fallback-chain-from-models", () => { describe("fallback-chain-from-models", () => {