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:
YeonGyu-Kim
2026-02-20 17:47:21 +09:00
parent 42b34fb5d2
commit 4bbc55bb02
4 changed files with 27 additions and 54 deletions
+1 -3
View File
@@ -74,9 +74,7 @@ export function createKeywordDetectorHook(ctx: PluginInput, _collector?: Context
if (hasUltrawork) {
log(`[keyword-detector] Ultrawork mode activated`, { sessionID: input.sessionID })
if (output.message.variant === undefined) {
output.message.variant = "max"
}
output.message.variant = "max"
ctx.client.tui
.showToast({
+4 -4
View File
@@ -219,8 +219,8 @@ describe("keyword-detector session filtering", () => {
expect(toastCalls).toContain("Ultrawork Mode Activated")
})
test("should not override existing variant", async () => {
// given - main session set with pre-existing variant
test("should override existing variant when ultrawork keyword is used", async () => {
// given - main session set with pre-existing variant from TUI
setMainSession("main-123")
const toastCalls: string[] = []
@@ -236,8 +236,8 @@ describe("keyword-detector session filtering", () => {
output
)
// then - existing variant should remain
expect(output.message.variant).toBe("low")
// then - ultrawork should override TUI variant to max
expect(output.message.variant).toBe("max")
expect(toastCalls).toContain("Ultrawork Mode Activated")
})
})