fix(hooks): apply Sisyphus GPT-5.5 variant
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
resolveRegisteredAgentName,
|
||||
updateSessionAgent,
|
||||
} from "../../features/claude-code-session-state"
|
||||
import { log } from "../../shared"
|
||||
import { AGENT_MODEL_REQUIREMENTS, log } from "../../shared"
|
||||
import { getAgentConfigKey } from "../../shared/agent-display-names"
|
||||
|
||||
const TOAST_TITLE = "NEVER Use Sisyphus with GPT"
|
||||
@@ -30,6 +30,18 @@ function showToast(ctx: PluginInput, sessionID: string): void {
|
||||
})
|
||||
}
|
||||
|
||||
function getNativeSisyphusGptVariant(model: { providerID: string; modelID: string }): string | undefined {
|
||||
const chain = AGENT_MODEL_REQUIREMENTS["sisyphus"]?.fallbackChain ?? []
|
||||
const exactMatch = chain.find((entry) =>
|
||||
entry.providers.includes(model.providerID) && entry.model === model.modelID
|
||||
)
|
||||
if (exactMatch?.variant !== undefined) {
|
||||
return exactMatch.variant
|
||||
}
|
||||
|
||||
return chain.find((entry) => entry.model === model.modelID)?.variant
|
||||
}
|
||||
|
||||
export function createNoSisyphusGptHook(ctx: PluginInput) {
|
||||
return {
|
||||
"chat.message": async (input: {
|
||||
@@ -43,6 +55,20 @@ export function createNoSisyphusGptHook(ctx: PluginInput) {
|
||||
const agentKey = getAgentConfigKey(rawAgent)
|
||||
const modelID = input.model?.modelID
|
||||
|
||||
if (
|
||||
agentKey === "sisyphus"
|
||||
&& input.model
|
||||
&& modelID
|
||||
&& isGptNativeSisyphusModel(modelID)
|
||||
&& output?.message
|
||||
&& output.message.variant === undefined
|
||||
) {
|
||||
const variant = getNativeSisyphusGptVariant(input.model)
|
||||
if (variant !== undefined) {
|
||||
output.message.variant = variant
|
||||
}
|
||||
}
|
||||
|
||||
if (agentKey === "sisyphus" && modelID && isGptModel(modelID) && !isGptNativeSisyphusModel(modelID)) {
|
||||
showToast(ctx, input.sessionID)
|
||||
input.agent = resolveRegisteredAgentName("hephaestus") ?? "hephaestus"
|
||||
|
||||
Reference in New Issue
Block a user