feat(hooks): add Gemini-optimized ultrawork message with intent gate
Create dedicated Gemini ultrawork variant that enforces intent classification as mandatory Step 0 before any action. Routes Gemini models to the new variant via source-detector priority chain (planner > GPT > Gemini > default). Includes anti-optimism checkpoint and tool-call mandate sections tuned for Gemini's eager behavior. 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -4,10 +4,11 @@
|
||||
* Routing logic:
|
||||
* 1. Planner agents (prometheus, plan) → planner.ts
|
||||
* 2. GPT 5.2 models → gpt5.2.ts
|
||||
* 3. Everything else (Claude, etc.) → default.ts
|
||||
* 3. Gemini models → gemini.ts
|
||||
* 4. Everything else (Claude, etc.) → default.ts
|
||||
*/
|
||||
|
||||
import { isGptModel } from "../../../agents/types"
|
||||
import { isGptModel, isGeminiModel } from "../../../agents/types"
|
||||
|
||||
/**
|
||||
* Checks if agent is a planner-type agent.
|
||||
@@ -22,10 +23,10 @@ export function isPlannerAgent(agentName?: string): boolean {
|
||||
return /\bplan\b/.test(normalized)
|
||||
}
|
||||
|
||||
export { isGptModel }
|
||||
export { isGptModel, isGeminiModel }
|
||||
|
||||
/** Ultrawork message source type */
|
||||
export type UltraworkSource = "planner" | "gpt" | "default"
|
||||
export type UltraworkSource = "planner" | "gpt" | "gemini" | "default"
|
||||
|
||||
/**
|
||||
* Determines which ultrawork message source to use.
|
||||
@@ -44,6 +45,11 @@ export function getUltraworkSource(
|
||||
return "gpt"
|
||||
}
|
||||
|
||||
|
||||
// Priority 3: Gemini models
|
||||
if (modelID && isGeminiModel(modelID)) {
|
||||
return "gemini"
|
||||
}
|
||||
// Default: Claude and other models
|
||||
return "default"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user