fix(variant): respect TUI variant and enforce max in ultrawork mode
- keyword-detector: always set variant to 'max' when ultrawork/ulw keyword detected
- chat-message: remove variant resolution logic to passthrough TUI variant unchanged
- Tests updated to reflect new behavior
🤖 Generated with OhMyOpenCode assistance
This commit is contained in:
@@ -1,15 +1,8 @@
|
||||
import type { OhMyOpenCodeConfig } from "../config"
|
||||
import type { PluginContext } from "./types"
|
||||
|
||||
import {
|
||||
applyAgentVariant,
|
||||
resolveAgentVariant,
|
||||
resolveVariantForModel,
|
||||
} from "../shared/agent-variant"
|
||||
import { hasConnectedProvidersCache } from "../shared"
|
||||
import {
|
||||
setSessionAgent,
|
||||
} from "../features/claude-code-session-state"
|
||||
import { setSessionAgent } from "../features/claude-code-session-state"
|
||||
import { applyUltraworkModelOverrideOnMessage } from "./ultrawork-model-override"
|
||||
|
||||
import type { CreatedHooks } from "../create-hooks"
|
||||
@@ -57,25 +50,7 @@ export function createChatMessageHandler(args: {
|
||||
const message = output.message
|
||||
|
||||
if (firstMessageVariantGate.shouldOverride(input.sessionID)) {
|
||||
if (message["variant"] === undefined) {
|
||||
const variant =
|
||||
input.model && input.agent
|
||||
? resolveVariantForModel(pluginConfig, input.agent, input.model)
|
||||
: resolveAgentVariant(pluginConfig, input.agent)
|
||||
if (variant !== undefined) {
|
||||
message["variant"] = variant
|
||||
}
|
||||
}
|
||||
firstMessageVariantGate.markApplied(input.sessionID)
|
||||
} else {
|
||||
if (input.model && input.agent && message["variant"] === undefined) {
|
||||
const variant = resolveVariantForModel(pluginConfig, input.agent, input.model)
|
||||
if (variant !== undefined) {
|
||||
message["variant"] = variant
|
||||
}
|
||||
} else {
|
||||
applyAgentVariant(pluginConfig, input.agent, message)
|
||||
}
|
||||
}
|
||||
|
||||
await hooks.stopContinuationGuard?.["chat.message"]?.(input)
|
||||
|
||||
Reference in New Issue
Block a user