From 616ee7805c63eb0a80cc75043ec20cff7098cc1c Mon Sep 17 00:00:00 2001 From: justsisyphus Date: Sat, 31 Jan 2026 13:47:44 +0900 Subject: [PATCH] refactor: standardize naming conventions across agents, tools, and hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename agent "OpenCode-Builder" to "opencode-builder" (kebab-case) - Rename tool "slashcommand" to "slash_command" (snake_case) - Add "Hook" suffix to 3 factory functions: - createCompactionContextInjector → createCompactionContextInjectorHook - createSessionNotification → createSessionNotificationHook - createTodoContinuationEnforcer → createTodoContinuationEnforcerHook - Rename createCommentCheckerHooks → createCommentCheckerHook (singular) BREAKING CHANGE: Config files using "OpenCode-Builder" must update to "opencode-builder". BREAKING CHANGE: Agent prompts referencing "slashcommand" must update to "slash_command". --- assets/oh-my-opencode.schema.json | 2 +- docs/configurations.md | 10 +-- src/agents/dynamic-agent-prompt-builder.ts | 2 +- src/config/schema.ts | 4 +- src/hooks/auto-slash-command/executor.ts | 2 +- src/hooks/comment-checker/index.ts | 4 +- .../compaction-context-injector/index.test.ts | 8 +-- .../compaction-context-injector/index.ts | 2 +- src/hooks/index.ts | 8 +-- src/hooks/session-notification.test.ts | 24 +++---- src/hooks/session-notification.ts | 2 +- src/hooks/todo-continuation-enforcer.test.ts | 70 +++++++++---------- src/hooks/todo-continuation-enforcer.ts | 2 +- src/index.ts | 6 +- src/plugin-handlers/config-handler.ts | 4 +- src/tools/slashcommand/index.ts | 2 +- src/tools/slashcommand/tools.ts | 2 +- 17 files changed, 77 insertions(+), 77 deletions(-) diff --git a/assets/oh-my-opencode.schema.json b/assets/oh-my-opencode.schema.json index d9498a733..fe751e202 100644 --- a/assets/oh-my-opencode.schema.json +++ b/assets/oh-my-opencode.schema.json @@ -781,7 +781,7 @@ } } }, - "OpenCode-Builder": { + "opencode-builder": { "type": "object", "properties": { "model": { diff --git a/docs/configurations.md b/docs/configurations.md index 84eda6ce7..527bf3d55 100644 --- a/docs/configurations.md +++ b/docs/configurations.md @@ -610,7 +610,7 @@ Configure git-master skill behavior: When enabled (default), Sisyphus provides a powerful orchestrator with optional specialized agents: - **Sisyphus**: Primary orchestrator agent (Claude Opus 4.5) -- **OpenCode-Builder**: OpenCode's default build agent, renamed due to SDK limitations (disabled by default) +- **opencode-builder**: OpenCode's default build agent, renamed due to SDK limitations (disabled by default) - **Prometheus (Planner)**: OpenCode's default plan agent with work-planner methodology (enabled by default) - **Metis (Plan Consultant)**: Pre-planning analysis agent that identifies hidden requirements and AI failure points @@ -627,7 +627,7 @@ When enabled (default), Sisyphus provides a powerful orchestrator with optional } ``` -**Example: Enable OpenCode-Builder:** +**Example: Enable opencode-builder:** ```json { @@ -637,7 +637,7 @@ When enabled (default), Sisyphus provides a powerful orchestrator with optional } ``` -This enables OpenCode-Builder agent alongside Sisyphus. The default build agent is always demoted to subagent mode when Sisyphus is enabled. +This enables opencode-builder agent alongside Sisyphus. The default build agent is always demoted to subagent mode when Sisyphus is enabled. **Example: Disable all Sisyphus orchestration:** @@ -658,7 +658,7 @@ You can also customize Sisyphus agents like other agents: "model": "anthropic/claude-sonnet-4", "temperature": 0.3 }, - "OpenCode-Builder": { + "opencode-builder": { "model": "anthropic/claude-opus-4" }, "Prometheus (Planner)": { @@ -674,7 +674,7 @@ You can also customize Sisyphus agents like other agents: | Option | Default | Description | | ------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `disabled` | `false` | When `true`, disables all Sisyphus orchestration and restores original build/plan as primary. | -| `default_builder_enabled` | `false` | When `true`, enables OpenCode-Builder agent (same as OpenCode build, renamed due to SDK limitations). Disabled by default. | +| `default_builder_enabled` | `false` | When `true`, enables opencode-builder agent (same as OpenCode build, renamed due to SDK limitations). Disabled by default. | | `planner_enabled` | `true` | When `true`, enables Prometheus (Planner) agent with work-planner methodology. Enabled by default. | | `replace_plan` | `true` | When `true`, demotes default plan agent to subagent mode. Set to `false` to keep both Prometheus (Planner) and default plan available. | diff --git a/src/agents/dynamic-agent-prompt-builder.ts b/src/agents/dynamic-agent-prompt-builder.ts index 6a28d3724..7f64c331b 100644 --- a/src/agents/dynamic-agent-prompt-builder.ts +++ b/src/agents/dynamic-agent-prompt-builder.ts @@ -33,7 +33,7 @@ export function categorizeTools(toolNames: string[]): AvailableTool[] { category = "search" } else if (name.startsWith("session_")) { category = "session" - } else if (name === "slashcommand") { + } else if (name === "slash_command") { category = "command" } return { name, category } diff --git a/src/config/schema.ts b/src/config/schema.ts index 1c887b75e..2715cf979 100644 --- a/src/config/schema.ts +++ b/src/config/schema.ts @@ -40,7 +40,7 @@ export const OverridableAgentNameSchema = z.enum([ "plan", "sisyphus", "sisyphus-junior", - "OpenCode-Builder", + "opencode-builder", "prometheus", "metis", "momus", @@ -136,7 +136,7 @@ export const AgentOverridesSchema = z.object({ plan: AgentOverrideConfigSchema.optional(), sisyphus: AgentOverrideConfigSchema.optional(), "sisyphus-junior": AgentOverrideConfigSchema.optional(), - "OpenCode-Builder": AgentOverrideConfigSchema.optional(), + "opencode-builder": AgentOverrideConfigSchema.optional(), prometheus: AgentOverrideConfigSchema.optional(), metis: AgentOverrideConfigSchema.optional(), momus: AgentOverrideConfigSchema.optional(), diff --git a/src/hooks/auto-slash-command/executor.ts b/src/hooks/auto-slash-command/executor.ts index 1ab1d2411..0f6c04c22 100644 --- a/src/hooks/auto-slash-command/executor.ts +++ b/src/hooks/auto-slash-command/executor.ts @@ -187,7 +187,7 @@ export async function executeSlashCommand(parsed: ParsedSlashCommand, options?: if (!command) { return { success: false, - error: `Command "/${parsed.command}" not found. Use the slashcommand tool to list available commands.`, + error: `Command "/${parsed.command}" not found. Use the slash_command tool to list available commands.`, } } diff --git a/src/hooks/comment-checker/index.ts b/src/hooks/comment-checker/index.ts index 8fdf87485..8e31eed03 100644 --- a/src/hooks/comment-checker/index.ts +++ b/src/hooks/comment-checker/index.ts @@ -32,8 +32,8 @@ function cleanupOldPendingCalls(): void { } } -export function createCommentCheckerHooks(config?: CommentCheckerConfig) { - debugLog("createCommentCheckerHooks called", { config }) +export function createCommentCheckerHook(config?: CommentCheckerConfig) { + debugLog("createCommentCheckerHook called", { config }) if (!cleanupIntervalStarted) { cleanupIntervalStarted = true diff --git a/src/hooks/compaction-context-injector/index.test.ts b/src/hooks/compaction-context-injector/index.test.ts index 7c141f4d2..6255783ba 100644 --- a/src/hooks/compaction-context-injector/index.test.ts +++ b/src/hooks/compaction-context-injector/index.test.ts @@ -24,7 +24,7 @@ mock.module("../../shared/system-directive", () => ({ }, })) -import { createCompactionContextInjector } from "./index" +import { createCompactionContextInjectorHook } from "./index" import type { SummarizeContext } from "./index" describe("createCompactionContextInjector", () => { @@ -35,7 +35,7 @@ describe("createCompactionContextInjector", () => { describe("Agent Verification State preservation", () => { it("includes Agent Verification State section in compaction prompt", async () => { // given - const injector = createCompactionContextInjector() + const injector = createCompactionContextInjectorHook() const context: SummarizeContext = { sessionID: "test-session", providerID: "anthropic", @@ -58,7 +58,7 @@ describe("createCompactionContextInjector", () => { it("includes Momus-specific context for reviewer agents", async () => { // given - const injector = createCompactionContextInjector() + const injector = createCompactionContextInjectorHook() const context: SummarizeContext = { sessionID: "test-session", providerID: "anthropic", @@ -80,7 +80,7 @@ describe("createCompactionContextInjector", () => { it("preserves file verification progress in compaction prompt", async () => { // given - const injector = createCompactionContextInjector() + const injector = createCompactionContextInjectorHook() const context: SummarizeContext = { sessionID: "test-session", providerID: "anthropic", diff --git a/src/hooks/compaction-context-injector/index.ts b/src/hooks/compaction-context-injector/index.ts index 836e706e9..85531c147 100644 --- a/src/hooks/compaction-context-injector/index.ts +++ b/src/hooks/compaction-context-injector/index.ts @@ -57,7 +57,7 @@ This section is CRITICAL for reviewer agents (momus, oracle) to maintain continu This context is critical for maintaining continuity after compaction. ` -export function createCompactionContextInjector() { +export function createCompactionContextInjectorHook() { return async (ctx: SummarizeContext): Promise => { log("[compaction-context-injector] injecting context", { sessionID: ctx.sessionID }) diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 7206def38..e50457550 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,15 +1,15 @@ -export { createTodoContinuationEnforcer, type TodoContinuationEnforcer } from "./todo-continuation-enforcer"; +export { createTodoContinuationEnforcerHook as createTodoContinuationEnforcer, type TodoContinuationEnforcer } from "./todo-continuation-enforcer"; export { createContextWindowMonitorHook } from "./context-window-monitor"; -export { createSessionNotification } from "./session-notification"; +export { createSessionNotificationHook as createSessionNotification } from "./session-notification"; export { createSessionRecoveryHook, type SessionRecoveryHook, type SessionRecoveryOptions } from "./session-recovery"; -export { createCommentCheckerHooks } from "./comment-checker"; +export { createCommentCheckerHook as createCommentCheckerHooks } from "./comment-checker"; export { createToolOutputTruncatorHook } from "./tool-output-truncator"; export { createDirectoryAgentsInjectorHook } from "./directory-agents-injector"; export { createDirectoryReadmeInjectorHook } from "./directory-readme-injector"; export { createEmptyTaskResponseDetectorHook } from "./empty-task-response-detector"; export { createAnthropicContextWindowLimitRecoveryHook, type AnthropicContextWindowLimitRecoveryOptions } from "./anthropic-context-window-limit-recovery"; -export { createCompactionContextInjector } from "./compaction-context-injector"; +export { createCompactionContextInjectorHook as createCompactionContextInjector } from "./compaction-context-injector"; export { createThinkModeHook } from "./think-mode"; export { createClaudeCodeHooksHook } from "./claude-code-hooks"; export { createRulesInjectorHook } from "./rules-injector"; diff --git a/src/hooks/session-notification.test.ts b/src/hooks/session-notification.test.ts index a19320cca..6f4b4bc7f 100644 --- a/src/hooks/session-notification.test.ts +++ b/src/hooks/session-notification.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test, beforeEach, afterEach, spyOn } from "bun:test" -import { createSessionNotification } from "./session-notification" +import { createSessionNotificationHook } from "./session-notification" import { setMainSession, subagentSessions, _resetForTesting } from "../features/claude-code-session-state" import * as utils from "./session-notification-utils" @@ -53,7 +53,7 @@ describe("session-notification", () => { const subagentSessionID = "subagent-123" subagentSessions.add(subagentSessionID) - const hook = createSessionNotification(createMockPluginInput(), { + const hook = createSessionNotificationHook(createMockPluginInput(), { idleConfirmationDelay: 0, }) @@ -78,7 +78,7 @@ describe("session-notification", () => { const otherSessionID = "other-456" setMainSession(mainSessionID) - const hook = createSessionNotification(createMockPluginInput(), { + const hook = createSessionNotificationHook(createMockPluginInput(), { idleConfirmationDelay: 0, }) @@ -102,7 +102,7 @@ describe("session-notification", () => { const mainSessionID = "main-789" setMainSession(mainSessionID) - const hook = createSessionNotification(createMockPluginInput(), { + const hook = createSessionNotificationHook(createMockPluginInput(), { idleConfirmationDelay: 10, skipIfIncompleteTodos: false, }) @@ -129,7 +129,7 @@ describe("session-notification", () => { setMainSession(mainSessionID) subagentSessions.add(subagentSessionID) - const hook = createSessionNotification(createMockPluginInput(), { + const hook = createSessionNotificationHook(createMockPluginInput(), { idleConfirmationDelay: 0, }) @@ -156,7 +156,7 @@ describe("session-notification", () => { setMainSession(mainSessionID) subagentSessions.add(subagentSessionID) - const hook = createSessionNotification(createMockPluginInput(), { + const hook = createSessionNotificationHook(createMockPluginInput(), { idleConfirmationDelay: 0, }) @@ -188,7 +188,7 @@ describe("session-notification", () => { const mainSessionID = "main-cancel" setMainSession(mainSessionID) - const hook = createSessionNotification(createMockPluginInput(), { + const hook = createSessionNotificationHook(createMockPluginInput(), { idleConfirmationDelay: 100, // Long delay skipIfIncompleteTodos: false, }) @@ -218,7 +218,7 @@ describe("session-notification", () => { test("should handle session.created event without notification", async () => { // #given - a new session is created - const hook = createSessionNotification(createMockPluginInput(), {}) + const hook = createSessionNotificationHook(createMockPluginInput(), {}) // #when - session.created event fires await hook({ @@ -239,7 +239,7 @@ describe("session-notification", () => { test("should handle session.deleted event and cleanup state", async () => { // #given - a session exists - const hook = createSessionNotification(createMockPluginInput(), {}) + const hook = createSessionNotificationHook(createMockPluginInput(), {}) // #when - session.deleted event fires await hook({ @@ -263,7 +263,7 @@ describe("session-notification", () => { const mainSessionID = "main-message" setMainSession(mainSessionID) - const hook = createSessionNotification(createMockPluginInput(), { + const hook = createSessionNotificationHook(createMockPluginInput(), { idleConfirmationDelay: 50, skipIfIncompleteTodos: false, }) @@ -297,7 +297,7 @@ describe("session-notification", () => { const mainSessionID = "main-tool" setMainSession(mainSessionID) - const hook = createSessionNotification(createMockPluginInput(), { + const hook = createSessionNotificationHook(createMockPluginInput(), { idleConfirmationDelay: 50, skipIfIncompleteTodos: false, }) @@ -329,7 +329,7 @@ describe("session-notification", () => { const mainSessionID = "main-dup" setMainSession(mainSessionID) - const hook = createSessionNotification(createMockPluginInput(), { + const hook = createSessionNotificationHook(createMockPluginInput(), { idleConfirmationDelay: 10, skipIfIncompleteTodos: false, }) diff --git a/src/hooks/session-notification.ts b/src/hooks/session-notification.ts index eded5181e..e7635d889 100644 --- a/src/hooks/session-notification.ts +++ b/src/hooks/session-notification.ts @@ -139,7 +139,7 @@ async function hasIncompleteTodos(ctx: PluginInput, sessionID: string): Promise< } } -export function createSessionNotification( +export function createSessionNotificationHook( ctx: PluginInput, config: SessionNotificationConfig = {} ) { diff --git a/src/hooks/todo-continuation-enforcer.test.ts b/src/hooks/todo-continuation-enforcer.test.ts index fa33b84f4..ddc91b7e2 100644 --- a/src/hooks/todo-continuation-enforcer.test.ts +++ b/src/hooks/todo-continuation-enforcer.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from "bun:test" import type { BackgroundManager } from "../features/background-agent" import { setMainSession, subagentSessions, _resetForTesting } from "../features/claude-code-session-state" -import { createTodoContinuationEnforcer } from "./todo-continuation-enforcer" +import { createTodoContinuationEnforcerHook } from "./todo-continuation-enforcer" type TimerCallback = (...args: any[]) => void @@ -191,7 +191,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-123" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), { + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), { backgroundManager: createMockBackgroundManager(false), }) @@ -221,7 +221,7 @@ describe("todo-continuation-enforcer", () => { { id: "1", content: "Task 1", status: "completed", priority: "high" }, ]}) - const hook = createTodoContinuationEnforcer(mockInput, {}) + const hook = createTodoContinuationEnforcerHook(mockInput, {}) // #when - session goes idle await hook.handler({ @@ -239,7 +239,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-789" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), { + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), { backgroundManager: createMockBackgroundManager(true), }) @@ -259,7 +259,7 @@ describe("todo-continuation-enforcer", () => { setMainSession("main-session") const otherSession = "other-session" - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - non-main session goes idle await hook.handler({ @@ -278,7 +278,7 @@ describe("todo-continuation-enforcer", () => { const bgTaskSession = "bg-task-session" subagentSessions.add(bgTaskSession) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - background task session goes idle await hook.handler({ @@ -298,7 +298,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-cancel" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -324,7 +324,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-grace" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -350,7 +350,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-assistant" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -377,7 +377,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-tool" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -401,7 +401,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-recovery" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - mark as recovering hook.markRecovering(sessionID) @@ -422,7 +422,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-recovery-done" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - mark as recovering then complete hook.markRecovering(sessionID) @@ -444,7 +444,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-delete" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -469,7 +469,7 @@ describe("todo-continuation-enforcer", () => { setMainSession(sessionID) // #when - create hook with skipAgents option (should not throw) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), { + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), { skipAgents: ["Prometheus (Planner)", "custom-agent"], }) @@ -487,7 +487,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-toast" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -505,7 +505,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-no-throttle" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - first idle cycle completes await hook.handler({ @@ -537,7 +537,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-noabort-error" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - non-abort error occurs (e.g., network error, API error) await hook.handler({ @@ -581,7 +581,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant", error: { name: "MessageAbortedError", data: { message: "The operation was aborted" } } } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -604,7 +604,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant" } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -627,7 +627,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "user" } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -650,7 +650,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant", error: { name: "AbortError" } } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle await hook.handler({ @@ -672,7 +672,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant" } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - abort error event fires await hook.handler({ @@ -702,7 +702,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant" } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - AbortError event fires await hook.handler({ @@ -732,7 +732,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant" } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - abort error fires await hook.handler({ @@ -764,7 +764,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant" } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - abort error fires await hook.handler({ @@ -803,7 +803,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant" } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - abort error fires await hook.handler({ @@ -841,7 +841,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant" } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - abort error fires await hook.handler({ @@ -879,7 +879,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant" } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - abort error event fires (but API doesn't have it yet) await hook.handler({ @@ -909,7 +909,7 @@ describe("todo-continuation-enforcer", () => { { info: { id: "msg-2", role: "assistant", error: { name: "MessageAbortedError" } } }, ] - const hook = createTodoContinuationEnforcer(createMockPluginInput(), {}) + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), {}) // #when - session goes idle without prior session.error event await hook.handler({ @@ -927,7 +927,7 @@ describe("todo-continuation-enforcer", () => { const sessionID = "main-model-preserve" setMainSession(sessionID) - const hook = createTodoContinuationEnforcer(createMockPluginInput(), { + const hook = createTodoContinuationEnforcerHook(createMockPluginInput(), { backgroundManager: createMockBackgroundManager(false), }) @@ -977,7 +977,7 @@ describe("todo-continuation-enforcer", () => { directory: "/tmp/test", } as any - const hook = createTodoContinuationEnforcer(mockInput, { + const hook = createTodoContinuationEnforcerHook(mockInput, { backgroundManager: createMockBackgroundManager(false), }) @@ -1029,7 +1029,7 @@ describe("todo-continuation-enforcer", () => { directory: "/tmp/test", } as any - const hook = createTodoContinuationEnforcer(mockInput, { + const hook = createTodoContinuationEnforcerHook(mockInput, { backgroundManager: createMockBackgroundManager(false), }) @@ -1073,7 +1073,7 @@ describe("todo-continuation-enforcer", () => { directory: "/tmp/test", } as any - const hook = createTodoContinuationEnforcer(mockInput, {}) + const hook = createTodoContinuationEnforcerHook(mockInput, {}) // #when - session goes idle await hook.handler({ @@ -1119,7 +1119,7 @@ describe("todo-continuation-enforcer", () => { directory: "/tmp/test", } as any - const hook = createTodoContinuationEnforcer(mockInput, {}) + const hook = createTodoContinuationEnforcerHook(mockInput, {}) // #when - session goes idle await hook.handler({ @@ -1164,7 +1164,7 @@ describe("todo-continuation-enforcer", () => { directory: "/tmp/test", } as any - const hook = createTodoContinuationEnforcer(mockInput, { + const hook = createTodoContinuationEnforcerHook(mockInput, { skipAgents: [], }) diff --git a/src/hooks/todo-continuation-enforcer.ts b/src/hooks/todo-continuation-enforcer.ts index d93bd16d2..0508bdd71 100644 --- a/src/hooks/todo-continuation-enforcer.ts +++ b/src/hooks/todo-continuation-enforcer.ts @@ -91,7 +91,7 @@ function isLastAssistantMessageAborted(messages: Array<{ info?: MessageInfo }>): return errorName === "MessageAbortedError" || errorName === "AbortError" } -export function createTodoContinuationEnforcer( +export function createTodoContinuationEnforcerHook( ctx: PluginInput, options: TodoContinuationEnforcerOptions = {} ): TodoContinuationEnforcer { diff --git a/src/index.ts b/src/index.ts index f97410e13..17bb9c049 100644 --- a/src/index.ts +++ b/src/index.ts @@ -367,7 +367,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { }); const commands = discoverCommandsSync(); - const slashcommandTool = createSlashcommandTool({ + const slash_commandTool = createSlashcommandTool({ commands, skills: mergedSkills, }); @@ -391,7 +391,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { delegate_task: delegateTask, skill: skillTool, skill_mcp: skillMcpTool, - slashcommand: slashcommandTool, + slash_command: slash_commandTool, interactive_bash, }, @@ -622,7 +622,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { }; } - if (ralphLoop && input.tool === "slashcommand") { + if (ralphLoop && input.tool === "slash_command") { const args = output.args as { command?: string } | undefined; const command = args?.command?.replace(/^\//, "").toLowerCase(); const sessionID = input.sessionID || getMainSessionID(); diff --git a/src/plugin-handlers/config-handler.ts b/src/plugin-handlers/config-handler.ts index 471ce1d81..063228d21 100644 --- a/src/plugin-handlers/config-handler.ts +++ b/src/plugin-handlers/config-handler.ts @@ -208,13 +208,13 @@ export function createConfigHandler(deps: ConfigHandlerDeps) { buildConfigWithoutName as Record ); const openCodeBuilderOverride = - pluginConfig.agents?.["OpenCode-Builder"]; + pluginConfig.agents?.["opencode-builder"]; const openCodeBuilderBase = { ...migratedBuildConfig, description: `${configAgent?.build?.description ?? "Build agent"} (OpenCode default)`, }; - agentConfig["OpenCode-Builder"] = openCodeBuilderOverride + agentConfig["opencode-builder"] = openCodeBuilderOverride ? { ...openCodeBuilderBase, ...openCodeBuilderOverride } : openCodeBuilderBase; } diff --git a/src/tools/slashcommand/index.ts b/src/tools/slashcommand/index.ts index d3092023d..3da56df90 100644 --- a/src/tools/slashcommand/index.ts +++ b/src/tools/slashcommand/index.ts @@ -1,2 +1,2 @@ export * from "./types" -export { slashcommand, createSlashcommandTool, discoverCommandsSync } from "./tools" +export { slash_command, createSlashcommandTool, discoverCommandsSync } from "./tools" diff --git a/src/tools/slashcommand/tools.ts b/src/tools/slashcommand/tools.ts index b45695b7e..d773a6d30 100644 --- a/src/tools/slashcommand/tools.ts +++ b/src/tools/slashcommand/tools.ts @@ -269,4 +269,4 @@ export function createSlashcommandTool(options: SlashcommandToolOptions = {}): T } // Default instance for backward compatibility (lazy loading) -export const slashcommand: ToolDefinition = createSlashcommandTool() +export const slash_command: ToolDefinition = createSlashcommandTool()