Preserve ultrawork runtime variants
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -14,6 +14,14 @@ import {
|
||||
import type { ContextCollector } from "../../features/context-injector"
|
||||
|
||||
export function createKeywordDetectorHook(ctx: PluginInput, _collector?: ContextCollector) {
|
||||
function getRuntimeVariant(input: { variant?: string }, message: Record<string, unknown>): string | undefined {
|
||||
if (typeof message["variant"] === "string") {
|
||||
return message["variant"]
|
||||
}
|
||||
|
||||
return typeof input.variant === "string" ? input.variant : undefined
|
||||
}
|
||||
|
||||
return {
|
||||
"chat.message": async (
|
||||
input: {
|
||||
@@ -21,6 +29,7 @@ export function createKeywordDetectorHook(ctx: PluginInput, _collector?: Context
|
||||
agent?: string
|
||||
model?: { providerID: string; modelID: string }
|
||||
messageID?: string
|
||||
variant?: string
|
||||
},
|
||||
output: {
|
||||
message: Record<string, unknown>
|
||||
@@ -72,15 +81,21 @@ export function createKeywordDetectorHook(ctx: PluginInput, _collector?: Context
|
||||
|
||||
const hasUltrawork = detectedKeywords.some((k) => k.type === "ultrawork")
|
||||
if (hasUltrawork) {
|
||||
log(`[keyword-detector] Ultrawork mode activated`, { sessionID: input.sessionID })
|
||||
const runtimeVariant = getRuntimeVariant(input, output.message)
|
||||
const isRuntimeMax = runtimeVariant === "max"
|
||||
|
||||
output.message.variant = "max"
|
||||
log(`[keyword-detector] Ultrawork mode activated`, {
|
||||
sessionID: input.sessionID,
|
||||
runtimeVariant,
|
||||
})
|
||||
|
||||
ctx.client.tui
|
||||
.showToast({
|
||||
body: {
|
||||
title: "Ultrawork Mode Activated",
|
||||
message: "Maximum precision engaged. All agents at your disposal.",
|
||||
message: isRuntimeMax
|
||||
? "Maximum precision engaged. All agents at your disposal."
|
||||
: "Runtime variant preserved. All agents at your disposal.",
|
||||
variant: "success" as const,
|
||||
duration: 3000,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user