feat(librarian): conditionally enable thinking based on model type

- Add isGeminiModel helper to detect Gemini models
- Disable thinking config for Gemini models (not supported)
- Enable thinking with 32000 token budget for other models
- Add tests verifying both Gemini and Claude behavior

🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
justsisyphus
2026-01-27 08:36:55 +09:00
parent 4e6bf7282e
commit ac23d45061
3 changed files with 40 additions and 1 deletions
+8 -1
View File
@@ -1,5 +1,6 @@
import type { AgentConfig } from "@opencode-ai/sdk"
import type { AgentPromptMetadata } from "./types"
import { isGeminiModel } from "./types"
import { createAgentToolRestrictions } from "../shared/permission-compat"
export const LIBRARIAN_PROMPT_METADATA: AgentPromptMetadata = {
@@ -28,7 +29,7 @@ export function createLibrarianAgent(model: string): AgentConfig {
"call_omo_agent",
])
return {
const base = {
description:
"Specialized codebase understanding agent for multi-repository analysis, searching remote codebases, retrieving official documentation, and finding implementation examples using GitHub CLI, Context7, and Web Search. MUST BE USED when users ask to look up code in remote repositories, explain library internals, or find usage examples in open source.",
mode: "subagent" as const,
@@ -322,5 +323,11 @@ grep_app_searchGitHub(query: "useQuery")
`,
}
if (isGeminiModel(model)) {
return base
}
return { ...base, thinking: { type: "enabled", budgetTokens: 32000 } }
}