Resolve tmux/cmux capability at startup so pane control remains tmux-driven while notifications prefer cmux and gracefully fall back to desktop notifications.
model_not_supported errors from providers (e.g. OpenAI returning
{"error": {"code": "model_not_supported"}}) were not recognized as
retryable. Subagents would silently fail with no response, hanging the
parent session.
Fix:
- Add "model_not_supported", "model not supported", "model is not
supported" to RETRYABLE_MESSAGE_PATTERNS in model-error-classifier.ts
- Add regex patterns to RETRYABLE_ERROR_PATTERNS in
runtime-fallback/constants.ts to match "model ... is ... not ...
supported" with flexible spacing
- Add regression test covering all three variations
Now model_not_supported errors trigger the normal fallback chain instead
of silent failure.
When opencode-skills plugin is registered alongside oh-my-openagent,
all user skills are loaded twice, causing 'Duplicate tool names detected'
warnings and HTTP 400 errors.
This fix:
1. Detects if opencode-skills plugin is loaded in opencode.json
2. Emits a startup warning explaining the conflict
3. Suggests fixes: either remove opencode-skills or disable skills in oh-my-openagent
Fixes#2881
Fire-and-forget session.abort() calls during subagent completion left
dangling promises that raced with parent session teardown. In Bun on
WSL2/Linux, this triggered a StringImplShape assertion (SIGABRT) as
WebKit GC collected string data still referenced by the inflight request.
Fix: await session.abort() in all four completion/error paths:
- startTask promptAsync error handler (launch path)
- resume promptAsync error handler (resume path)
- cancelTask (explicit cancel path)
- tryCompleteTask (normal completion path)
Also marks the two .catch() error callbacks as async so the await is
valid.
Test: update session.deleted cascade test to flush two microtask rounds
since cancelTask now awaits abort before cleanupPendingByParent.
The installer wrapper and postinstall script still hardcoded the old
oh-my-opencode-* platform package family. When users installed the renamed
npm package oh-my-openagent (for example via npx oh-my-openagent install on
WSL2/Linux), the main package installed correctly but the wrapper looked for
nonexistent optional binaries like oh-my-opencode-linux-x64.
Fix:
- derive packageBaseName from package.json at runtime in wrapper/postinstall
- thread packageBaseName through platform package candidate resolution
- keep legacy oh-my-opencode default as fallback
- add regression test for renamed package family
skill-context already filtered browser-related skills using the configured
browser provider, but the skill tool rebuilt discovery without forwarding
browserProvider. That caused skills like agent-browser to be prompt-visible
while skill() could still fail to resolve them unless browser_automation_engine.provider
was explicitly threaded through both paths.
Fix:
- pass skillContext.browserProvider from tool-registry into createSkillTool
- extend SkillLoadOptions with browserProvider
- forward browserProvider to getAllSkills()
- add regression tests for execution and description visibility
The skill tool previously only merged disk-discovered skills and preloaded
options.skills, so skills registered natively via ctx.skills (for example
from config.skills.paths or other plugins) were prompt-visible but not
discoverable by skill().
Fix:
- pass ctx.skills from tool-registry into createSkillTool
- extend SkillLoadOptions with nativeSkills accessor
- merge nativeSkills.all() results into getSkills()
- add test covering native PluginInput skill discovery
task_system now defaults to true instead of false. Users on opencode-go
or other plans were unable to invoke oracle or use subagent delegation
because experimental.task_system defaulted off.
The task system is the primary mechanism for oracle, explore, and other
subagent invocations — it should not be behind an experimental flag.
Users can still explicitly set experimental.task_system: false to opt out.
resolveSkillPathReferences: add looksLikeFilePath() guard that requires
a file extension or trailing slash before resolving @scope/package
references. npm packages like @mycom/my_mcp_tools@beta were incorrectly
being rewritten to absolute paths in skill templates.
2 new tests.
TTL (pruneStaleTasksAndNotifications) now resets on last activity:
- Uses task.progress.lastUpdate as TTL anchor for running tasks
(was always using startedAt, causing 30-min hard deadline)
- Added taskTtlMs config option for user-adjustable TTL
- Error message shows actual TTL duration, not hardcoded '30 minutes'
- 3 new tests for the new behavior
subagent-resolver: when falling back to matchedAgent.model for custom
subagents, verify the model is actually available via fuzzyMatchModel
before setting it as categoryModel. Prevents delegate_task from using
an unavailable model when the user's custom agent config references
a model they don't have access to.
Test updated to include the target model in available models mock.
- completedTaskSummaries now includes status and error info
- notifyParentSession: noReply=false for failed tasks so parent reacts
- Batch notification distinguishes successful vs failed/cancelled tasks
- notification-template updated to show task errors
- task-poller: session-gone tests (85 new lines)
- CI: add Bun shim to PATH for legacy plugin migration tests
When a subagent session disappears from the status registry (process
crashed), the main agent was waiting the full stale timeout before
acting. Fix:
- Add sessionGoneTimeoutMs config option (default 60s, vs 30min normal)
- task-poller: use shorter timeout when session is gone from status
- manager: verify session existence when gone, fail crashed tasks
immediately with descriptive error
- Add legacy-plugin-toast hook for #2823 migration warnings
- Update schema with new config option
- logLegacyPluginStartupWarning now emits console.warn (visible to user,
not just log file) when oh-my-opencode is detected in opencode.json
- Auto-migrates opencode.json plugin entry from oh-my-opencode to
oh-my-openagent (with backup)
- plugin-config.ts: add console.warn when loading legacy config filename
- test: 10 tests covering migration, console output, edge cases
Two issues fixed:
1. process-cleanup.ts used fire-and-forget void Promise for shutdown
handlers — now properly collects and awaits all cleanup promises
via Promise.allSettled, with dedup guard to prevent double cleanup
2. TmuxSessionManager was never registered for process cleanup —
now registered in create-managers.ts via registerManagerForCleanup
Also fixed setTimeout().unref() which could let the process exit
before cleanup completes.
Background subagents (explore/librarian) failed with auth errors because
resolveModelForDelegateTask() always picked the first fallback entry when
availableModels was empty — often an unauthenticated provider like xai
or opencode-go.
Fix: when connectedProvidersCache is populated, iterate fallback chain
and pick the first entry whose provider is in the connected set.
Legacy behavior preserved when cache is null (not yet populated).
- model-selection.ts: use readConnectedProvidersCache to filter fallback chain
- test: 4 new tests for connected-provider-aware resolution
lastCompactionTime was only set on successful compaction. When compaction
failed (rate limit, timeout, etc.), no cooldown was recorded, causing
immediate retries in an infinite loop.
Fix: set lastCompactionTime before the try block so both success and
failure respect the cooldown window.
- test: add failed-compaction cooldown enforcement test
- test: fix timeout retry test to advance past cooldown
The agent parameter was using raw config key "atlas" but the SDK
expects the display name "Atlas (Plan Executor)". This caused
"Agent not found: 'atlas'" errors when auto-compact tried to
continue boulder execution.
Root cause: injectBoulderContinuation passed raw agent key to
session.promptAsync, but SDK's agent matching logic compares
against display names registered in the system.
Fix: Use getAgentDisplayName() to convert the config key to
the expected display name before passing to the SDK.
The server-health module used module-level state for inProcessServerRunning,
which doesn't survive when Bun loads separate module instances in the same
process. Fix: use globalThis with Symbol.for key so the flag is truly
process-global.
- server-health.ts: replace module-level boolean with globalThis[Symbol.for()]
- export markServerRunningInProcess from tmux-utils barrel
- test: verify flag skips HTTP fetch, verify globalThis persistence
When .sisyphus/ is gitignored, task state written during worktree execution
is lost when the worktree is removed. Fix:
- add worktree-sync.ts: syncSisyphusStateFromWorktree() copies .sisyphus/
contents from worktree to main repo directory
- update start-work.ts template: documents the sync step as CRITICAL when
worktree_path is set in boulder.json
- update work-with-pr/SKILL.md: adds explicit sync step before worktree removal
- export from boulder-state index
- test: 5 scenarios covering no-.sisyphus, nested dirs, overwrite stale state
- fix(switcher): use lastIndexOf for multi-slash model IDs (e.g. aws/anthropic/claude-sonnet-4)
- fix(model-resolution): same lastIndexOf fix in doctor parseProviderModel
- fix(call-omo-agent): resolve model from agent config and forward to both
background and sync executors via DelegatedModelConfig
- fix(subagent-resolver): inherit category model/variant when agent uses
category reference without explicit model override
- test: add model override forwarding tests for call-omo-agent
- test: add multi-slash model ID test for switcher
- fix(context-limit): check modelContextLimitsCache for all Anthropic
models, not just GA-model set; user config/cache wins over 200K default
(fixes#2836)
- fix(agent-key-remapper): preserve config key aliases alongside display
names so `opencode run --agent sisyphus` resolves correctly
(fixes#2858)
- fix(tool-config): respect host permission.skill=deny by disabling
skill/skill_mcp tools when host denies them (fixes#2873)
- test: update context-limit and agent-key-remapper tests to match new
behavior
Models frequently hallucinate a 'directory' parameter alongside filePath,
causing hard failures. Instead of rejecting, accept directory as an alias
for filePath and gracefully handle when both are provided (prefer filePath).
This prevents the 'filePath and directory are mutually exclusive' error
that users hit when models pass both parameters.
Fixes model confusion with lsp_diagnostics tool parameters.
Apply the same mock.module() isolation fixes to publish.yml:
- Move shared and session-recovery mock-heavy tests to isolated section
- Use dynamic find + exclusion for remaining src/shared tests
- Include session-recovery tests in remaining batch
Ensures publish workflow has the same test config as main CI run.
Move 4 src/shared tests that use mock.module() to the isolated test section:
- model-capabilities.test.ts (mocks ./connected-providers-cache)
- log-legacy-plugin-startup-warning.test.ts (mocks ./legacy-plugin-warning)
- model-error-classifier.test.ts
- opencode-message-dir.test.ts
Also isolate recover-tool-result-missing.test.ts (mocks ./storage).
Use find + exclusion pattern in remaining tests to dynamically build the
src/shared file list without the isolated mock-heavy files.
Fixes 6 Linux CI failures caused by bun's mock.module() cache pollution
when running in parallel.
Prevent src/shared batch runs from leaking module mocks into later files, which was breaking Linux CI cache metadata and legacy plugin warning assertions.
When recovering missing tool results, the session recovery hook was using
raw part.id (prt_* format) as tool_use_id when callID was absent, causing
ZodError validation failures from the API.
Added isValidToolUseID() guard that only accepts toolu_* and call_* prefixed
IDs, and normalizeMessagePart() that returns null for parts without valid
callIDs. Both the SQLite fallback and stored-parts paths now filter out
invalid entries before constructing tool_result payloads.
Includes 4 regression tests covering both valid/invalid callID paths for
both SQLite and stored-parts backends.
Pass explicit config dir to checkForLegacyPluginEntry instead of relying
on XDG_CONFIG_HOME env var, which gets contaminated by parallel tests on
Linux CI. Also adds missing 'join' import.
The opencode-project-command-discovery test used execFileSync for git init,
which collided with image-converter.test.ts's global execFileSync mock when
running in parallel on Linux CI. Switching to Bun.spawnSync avoids the mock
entirely since spyOn(childProcess, 'execFileSync') doesn't affect Bun APIs.
Fixes CI flake that only reproduced on Linux.
- Add legacy plugin startup warning when oh-my-opencode config detected
- Update CLI installer and TUI installer for new package name
- Split monolithic config-manager.test.ts into focused test modules
- Add plugin config detection tests for legacy name fallback
- Update processed-command-store to use plugin-identity constants
- Add claude-code-plugin-loader discovery test for both config names
- Update chat-params and ultrawork-db tests for plugin identity
Part of #2823
Updated across README (all locales), docs/guide/, docs/reference/,
docs/examples/, AGENTS.md files, and test expectations/snapshots.
The deep category and multimodal-looker still use gpt-5.3-codex as
those are separate from the hephaestus agent.
Hephaestus now uses gpt-5.4 as its default model across all providers
(openai, github-copilot, venice, opencode), matching Sisyphus's GPT 5.4
support. The separate gpt-5.3-codex → github-copilot fallback entry is
removed since gpt-5.4 is available on all required providers.
Mock connected-providers-cache in model-capabilities.test.ts to prevent
findProviderModelMetadata from reading disk-cached model metadata.
Without this mock, the 'prefers runtime models.dev cache' test gets
polluted by real cached data from opencode serve runs, causing the
test to receive different maxOutputTokens/supportsTemperature values
than the mock runtime snapshot provides.
This was the last CI-only failure — passes locally with cache, fails
on CI without cache, now passes everywhere via mock isolation.
Full suite: 4484 pass, 0 fail.
Sisyphus-authored fixes across 15 files:
- plugin-identity: align CONFIG_BASENAME with actual config file name
- add-plugin-to-opencode-config: handle legacy→canonical name migration
- plugin-detection tests: update expectations for new identity constants
- doctor/system: fix legacy name warning test assertions
- install tests: align with new plugin name
- chat-params tests: fix mock isolation
- model-capabilities tests: fix snapshot expectations
- image-converter: fix platform-dependent test assertions (Linux CI)
- example configs: expanded with more detailed comments
Full suite: 4484 pass, 0 fail, typecheck clean.
- Doctor now detects when opencode.json references 'oh-my-opencode'
(legacy name) and warns users to switch to 'oh-my-openagent' with
the exact replacement string.
- Added 3 example config files in docs/examples/:
- default.jsonc: balanced setup with all agents documented
- coding-focused.jsonc: Sisyphus + Hephaestus heavy
- planning-focused.jsonc: Prometheus + Atlas heavy
All examples include every agent (sisyphus, hephaestus, atlas,
prometheus, explore, librarian) with model recommendations.
Helps with #2823
When provider-models cache is cold (first run / cache miss),
resolveModelForDelegateTask returns {skipped: true}. Previously this
caused the subagent resolver to:
1. Ignore the user's explicit model override (e.g. explore.model)
2. Fall through to the hardcoded fallback chain which may contain
model IDs that don't exist in the provider catalog
Now:
- subagent-resolver: if resolution is skipped but user explicitly
configured a model, use it directly
- subagent-resolver: don't assign hardcoded fallback chain on skip
- category-resolver: same — don't leak hardcoded chain on skip
- general-agents: if user model fails resolution, use it as-is
instead of falling back to hardcoded chain first entry
Closes#2820
- model-fallback hook: mock selectFallbackProvider and add _resetForTesting()
to test-setup.ts to clear module-level state between files
- fallback-retry-handler: add afterAll(mock.restore) and use mockReturnValueOnce
to prevent connected-providers mock leaking to subsequent test files
- opencode-config-dir: use win32.join for Windows APPDATA path construction
so tests pass on macOS (path.join uses POSIX semantics regardless of
process.platform override)
- system-loaded-version: use resolveSymlink from file-utils instead of
realpathSync to handle macOS /var -> /private/var symlink consistently
All 4456 tests pass (0 failures) on full bun test suite.
Inject an explicit `order` field (1-4) into the four core agents
(Sisyphus, Hephaestus, Prometheus, Atlas) via reorderAgentsByPriority().
This pre-empts OpenCode's alphabetical agent sorting so the intended
Tab cycle order is preserved once OpenCode merges order field support
(anomalyco/opencode#19127).
Refs anomalyco/opencode#7372
Replace isExtendedThinkingModel() model-name check with hasSignedThinkingBlocksInHistory()
which scans message history for real Anthropic-signed thinking blocks.
Content-based gating is more robust than model-name checks — works correctly
with custom model IDs, proxied models, and new model releases without code changes.
- Add isSignedThinkingPart() that matches type thinking/redacted_thinking with valid signature
- Skip synthetic parts (injected by previous hook runs)
- GPT reasoning blocks (type=reasoning, no signature) correctly excluded
- Add comprehensive tests: signed injection, redacted_thinking, reasoning negative case, synthetic skip
Inspired by PR #2653 content-based approach, combined with redacted_thinking support from 0732cb85.
Ultraworked with Sisyphus
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Registry-based model family detection (provider-agnostic)
- Variant and reasoningEffort ladder downgrade logic
- Three-tier resolution: metadata override → family heuristic → unknown drop
- Comprehensive test suite covering all model families
Add support for object-style entries in fallback_models arrays, enabling
per-model configuration of variant, reasoningEffort, temperature, top_p,
maxTokens, and thinking settings.
- Zod schema for FallbackModelObject with full validation
- normalizeFallbackModels() and flattenToFallbackModelStrings() utilities
- Provider-agnostic model resolution pipeline with fallback chain
- Session prompt params state management
- Fallback chain construction with prefix-match lookup
- Integration across delegate-task, background-agent, and plugin layers
Scoped packages like @scope/pkg were truncated to just 'pkg' because
basename() strips the scope prefix. Fix:
- Detect scoped packages (starting with @) and find version separator
after the scope slash, not at the leading @
- Return full scoped name (@scope/pkg) instead of calling basename
- Add regression test for scoped package name preservation
The test name claimed it exercised RETRYABLE_ERROR_PATTERNS directly,
but classifyErrorType actually matches 'payment required' via the
quota_exceeded path first. Rename to 'detects payment required errors
as retryable' to accurately describe end-to-end behavior.
- Gate semantic detection on promise === 'DONE' in both transcript and
session message paths to prevent false positives on VERIFIED promises
- Restrict transcript semantic fallback to assistant/text entries only,
skipping tool_use/tool_result to avoid matching file content
- Add regression test for VERIFIED promise not triggering semantic detection
Use port 0 fallback when findAvailablePort fails, read the actual bound
port from server.port. Tests refactored to use mock server when real
socket binding is unavailable in CI.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously, when an explicit model was configured, the agent name was
omitted to prevent opencode's built-in agent fallback chain from
overriding the user-specified model. This removes that conditional logic
and always passes the agent name alongside the model. Tests are updated
to reflect this behavior change.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep BackgroundManager launch and resume from sending both agent and model so OpenCode does not override configured subagent models. Add launch and resume regressions for the live production path.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Reuse the stored model only for subsequent main-session messages when the UI provides no model, while preserving first-message behavior, explicit overrides, and subagent isolation.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Reuse the current session's selected model during config-time agent rebuilds when config.model is missing, so desktop sessions do not snap back to the default model after each send.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Reuse signed Anthropic thinking blocks only when they can still sort before the target message's parts, otherwise skip recovery instead of reintroducing invalid loops.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The existing normalizeToolArgSchemas only applies to omo plugin tools
(via tool-registry.ts), but MCP server tool schemas bypass this
sanitization entirely. MCP schemas with contentEncoding/contentMediaType
cause Gemini 400 errors.
Add sanitizeJsonSchema() to strip unsupported keywords from MCP tool
inputSchema before serialization in formatMcpCapabilities.
Fixes#2200
Supersedes #2666
- Add missing clearSessionState() call after successful summarize (line 117)
Without this, retry state persisted even after success, potentially causing
unnecessary retries on subsequent compaction events.
- Fix timing-sensitive test: adjust attempt=0 and firstAttemptTime to give
proper remainingTimeMs buffer for capped delay calculation.
Fixes#2225
Supersedes #2671
Three agent builder files used falsy checks that incorrectly nullified
uiSelectedModel when override objects existed but had no model set:
- sisyphus-agent.ts: `?.model ?` → `?.model !== undefined ?`
- atlas-agent.ts: `?.model ?` → `?.model !== undefined ?`
- general-agents.ts: `!override?.model` → `override?.model === undefined`
This caused user model selection in web mode to revert to defaults.
Fixes#2351
The spread order in applyToolConfig was incorrect - omo's external_directory: 'allow'
was placed BEFORE the config.permission spread, allowing opencode's default 'ask' to
overwrite it. This caused write/edit tools to hang on headless opencode serve sessions
(no TUI to approve permission prompts).
Move omo's permission overrides AFTER the base config spread so they always win.
Fixes write/edit tool hangs when running opencode serve headlessly.
- Added TIP box linking to #building-in-public Discord channel
- Mentions Jobdori AI assistant (built on heavily customized OpenClaw)
- Added to all 5 language variants (EN, KO, JA, ZH-CN, RU)
- Positioned above waitlist section for visibility
- Remove leading pipe characters (|) from duplicated CORRECT block
- Remove duplicated ## Hard Constraints and ### Task Scope Clarification sections
- Properly place Task Scope Clarification section between CORRECT list and Hard Constraints
Addresses review comments by cubic-dev-ai[bot] on PR #2780
- #2741: Pass inheritedModel as fallback in subagent-resolver when user hasn't
configured an override, ensuring custom provider models take priority
- #2648: Fix getPlanProgress to treat plans with 0 checkboxes as incomplete
instead of complete (total > 0 && completed === total)
- #2779: Relax Hephaestus single-task guard to accept multi-step sub-tasks
from Atlas delegation, only rejecting genuinely independent tasks
Fixes#2741, fixes#2648, fixes#2779
Tests 'should use default timeout when config not provided' (manager.test.ts)
and 'should use DEFAULT_MESSAGE_STALENESS_TIMEOUT_MS when not configured'
(task-poller.test.ts) failed in CI because Date.now() drifted between
test setup (when creating timestamps like Date.now() - 46*60*1000) and
actual execution inside checkAndInterruptStaleTasks().
On slower CI machines, this drift pushed borderline values across
the threshold, causing tasks that should be stale to remain 'running'.
Fix: Mock Date.now with spyOn to return a fixed time, ensuring
consistent timeout calculations regardless of execution speed.
The first test case 'non-TUI mode: should show warning but continue when
OpenCode binary not found' was missing a globalThis.fetch mock, causing it
to make a real HTTP request to npm registry via fetchNpmDistTags().
The npm fetch timeout (5s) collided with the test timeout (5s), causing
flaky CI failures.
Added the same fetch mock pattern already used by the other two test cases.
Test runtime dropped from 5000ms+ to ~2ms.
- Upgrade minimax-m2.5 → minimax-m2.7 (latest model) across all agents and categories
- Replace minimax-m2.5-free with minimax-m2.7-highspeed (optimized speed variant)
- Expand MiniMax fallback coverage to atlas, sisyphus-junior, writing, and unspecified-low
- Add isMiniMaxModel() detection function in types.ts for model family detection
- Update all tests (58 passing) and documentation
Tests prove rootDescendantCounts is never decremented on task completion,
cancellation, or error — making maxDescendants a lifetime quota instead of
a concurrent-active cap. All 4 tests fail (RED phase) before the fix.
Refs: code-yeongyu/oh-my-openagent#2700
rootDescendantCounts was incremented on every spawn but never decremented
when tasks reached terminal states (completed, cancelled, error, interrupt,
stale-pruned). This made maxDescendants=50 a session-lifetime quota instead
of its intended semantics as a concurrent-active agent cap.
Fix: add unregisterRootDescendant() in five terminal-state handlers:
- tryCompleteTask(): task completes successfully
- cancelTask(): running task cancelled (wasRunning guard prevents
double-decrement for pending tasks already handled by
rollbackPreStartDescendantReservation)
- session.error handler: task errors
- promptAsync catch (startTask): task interrupted on launch
- promptAsync catch (resume): task interrupted on resume
- onTaskPruned callback: stale task pruned (wasPending guard)
Fixes: code-yeongyu/oh-my-openagent#2700
The LSP `initialize` request expects custom server options in the
`initializationOptions` field, but the code was spreading
`this.server.initialization` directly into the root params object.
This caused LSP servers that depend on `initializationOptions`
(like ets-language-server, pyright, etc.) to not receive their
configuration.
Closes#2665
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Oracle's <promise>VERIFIED</promise> arrives as a tool_result part from the
task() tool call, not as a text part. Both detectCompletionInSessionMessages
and collectAssistantText only scanned type=text parts, missing the
verification signal entirely. This caused ulw loops to fail verification
even when Oracle successfully emitted VERIFIED.
Include tool_result parts in promise detection alongside text parts.
Exclude tool_use parts to avoid false positives from instructional text.
Oracle's <promise>VERIFIED</promise> arrives as a tool_result part from the
task() tool call, not as a text part. Both detectCompletionInSessionMessages
and collectAssistantText only scanned type=text parts, missing the
verification signal entirely. This caused ulw loops to fail verification
even when Oracle successfully emitted VERIFIED.
Include tool_result parts in promise detection alongside text parts.
Exclude tool_use parts to avoid false positives from instructional text.
- Add buildContextualContinuationPrompt to include assistant message context
- Move extractPermissionPhrase to detector module for better separation
- Block continuation injection in subagent sessions
- Update handler to use contextual prompts with last response context
- Add tests for subagent session blocking and contextual prompts
- Update todo coordination test to verify new prompt format
🤖 Generated with assistance of OhMyOpenCode
When the resource URL has a sub-path (e.g. https://mcp.sentry.dev/mcp),
the RFC 8414 path-suffixed well-known URL may not exist. Fall back to
the root well-known URL before giving up.
This matches OpenCode core's behavior and fixes authentication for
servers like Sentry that serve OAuth metadata only at the root path.
Add [TODO-DIAG] console.error statements throughout the todo continuation
enforcer to help diagnose why continuation prompts aren't being injected.
Changes:
- Add session.idle event handler diagnostic in handler.ts
- Add detailed blocking reason logging in idle-event.ts for all gate checks
- Update JSON schema to reflect circuit breaker config changes
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Switch background task loop detection from percentage-based sliding window
(80% of 20-call window) to consecutive same-tool counting. Triggers when
same tool signature is called 20+ times in a row; a different tool resets
the counter.
- error-classifier: pre-compile default retry pattern regex
- think-mode/detector: combine multilingual patterns into single regex
- parser: skip redundant toLowerCase on pre-lowered keywords
- edit-operations: use fast arraysEqual instead of JSON comparison
- hash-computation: optimize streaming line extraction with index tracking
Move loadClaudeHooksConfig and loadPluginExtendedConfig after isHookDisabled check
in both tool-execute-before and tool-execute-after handlers to skip 5 file reads
per tool call when hooks are disabled (C1)
- Replace countedToolPartIDs string[] with Set<string> for O(1) has/add vs O(n) includes/spread (C2)
- Cache resolveCircuitBreakerSettings at manager level to avoid repeated object creation (C3)
- Optimize recordToolCall to avoid full array copy with slice (L1)
Previously, pollRunningTasks() and checkAndInterruptStaleTasks() treated
any non-"idle" session status as "still running", which caused tasks with
terminal statuses like "interrupted" to be skipped indefinitely — both
for completion detection AND stale timeout. This made the parent session
hang forever waiting for an ALL COMPLETE notification that never came.
Extract isActiveSessionStatus() and isTerminalSessionStatus() that
classify session statuses explicitly. Only known active statuses
("busy", "retry", "running") protect tasks from completion/stale checks.
Known terminal statuses ("interrupted") trigger immediate completion.
Unknown statuses fall through to the standard idle/gone path with output
validation as a conservative default.
Introduced by: a0c93816 (2026-02-14), dc370f7f (2026-03-08)
- connected-providers-cache: extract factory pattern (createConnectedProvidersCacheStore) for testable cache dir injection
- port-utils.test: environment-independent tests with real socket probing and contiguous port detection
- resolve-file-uri.test: mock homedir instead of touching real home directory
- github-triage: update SKILL.md
When Oracle verification fails in ulw-loop mode, the previous Oracle
session was never aborted before restarting. Each retry created a new
descendant session, causing unbounded session accumulation and 500
errors from server overload.
Now abort the old verification session before:
- restarting the loop after failed verification
- re-entering verification phase on subsequent DONE detection
After Anthropic's 1M context GA (2026-03-13), the beta header is no
longer sent. The existing detection relied solely on the beta header
to set anthropicContext1MEnabled, causing all Anthropic models to
fall back to the 200K default despite models.dev reporting 1M.
Update resolveActualContextLimit to check per-model cached limits
from provider config (populated from models.dev data) when the
explicit 1M flag is not set. Priority order:
1. Explicit 1M mode (beta header or env var) - all Anthropic models
2. Per-model cached limit from provider config
3. Default 200K fallback
This preserves the #2460 fix (explicit 1M flag always wins over
cached values) while allowing GA models to use their correct limits.
Fixes premature context warnings at 140K and unnecessary compaction
at 156K for opus-4-6 and sonnet-4-6 users without env var workaround.
- Change worktree behavior: default to current directory, worktree only with --worktree flag
- Add mandatory TASK BREAKDOWN section with granular sub-task requirements
- Add WORKTREE COMPLETION section for merging worktree branches back
🤖 Generated with assistance of OhMyOpenCode
The publish step was updating name and optionalDependencies but not
version, causing npm to try publishing the base package.json version
(3.11.0) instead of the release version (3.12.0).
Error was: 'You cannot publish over the previously published versions: 3.11.0'
- publish-platform.yml: Build job now checks BOTH oh-my-opencode and
oh-my-openagent before skipping. Build only skips when both are published.
Added 'Publish oh-my-openagent-{platform}' step that renames package.json
and publishes under the openagent name.
- publish.yml: Added 'Publish oh-my-openagent' step after opencode publish.
Rewrites package name and optionalDependencies to oh-my-openagent variants,
then publishes. Restores package.json after.
Previously, oh-my-openagent platform packages were never published because
the build skip check only looked at oh-my-opencode (which was already published),
causing the entire build to be skipped.
cubic identified potential race condition where Bun's proc.exitCode
may be null immediately after stdout closes. Added clarifying
comment that await proc.exited ensures exitCode is set before
checking.
fixes: cubic review on PR #2620
- Add XML-structured description (<must>, <operations>, <examples>, <auto>)
- Add 5 concrete examples including BAD pattern showing duplication
- Add explicit anti-duplication warning for range replace
- Move snapshot rule to top-level <must> section
- Clarify batch semantics (multiple ops, not one big replace)
- Fix lines schema: add string[] to union (was string|null, now string[]|string|null)
- Matches runtime RawHashlineEdit type and description text
Display resolved model ID (e.g., gpt-5.3-codex: deep) instead of
agent/category format when modelInfo is available. Falls back to
old format when no model info exists.
The verification_session_id was never reliably set because the
prompt-based attempt_id matching in tool-execute-after depends on
metadata.prompt surviving the delegate-task execution chain. When
this fails silently, the loop never detects Oracle's VERIFIED
emission.
Add a fallback: when exact attempt_id matching fails but oracle
agent + verification_pending state match, still set the session ID.
Add diagnostic logging to trace verification flow failures.
Add integration test covering the full verification chain.
Remove the auto-defaulting logic from PR #2420 that silently set
run_in_background=false when category/subagent_type/session_id was present.
The tool description falsely claimed 'Default: false' which misled agents
into omitting the parameter. Now the description says REQUIRED and the
validation always throws when the parameter is missing, with a clear
error message guiding the agent to retry with the correct value.
Reverts the behavioral change from #2420 while keeping the issue's
root cause (misleading description) fixed.
The nullish-coalescing chain could stop at a non-numeric value (e.g.
status: "error"), preventing deeper nested numeric statusCode values
from being reached. Switch to Array.find() with a type guard to always
select the first numeric value.
Adds 11 tests for extractStatusCode covering: top-level, nested
(data/error/cause), non-numeric skip, fallback to regex, and
precedence.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AI SDK wraps HTTP status codes inside error.error.statusCode (e.g., AI_APICallError). The current extractStatusCode only checks the top level, missing these nested codes.
This caused runtime-fallback to skip retryable errors like 400, 500, 504 because it couldn't find the status code.
Fixes#2617
The opencode/glm-4.7-free model was removed from the OpenCode platform,
causing the ULTIMATE_FALLBACK in the CLI installer to point to a dead
model. Users installing OMO without any major provider configured would
get a non-functional model assignment.
Replaced with opencode/gpt-5-nano which is confirmed available per
user reports and existing fallback chains in model-requirements.ts.
Fixes#2101
The default_builder_enabled config defaults to false, which removes
the default OpenCode Build agent on OMO install. This forces users
into the full OMO orchestration for every task, including simple ones
where the lightweight Build agent would be more appropriate.
Changed the default to true so the Build agent remains available
alongside Sisyphus. Users who prefer the previous behavior can set
default_builder_enabled: false in their config.
Fixes#2545
Renames all environment variable gates from the old oh-my-codex (OMX) prefix
to the correct oh-my-openagent (OMO) prefix:
- OMX_OPENCLAW -> OMO_OPENCLAW
- OMX_OPENCLAW_COMMAND -> OMO_OPENCLAW_COMMAND
- OMX_OPENCLAW_DEBUG -> OMO_OPENCLAW_DEBUG
- OMX_OPENCLAW_COMMAND_TIMEOUT_MS -> OMO_OPENCLAW_COMMAND_TIMEOUT_MS
Adds TDD tests verifying:
- OMO_OPENCLAW=1 is required for activation
- Old OMX_OPENCLAW env var is not accepted
Ports the OMX OpenClaw module into oh-my-openagent as a first-class integration.
This integration allows forwarding internal events (session lifecycle, tool execution) to external gateways (HTTP or command-based).
- Added `src/openclaw` directory with implementation:
- `dispatcher.ts`: Handles HTTP/Command dispatching with interpolation
- `types.ts`: TypeScript definitions
- `client.ts`: Main entry point `wakeOpenClaw`
- `index.ts`: Public API
- Added `src/config/schema/openclaw.ts` for Zod schema validation
- Updated `src/config/schema/oh-my-opencode-config.ts` to include `openclaw` config
- Added `src/hooks/openclaw-sender/index.ts` to listen for events
- Registered the hook in `src/plugin/hooks/create-session-hooks.ts`
- Added unit tests in `src/openclaw/__tests__`
Events handled:
- `session-start` (via `session.created`)
- `session-end` (via `session.deleted`)
- `session-idle` (via `session.idle`)
- `ask-user-question` (via `tool.execute.before` for `ask_user_question`)
- `stop` (via `tool.execute.before` for `stop-continuation` command)
When an agent configured with variant: "max" falls back from Opus to
Sonnet (or Haiku), the "max" variant was passed through unchanged.
OpenCode sends this as level: "max" to the Anthropic API, which rejects
it with: level "max" not supported, valid levels: low, medium, high
The anthropic-effort hook previously only handled Opus (inject effort=max)
and skipped all other Claude models. Now it actively clamps "max" → "high"
for non-Opus Claude models and mutates message.variant so OpenCode
doesn't pass the unsupported level to the API.
When Gemini returns a quota exhausted error, OpenCode auto-retries and
fires session.status with type='retry'. The extractAutoRetrySignal
function requires BOTH 'retrying in' text AND a quota pattern to match,
but some providers (like Gemini) include only the error text in the
retry message without the 'retrying in' phrase.
Since status.type='retry' already confirms this is a retry event, the
fix adds a fallback check: if extractAutoRetrySignal fails, check the
message directly against RETRYABLE_ERROR_PATTERNS. This ensures quota
errors like 'exhausted your capacity' trigger the fallback chain even
when the retry message format differs from expected.
Fixes#2454
Adds a configurable maxToolCalls limit (default: 200) that automatically
cancels background tasks when they exceed the threshold. This prevents
runaway subagent loops from burning unlimited tokens, as reported in #2571
where a Gemini subagent ran 809 consecutive tool calls over 3.5 hours
costing ~$350.
The circuit breaker triggers in the existing tool call tracking path
(message.part.updated/delta events) and cancels the task with a clear
error message explaining what happened. The limit is configurable via
background_task.maxToolCalls in oh-my-opencode.jsonc.
Fixes#2571
The todo-continuation-enforcer injects continuation prompts when
sessions go idle with pending todos. When Plan Mode agents (which are
read-only) create todo items, the continuation prompt contradicts
Plan Mode's STRICTLY FORBIDDEN directive, causing an infinite loop
where the agent acknowledges the conflict then goes idle, triggering
another injection.
Adding 'plan' to DEFAULT_SKIP_AGENTS prevents continuation injection
into Plan Mode sessions, matching the same exclusion pattern already
used for prometheus and compaction agents.
Fixes#2526
Removes both the isFirstRunNoCache and override?.model guards from
the fallback logic in collectPendingBuiltinAgents(). Previously, when
a user configured a model like minimax/MiniMax-M2.5 that wasn't in
availableModels, the agent was silently excluded and --agent Librarian
would crash with 'undefined is not an object'.
Now: if applyModelResolution() fails for ANY reason (cache state,
unavailable model, config merge issue), getFirstFallbackModel() is
always attempted. A log warning is emitted when a user-configured
model couldn't be resolved, making the previously silent failure
visible.
Supersedes #2517Fixes#2427
Keep installer, config detection, schema generation, and publish workflows aligned with the long-lived oh-my-opencode package so this release does not split across two npm names.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Reject invalid --opencode-go values during non-TUI installs and detect existing OpenCode Go usage from the generated oh-my-opencode config so updates preserve the right defaults.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Keep install-time and runtime model tables in sync, stop OpenAI-only misrouting when OpenCode Go is present, and add valid OpenAI fallbacks for atlas, metis, and sisyphus-junior.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Allow legitimate repeated slash commands in long sessions by replacing session-lifetime dedup with a short-lived TTL cache.
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Keep persisted LINE#ID anchors working after strict whitespace hashing by falling back to the legacy hash for validation-only lookups.
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The header line was showing all extensions unioned together which was
redundant with the per-server detail lines below and caused line overflow.
Status mode also simplified to just show server count.
Replace the hardcoded 4-server list in doctor LSP check with getAllServers()
from server-resolution.ts, which covers all 40+ builtin servers plus user
config. Output now shows server count with supported extensions, and verbose
mode expands to per-server detail lines.
Status: LSP 3 servers (.go, .py, .pyi, .ts, .tsx)
Verbose: LSP 3 servers (.go, .py, .pyi, .ts, .tsx)
typescript (.ts, .tsx, .js, .jsx)
pyright (.py, .pyi)
gopls (.go)
Closes#2587
PR #2424 fixed the critical bug (passing client object instead of agent
summaries array), but only included user, project, and raw plugin agents.
This adds the two missing sources:
- OpenCode native config agents (params.config.agent)
- Plugin agents with migrateAgentConfig applied before summary extraction
Ensures Sisyphus has complete awareness of all registered agent sources.
Closes#2386
Co-authored-by: NS Cola <123285105+davincilll@users.noreply.github.com>
Windows CLI tests were not deleting XDG_CONFIG_HOME, making them
fragile in environments where this variable is set. getCliConfigDir()
reads XDG_CONFIG_HOME on all platforms, not just Linux.
Filter out null, undefined, or malformed entries in installed_plugins.json
before accessing properties. Prevents fatal crash on corrupted data.
Addresses cubic-dev-ai review feedback.
mapClaudeModelToOpenCode() returns {providerID, modelID} but opencode
expects model as a string. Both agent loaders now convert to
'providerID/modelID' string format before assigning to config.
Update CLI config manager to detect and handle both legacy (oh-my-opencode)
and new (oh-my-openagent) package names during installation. Migration
will automatically replace old plugin entries with the new name.
🤖 Generated with assistance of OhMyOpenCode
Update build script to generate both oh-my-opencode.schema.json (backward
compatibility) and oh-my-openagent.schema.json (new package name).
Also adds delegate-task-english-directive hook to schema.
🤖 Generated with assistance of OhMyOpenCode
Add centralized plugin identity constants to support migration from
oh-my-opencode to oh-my-openagent. Includes both current and legacy
names for backward compatibility.
🤖 Generated with assistance of OhMyOpenCode
Phase 0 now runs /get-unpublished-changes as single source of truth
instead of manual bash commands. Phase 1 uses its output for grouping.
Layer 2 explicitly references /review-work skill flow.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
disabled_tools was defined in the Zod schema but omitted from
mergeConfigs(), causing project-level config to shadow user-level
disabled_tools instead of merging both sets. Add Set union and
regression test.
Closes#2555
When a category has no CATEGORY_MODEL_REQUIREMENTS entry (e.g.
user-defined categories like solana-re), the !requirement branch
set actualModel but never built categoryModel with variant from
the user config. The bottom fallback then created categoryModel
via parseModelString alone, silently dropping the variant.
Mirror the requirement branch logic: read variant from
userCategories and resolved.config, and build categoryModel
with it.
Fixes#2538
Refine continuation agent resolution to prefer session-state agent fallback while keeping compaction-specific protection. Replace sticky boolean compaction flag with a short-lived timestamp guard so unresolved agents are blocked only during the immediate post-compaction window, avoiding long-lived suppression and preserving existing continuation behavior.
After compaction, message history is truncated and the original agent
(e.g. Prometheus) can no longer be resolved from messages. The todo
continuation enforcer would then inject a continuation prompt with
agent=undefined, causing the host to default to General -- which has
write permissions Prometheus should never have.
Root cause chain:
1. handler.ts had no session.compacted handler (unlike Atlas)
2. idle-event.ts relied on finding a compaction marker in truncated
message history -- the marker disappears after real compaction
3. continuation-injection.ts proceeded when agentName was undefined
because the skipAgents check only matched truthy agent names
4. prometheus-md-only/agent-resolution.ts did not filter compaction
agent from message history fallback results
Fixes:
- Add session.compacted handler that sets hasRecentCompaction state flag
- Replace fragile history-based compaction detection with state flag
- Block continuation injection when agent is unknown post-compaction
- Filter compaction agent in Prometheus agent resolution fallback
Keep background task metadata aligned with the background_output contract so callers do not pass a session id where the task manager expects a background task id.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Removes in-memory caching so newly created skills mid-session are
immediately available via skill(). Clears the module-level skill cache
before each getAllSkills() call. Pre-provided skills from options are
merged as fallbacks for test compatibility.
OPENCODE_CONFIG_DIR pointing to profiles/ subdirectory caused skills at
~/.config/opencode/skills/ to be invisible. Added getOpenCodeSkillDirs()
with the same parent-dir fallback that getOpenCodeCommandDirs() uses.
Skills now appear as <command> items with / prefix (e.g., /review-work)
instead of <skill> items, making them discoverable alongside regular
slash commands in the skill tool description.
Use namespace import pattern (import * as sender) to prevent cross-file
spy leakage in Bun's shared module state. Move restoreAllMocks to
beforeEach for proper cleanup ordering.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
Add CLI_AGENT_MODEL_REQUIREMENTS entry for sisyphus-junior with
fallback chain: claude-sonnet-4-6 -> kimi-k2.5 -> big-pickle.
🤖 Generated with assistance of OhMyOpenCode
Add mandatory explicit user okay before completing work in Final
Verification Wave. Present consolidated results and wait for user
confirmation before marking tasks complete.
🤖 Generated with assistance of OhMyOpenCode
runBunInstallWithDetails() defaulted to outputMode:"inherit", causing
bun install stdout/stderr to leak into the TUI when callers omitted the
option. Changed default to "pipe" so output is captured silently.
Also fixed stale mock in background-update-check.test.ts: the test was
mocking runBunInstall (unused) instead of runBunInstallWithDetails, and
returning boolean instead of BunInstallResult.
Before provider cache exists (first run), resolveModelForDelegateTask now
returns undefined instead of guessing a model. This lets OpenCode use its
system default model when no model is specified in the prompt body.
User-specified model overrides still take priority regardless of cache state.
Introduce git worktree list --porcelain parsing following upstream opencode patterns. Exports listWorktrees() for full worktree enumeration with branch info alongside existing detectWorktreePath().
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
When provider.list is not available for SDK validation, do not apply the configured ultrawork variant. This prevents models without a max variant from being incorrectly forced to max when ultrawork mode activates.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Prevent the cache test from deleting the user cache directory and add a regression test for that setup path.
Co-authored-by: Codex <noreply@openai.com>
Previously computeLineHash stripped ALL whitespace before hashing, making
indentation changes invisible to hash validation. This weakened the stale-line
detection guarantee, especially for indentation-sensitive files (Python, YAML).
Now only trailing whitespace and carriage returns are stripped, matching
oh-my-pi upstream behavior. Leading indentation is preserved in the hash,
so indentation-only changes correctly trigger hash mismatches.
- Reorder resolveFallbackProviderID: providerHint now checked before global connected-provider cache
- Revert require('bun:test') hack to standard ESM import in fallback-chain-from-models.test.ts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The DEFAULT_CATEGORIES ultrabrain model was updated from openai/gpt-5.3-codex
to openai/gpt-5.4 in a previous commit, but test expectations were not updated.
Updated test expectations in:
- src/plugin-handlers/config-handler.test.ts (lines 560, 620)
- src/agents/utils.test.ts (lines 1119, 1232, 1234, 1301, 1303, 1316, 1318)
background-update-check.ts was using runBunInstall() which defaults to outputMode:"inherit", leaking bun install stdout/stderr into the background session. Reverted to runBunInstallWithDetails({ outputMode: "pipe" }) and explicitly logs result.error on failure.
Restores the accidentally deleted test case asserting that sibling dependencies (e.g. other:"1.0.0") are preserved in package.json after a plugin version sync.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The previous pattern `(-[\w.]+)?` used `\w` which excludes hyphens, causing versions like `1.2.3-alpha-1` and `1.2.3-rc-test` to be misclassified as unpinned tags. Updated both plugin-entry.ts and sync-package-json.ts (which share the definition) to the spec-compliant pattern that allows dot-separated identifiers using [0-9A-Za-z-] and optional build metadata.
Also adds String() coercion before .trim() in sync-package-json.ts to guard against a TypeError if the parsed JSON value for currentVersion is non-string at runtime.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- MCP teardown race: add shutdownGeneration counter to prevent
in-flight connections from resurrecting after disconnectAll
- MCP multi-key disconnect race: replace disconnectedSessions Set
with generation-based Map to track per-session disconnect events
- MCP clients: check shutdownGeneration in stdio/http client
creators before inserting into state.clients
- BackgroundManager: call clearTaskHistoryWhenParentTasksGone after
timer-based task removal in scheduleTaskRemoval and notifyParentSession
- BackgroundManager: clean completedTaskSummaries when parent has
no remaining tasks
- Plugin dispose: remove duplicate tmuxSessionManager.cleanup call
since BackgroundManager.shutdown already handles it via onShutdown
Test expected timers only after allComplete, but H2 fix intentionally
decoupled per-task cleanup from sibling completion state. Updated
assertion to expect timer after individual task notification.
Plugin created managers, hooks, intervals, and process listeners on
every load but had no teardown mechanism. On plugin reload, old
instances remained alive causing cumulative memory leaks.
- Add createPluginDispose() orchestrating shutdown sequence:
backgroundManager.shutdown() → skillMcpManager.disconnectAll() →
disposeHooks()
- Add disposeHooks() aggregator with safe optional chaining
- Wire dispose into index.ts to clean previous instance on reload
- Make dispose idempotent (safe to call multiple times)
Tests: 4 pass, 8 expects
H3: cancelTask(skipNotification=true) now schedules task removal.
Previously the early return path skipped cleanup, leaking task objects
in this.tasks Map permanently. Extracted scheduleTaskRemoval() helper
called from both skipNotification and normal paths.
H2: Per-task completion cleanup timer decoupled from allComplete check.
Previously cleanup timer only ran when ALL sibling tasks completed. Now
each finished task gets its own removal timer regardless of siblings.
H1+C2: TaskHistory.clearAll() added and wired into shutdown(). Added
clearSession() calls on session error/deletion and prune cycles.
taskHistory was the only data structure missed by shutdown().
Tests: 10 pass (3 cancel + 3 completion + 4 history)
H7: Process 'exit'/'SIGINT' listeners registered per-session were
never removed when all sessions disconnected, accumulating handlers.
- Add unregisterProcessCleanup() called in disconnectAll()
H8: Race condition where disconnectSession() during pending connection
left orphan clients in state.clients.
- Add disconnectedSessions Set to track mid-flight disconnects
- Check disconnect marker after connection resolves, close if stale
- Clear marker on reconnection for same session
Tests: 6 pass (3 disconnect + 3 race)
When queryWindowState returned null during session deletion, the
session mapping was deleted but the real tmux pane stayed alive,
creating zombie panes.
- Add closePending/closeRetryCount fields to TrackedSession
- Mark sessions closePending instead of deleting on close failure
- Add retryPendingCloses() called from onSessionCreated and cleanup
- Force-remove mappings after 3 failed retry attempts
- Extract TrackedSessionState helper for field initialization
Tests: 3 pass, 9 expects
Prune interval created inside hook was not exposed for disposal,
preventing cleanup on plugin unload.
- Add dispose() method that clears the prune interval
- Export dispose in hook return type
Tests: 2 pass, 6 expects
setInterval for model availability monitoring was never cleared,
keeping the hook alive indefinitely with no dispose mechanism.
- Add dispose() method to RuntimeFallbackHook that clears interval
- Track intervalId in hook state for cleanup
- Export dispose in hook return type
Tests: 3 pass, 10 expects
Sync call_omo_agent leaked entries in global activeSessionMessages
and activeSessionToolResults Sets when execution threw errors,
since cleanup only ran on success path.
- Wrap session Set operations in try/finally blocks
- Ensure Set.delete() runs regardless of success/failure
- Add guard against double-cleanup
Tests: 2 pass, 14 expects
processedCommands and recentResults Sets grew infinitely because
Date.now() in dedup keys made deduplication impossible and no
session.deleted cleanup existed.
- Extract ProcessedCommandStore with maxSize cap and TTL-based eviction
- Add session cleanup on session.deleted event
- Remove Date.now() from dedup keys for effective deduplication
- Add dispose() for interval cleanup
Tests: 3 pass, 9 expects
- Replace overly broad .includes('anthropic') with exact provider ID
matching against known Anthropic providers (anthropic, google-vertex-
anthropic, aws-bedrock-anthropic) in context-limit-resolver
- Add afterEach cleanup for vision-capable-models cache in look-at
tool tests to prevent cross-test state leakage
When users switch from pinned version to tag in opencode.json (e.g.,
3.10.0 -> @latest), the cache package.json still contains the resolved
version. This causes bun install to reinstall the old version instead
of resolving the new tag.
This adds syncCachePackageJsonToIntent() which updates the cache
package.json to match user intent before running bun install. Uses
atomic writes (temp file + rename) with UUID-based temp names for
concurrent safety.
Critical changes:
- Treat all sync errors as abort conditions (file_not_found,
plugin_not_in_deps, parse_error, write_error) to prevent corrupting
a bad cache state further
- Remove dead code (unreachable revert branch for pinned versions)
- Add tests for all error paths and atomic write cleanup
- New context-limit-resolver.ts with resolveActualContextLimit() shared helper
- Anthropic provider detection now uses .includes('anthropic') instead of hard-coded IDs
- Both context-window-monitor and dynamic-truncator use the shared resolver
- Added missing test cases: Anthropic+1M disabled+cached limit, non-Anthropic without cache
- Check response.error and !response.data after session.get() to fail closed
- Prevents unlimited spawning when SDK returns non-throwing error responses
- Added regression tests for SDK error and missing data scenarios
- Import and inject buildAntiDuplicationSection() in all 3 Prometheus variants (interview-mode, gpt, gemini) and Metis
- Added tests verifying anti-dup section presence in all prompt variants
- Completes anti-duplication coverage for all delegating agents
- parseInteger() now rejects malformed input like '120oops' using /^\d+$/ regex
- New parseActiveValue() validates active flag is exactly '0' or '1'
- Added regression tests for malformed integers, negative values, empty fields, non-binary active flags
Resume GPT sessions when the last assistant reply ends in a permission-seeking tail, while honoring stop-continuation and avoiding duplicate continuation across todo and atlas flows.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Extract types to types.ts
- Extract constants to constants.ts
- Extract session ID helpers to session-id.ts
- Extract recovery logic to recovery.ts
hook.ts reduced from 331 to 164 LOC
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add -m, --model <provider/model> option to oh-my-opencode run command.
Allows users to override the model while keeping the agent unchanged.
Changes:
- Add model?: string to RunOptions interface
- Create model-resolver.ts to parse provider/model format
- Add model-resolver.test.ts with 7 test cases (TDD)
- Add --model CLI option with help text examples
- Wire resolveRunModel in runner.ts and pass to promptAsync
- Export resolveRunModel from barrel (index.ts)
Example usage:
bunx oh-my-opencode run --model anthropic/claude-sonnet-4 "Fix the bug"
bunx oh-my-opencode run --agent Sisyphus --model openai/gpt-5.4 "Task"
- Mock getOmoOpenCodeCacheDir to use temp directories
- Clear real cache files in beforeEach to prevent pollution
- Add top-level beforeEach/afterEach in model-availability.test.ts
- Use mock.module for proper test isolation
- Fixes model-error-classifier, model-availability, connected-providers-cache
- Add try/finally for fake timers cleanup
- Restore real timers in beforeEach/afterEach
- Use enforceMainSessionFilter: false for grace period tests
- Prevent timer state pollution between tests
Implements question-denied session permission rules when creating child
sessions via background task delegation. This prevents subagents from
asking questions by passing explicit permission configuration during
session creation.
🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
Retry compaction recovery when model or tool state is still incomplete, and treat reasoning or tool-only assistant progress as valid output so no-text tail recovery does not misfire.
Replace single-package npm/dt badge with shields.io endpoint badge
that combines downloads from both oh-my-opencode and oh-my-openagent.
Endpoint: https://ohmyopenagent.com/api/npm-downloads
The previous keyTrigger ('Work plan created → invoke Momus') was too
vague — Sisyphus would fire Momus on inline plans or todo lists,
causing Momus to REJECT because its input_extraction requires exactly
one .sisyphus/plans/*.md file path.
The updated trigger explicitly states:
- Momus should only be invoked when a plan file exists on disk
- The file path must be the sole prompt content
- Inline plans and todo lists should NOT trigger Momus
When users switch opencode.json from pinned version to tag (e.g., 3.10.0 -> @latest),
the cache package.json still contains the pinned version. This causes bun install
to reinstall the old version instead of resolving the new tag.
This adds syncCachePackageJsonToIntent() which updates the cache package.json
to match the user's declared intent in opencode.json before running bun install.
Also fixes mock.module in test files to include all exported constants,
preventing module pollution across parallel tests.
The GitHub repository was renamed from oh-my-opencode to oh-my-openagent,
but all documentation, scripts, and source code references still pointed
to the old repository name. This caused confusion for users who saw
'oh-my-opencode' in docs but a different repo name on GitHub.
Updated all references across:
- README files (en, ko, ja, zh-cn, ru)
- CONTRIBUTING.md
- docs/ (installation, overview, configuration, etc.)
- Source code (schema URLs, GitHub API calls, issue links)
- Test snapshots
The npm package name remains 'oh-my-opencode' (unchanged).
Fixes: https://x.com/Dhruv14588676/status/2031216617762468348
- Hoist resolveFallbackChainForCallOmoAgent before sync/background branch
so sync executor also receives the fallback chain
- Add fallbackChain parameter to sync-executor with setSessionFallbackChain
- Mock connected-providers-cache in event.model-fallback tests for
deterministic behavior (no dependency on local cache files)
- Update test expectations to account for no-op fallback skip when
normalized current model matches first fallback entry
- Add cache spy isolation for subagent-resolver fallback_models tests
The prompt update from sisyphus.ts was not applied to the gpt-5-4 and
default variant files. This aligns all three sisyphus prompt variants
to use the updated background result handling guidance.
Tighten Background Result Collection instructions so the model waits
for explore/librarian results instead of duplicating their work and
delivering premature answers.
- Remove 'Continue working immediately' which models interpreted as
'do ALL work yourself, ignore agents'
- Clarify step 2: only do DIFFERENT independent work while waiting
- Add explicit step 3: end response when no other work remains
- Add 'not for files you already know' to explore section header
Fixes#2124, fixes#1967
- Dedupe directory-checking logic: findWorkspaceRoot now uses isDirectoryPath helper
- Add early return when no files match extension to avoid starting LSP server unnecessarily
After publishing oh-my-opencode-{platform}, rename package.json and
publish oh-my-openagent-{platform} from the same build artifact.
Download/extract steps now run if either package needs publishing.
- Support binary bun.lockb format by deleting entire file (cannot parse)
- Add workspace check: verify package.json exists before bun install
- Quote paths in error messages for Windows/paths with spaces
Add deprecation notice explaining that getHighVariant() is no longer
used by the hook. Function is kept for backward compatibility and
potential future validation use.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Remove '고민' from MULTILINGUAL_KEYWORDS as it triggers false
positives in everyday Korean speech. The keyword '생각' (thinking)
remains for intentional think-mode activation.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The hook was incorrectly setting output.message.model.modelID to non-existent
variants like gpt-5-nano-high, causing ProviderModelNotFoundError.
OpenCode's native variant system only needs the variant field - it handles
the transformation automatically.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
When a completed session is no longer returned by session.status(),
allStatuses[sessionID] is undefined. Previously this fell through to
a 'still running' log, leaving the task stuck as running forever.
Match the sync-session-poller pattern: only continue (skip completion
check) when sessionStatus EXISTS and is not idle. When undefined,
fall through to validateSessionHasOutput + checkSessionTodos +
tryCompleteTask, same as idle.
Mock constants directly in cache.test to avoid transitive module-cache reuse when importing cache.ts. This removes Date.now query cache-busting and makes the test deterministic across runs.
Align version lookup, invalidation, and bun install with OpenCode's cache directory so updates target the loaded plugin location. Keep dependency declarations intact during invalidation so auto-update can reinstall instead of converging to uninstall.
Load the doctor loaded-version module through a unique test-only specifier so Bun module mocks from system tests cannot leak into the real module assertions in CI.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add isDirectoryPath helper to lsp-client-wrapper.ts
- Create directory-diagnostics.ts with aggregateDiagnosticsForDirectory
- Update diagnostics-tool.ts with extension parameter for directory paths
- Update Atlas agent prompts to use extension param for directory diagnostics
- Add unit tests for isDirectoryPath and aggregateDiagnosticsForDirectory
Fixes#2362
The publish-main job relied on npm trusted publishing (OIDC) which
broke after the repo rename from oh-my-opencode to oh-my-openagent.
Adding explicit NODE_AUTH_TOKEN restores auth while --provenance
still uses OIDC for Sigstore attestation.
Fixes#2373
npm --provenance validates repository.url against the actual GitHub
repo. Since the repo was renamed to oh-my-openagent, all platform
binary publishes failed with E422 provenance mismatch.
Change multimodal-looker's primary model from gpt-5.3-codex to gpt-5.4 medium
in both runtime and CLI fallback chains.
Changes:
- Runtime chain (src/shared/model-requirements.ts): primary now gpt-5.4
- CLI chain (src/cli/model-fallback-requirements.ts): primary now gpt-5.4
- Updated test expectations in model-requirements.test.ts
- Updated config-manager.test.ts assertion
- Updated model-fallback snapshots
Sisyphus can now fall back through Kimi and OpenAI models when Claude
is unavailable, enabling OpenAI-only users to use Sisyphus directly
instead of being redirected to Hephaestus.
Runtime chain: claude-opus-4-6 max → k2p5 → kimi-k2.5 → gpt-5.4 medium → glm-5 → big-pickle
CLI chain: claude-opus-4-6 max → k2p5 → gpt-5.4 medium → glm-5
- Update DEFAULT_CATEGORIES to use 'openai/gpt-5.4-high' directly instead of separate model + variant
- Add helper functions (isExplicitHighModel, getExplicitHighBaseModel) to preserve explicit high models during fuzzy matching
- Update category resolver to avoid collapsing explicit high models to base model + variant pair
- Update tests to verify explicit high model handling in both background and sync modes
- Update documentation examples to reflect new configuration
🤖 Generated with OhMyOpenCode assistance
Sisyphus-Junior was missing from BuiltinAgentName type, agentSources map,
barrel exports, and AGENT_MODEL_REQUIREMENTS. This caused type inconsistencies
and prevented model-fallback hooks from working for sisyphus-junior sessions.
Closescode-yeongyu/oh-my-openagent#1697
Align runtime defaults, tests, docs, and generated artifacts with the newer GPT-5.4 baseline. Keep think-mode and prompt-routing expectations consistent after the model version bump.
Restructure from 13 scattered XML blocks to 8 dense blocks with 9
named sub-anchors, following OpenAI GPT-5.4 prompting guidance and
Oracle-reviewed context preservation strategy.
Key changes:
- Merge think_first + intent_gate + autonomy into unified <intent>
with domain_guess classification and <ask_gate> sub-anchor
- Add <execution_loop> as central workflow: EXPLORE -> PLAN -> ROUTE ->
EXECUTE_OR_SUPERVISE -> VERIFY -> RETRY -> DONE
- Add mandatory manual QA in <verification_loop> (conditional on
runnable behavior)
- Move <constraints> to position #2 for GPT-5.4 attention pattern
- Add <completeness_contract> as explicit loop exit gate
- Add <output_contract> and <verbosity_controls> per GPT-5.4 guidance
- Add domain_guess (provisional) in intent, finalized in ROUTE after
exploration -- visual domain always routes to visual-engineering
- Preserve all named sub-anchors: ask_gate, tool_persistence,
parallel_tools, tool_method, dependency_checks, verification_loop,
failure_recovery, completeness_contract
- Add skill loading emphasis at intent/route/delegation layers
- Rename EXECUTE to EXECUTE_OR_SUPERVISE to preserve orchestrator
identity with non-execution exits (answer/ask/challenge)
extractPriority() returns undefined when task metadata has no priority
field, but OpenCode's TodoTable requires priority as NOT NULL. This
causes a silent SQLiteError that prevents all Task→Todo syncing.
Add ?? "medium" fallback so todos always have a valid priority.
Add MANUAL_QA_MANDATE sections to all three ultrawork prompts (default,
GPT, Gemini). Agents must now define acceptance criteria in TODO/Task items
before implementation, then execute manual QA themselves after completing
work. lsp_diagnostics alone is explicitly called out as insufficient since
it only catches type errors, not functional bugs.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Remove deep parallel delegation section from GPT-5.4 Sisyphus prompt since
it encouraged direct implementation over orchestration. Add zero-tolerance
category domain matching guide to all Sisyphus prompts with visual-engineering
examples. Rewrite visual-engineering category prompt with 4-phase mandatory
workflow (analyze design system, create if missing, build with system, verify)
targeting Gemini's tendency to skip foundational steps.
Add <parallel_tool_calling> and <tool_usage_rules> blocks that GPT-5.4
treats as first-class behavioral contracts. Add parallel-planning question
to <think_first>, strengthen Exploratory route in intent gate, and add
IN PARALLEL annotations to verification loop.
Remove the hardcoded external_directory: "allow" default from
applyToolConfig(). This was silently overriding OpenCode's built-in
default of "ask" and any user-configured external_directory permission.
With this change, external_directory permission is fully controlled by
OpenCode's defaults and user configuration, as intended.
Fixes#1973Fixes#2194
Replace real setTimeout(7000) with fake timer interception in atlas
retry tests (35s -> 227ms). Add missing opencode provider to glm-5
fallback in unspecified-high category.
When atlas injects a boulder continuation via promptAsync() and the
model's response is immediately aborted (MessageAbortedError), OpenCode
fires a burst of session.idle events within milliseconds. Atlas blocks
all of them due to the 5-second cooldown. After the burst, OpenCode
stops generating session.idle events (it's state-change based, not
periodic), leaving the session stuck forever.
Fix: When cooldown blocks an idle event for a boulder session with an
incomplete plan, schedule a one-shot setTimeout (cooldown + 1s) to
re-attempt injection. The timer callback re-checks boulder state, plan
progress, and continuation-stopped flag before injecting. Only one timer
per session is allowed (deduped via pendingRetryTimer field). Timers are
cleaned up on session.deleted and session.compacted events.
Split monolithic hephaestus.ts into directory with model-specific prompt
variants (gpt-5-4.ts, gpt-5-3-codex.ts, gpt.ts) mirroring the
sisyphus-junior pattern. Generic gpt.ts uses pre-codex-tuning prompt as
fallback for non-specific GPT models.
Also adds isGpt5_4Model and isGpt5_3CodexModel helpers to types.ts.
When no worktree is specified in boulder, stop injecting 'Worktree Setup Required'
instructions. When worktree IS present, inject emphatic instructions ensuring the
agent and all subagents operate exclusively within the worktree directory.
WAIT_FOR_SESSION_TIMEOUT_MS of 2ms was too tight for 2 poll iterations
at 1ms intervals — setTimeout precision caused the budget to expire
before the 2nd getTask call. Bumped to 50ms.
When git-master skill is loaded, all git commands are prefixed with the configured env variable (default: GIT_MASTER=1). This enables custom git hooks to detect git-master skill usage. Set to empty string to disable.
The installer was writing Antigravity provider config and calling a no-op addAuthPlugins function. Since opencode-antigravity-auth is no longer auto-installed and OpenCode supports native Google/Gemini auth, all Antigravity-related installer code is dead. Gemini detection now checks for native google provider instead.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
When users have .md agent files in ~/.claude/agents/ with the same names
as builtin agents (e.g. sisyphus.md, hephaestus.md, atlas.md),
loadAgentsFromDir() hardcodes mode: "subagent" for all loaded agents.
Because the config assembly spreads userAgents after builtinAgents:
config.agent = {
...builtinAgents, // sisyphus: mode="primary"
...userAgents, // sisyphus: mode="subagent" ← overrides
}
this causes all primary agents to become subagents. The TUI filters out
subagents, so only non-plugin agents (like "docs") appear in the agent
selector.
Fix:
- Filter out user/project agents that share names with builtin agents
before spreading into config.agent (both sisyphus-enabled and fallback
branches)
- Respect frontmatter `mode` field in .md agent files instead of
hardcoding "subagent"
- Add `mode` to AgentFrontmatter type
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix#2289
invalidatePackage() only removed the plugin from USER_CONFIG_DIR/node_modules/,
but bun may install it in CACHE_DIR/node_modules/ on some systems. This left a
stale copy behind, causing the startup toast to keep showing the old version even
after the auto-update completed successfully.
Now both candidate locations are checked and removed so the reinstalled version
is loaded on the next restart.
Strip \r characters from list-panes output to handle Windows-style line
endings. Also relax field count check from 9 to 8 to handle cases where
pane_title is empty or missing, which caused the parser to drop pane
rows and fail to determine the main pane in single-pane sessions.
Fixes#2241
kimi-k2.5-free is no longer available. Remove from all agent and category
fallback chains (sisyphus, multimodal-looker, prometheus, metis, atlas,
writing). Reorder multimodal-looker to: gpt-5.3-codex medium -> k2p5 ->
gemini-3-flash -> glm-4.6v -> gpt-5-nano.
GPT-5.3 Codex has strong multimodal capabilities. Promote it to first
candidate in multimodal-looker fallback chain, with gemini-3-flash
following (matching the ULW pattern of gpt-5.3-codex -> gemini).
The server health check was using /health which returns HTTP 403 since
the endpoint doesn't exist in OpenCode. The correct endpoint is
/global/health as defined in OpenCode's server routes.
Fixes#2260
Remove ohmyopencode.com impersonation warnings from all localized READMEs
and fix markdown table column alignment across ja, ko, ru, zh-cn variants.
Also remove Sisyphus Labs note block from ko README.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
The librarian agent's system prompt contained incorrect example function
names for the Exa web search tool, causing the agent to call a non-existent
tool 'websearch_exa_web_search_exa' instead of the correct
'websearch_web_search_exa'.
Fixes#2242
compactedSessions permanently blocked re-compaction after first success,
causing unbounded context growth (e.g. 500k on Kimi K2.5 with 256k limit).
- Clear compactedSessions flag on new message.updated so compaction can
re-trigger when context exceeds threshold again
- Use modelContextLimitsCache for model-specific context limits instead
of always falling back to 200k for non-Anthropic providers
Hashline edit tool and companion hooks now require explicit opt-in
via `"hashline_edit": true` in config. Previously enabled by default.
- tool-registry: hashline edit tool not registered unless opted in
- create-tool-guard-hooks: hashline-read-enhancer disabled by default
- Updated config schema comment and documentation
- Added TDD tests for default behavior
Previously decoded entire image buffer to read headers. Now slices base64
to 32KB prefix before decoding — sufficient for PNG/GIF/WebP/JPEG headers.
Dramatically reduces memory allocation for large images.
applyToolConfig() unconditionally set question permission based only on
OPENCODE_CLI_RUN_MODE, ignoring the question:deny already configured via
OPENCODE_CONFIG_CONTENT. This caused agents to hang in headless environments
(e.g. Maestro Auto Run) where the host sets question:deny but does not
know about the plugin-internal OPENCODE_CLI_RUN_MODE variable.
Read permission.question from OPENCODE_CONFIG_CONTENT and give it highest
priority: config deny > CLI run mode deny > default allow.
Ripgrep's --glob flag silently returns zero results when the search target
is an absolute path and the pattern contains directory prefixes (e.g.
'apps/backend/**/*.ts' with '/project'). This is a known ripgrep behavior
where glob matching fails against paths rooted at absolute arguments.
Fix by running ripgrep with cwd set to the search path and '.' as the
search target, matching how the find backend already operates. Ripgrep
then sees relative paths internally, so directory-prefixed globs match
correctly. Output paths are resolved back to absolute via resolve().
Intercepts Read tool output with image attachments and resizes to comply with Anthropic API limits (≤1568px long edge, ≤5MB). Only activates for Anthropic provider sessions and appends resize metadata (original/new resolution, token count) to tool output.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Non-Claude models skip planning and under-parallelize. Two new sections
injected only when model is not Claude:
- Plan Agent Dependency: multi-step tasks MUST consult Plan Agent first,
use session_id for follow-ups, ask aggressively when ambiguous
- Deep Parallel Delegation (rewrite): explicit '4 units = 4 agents'
pattern, each with clear GOAL + success criteria, all run_in_background
Sisyphus prompt instructed 'your next action is background_output' which
caused agents to repeatedly poll running tasks instead of ending their
response and waiting for the system notification.
- Replace 'STOP all other output' with 'end your response' (actionable)
- Add system-reminder notification mechanism explanation
- Add explicit 'Do NOT poll' prohibition
- Reduce background_cancel(all=true) mentions from 5x to 1x (Hard Blocks)
- Reduce Oracle collect obligation from 4x to 2x
- Remove motivational fluff ('blind spots', 'normal and expected')
Net: -2 lines, clearer mechanism, eliminates polling loop root cause.
- Replace two-pass env interpolation with single-pass combined regex to
prevent re-interpolation of $-sequences in substituted header values
- Convert HookEntry to discriminated union so type: "http" requires url,
preventing invalid configs from passing type checking
- Add regression test for double-interpolation edge case
Add type: "http" hook support matching Claude Code's HTTP hook specification.
HTTP hooks send POST requests with JSON body, support env var interpolation
in headers via allowedEnvVars, and configurable timeout.
New files:
- execute-http-hook.ts: HTTP hook execution with env var interpolation
- dispatch-hook.ts: Unified dispatcher for command and HTTP hooks
- execute-http-hook.test.ts: 14 tests covering all HTTP hook scenarios
Modified files:
- types.ts: Added HookHttp interface, HookAction union type
- config.ts: Updated to accept HookAction in raw hook matchers
- pre-tool-use/post-tool-use/stop/user-prompt-submit/pre-compact:
Updated all 5 executors to dispatch HTTP hooks via dispatchHook()
- plugin-loader/types.ts: Added "http" to HookEntry type union
When models pass relative paths (e.g. 'apps/ios/CleanSlate') to glob/grep
tools, they were passed directly to ripgrep which resolved them against
process.cwd(). In OpenCode Desktop, process.cwd() is '/' causing all
relative path lookups to fail with 'No such file or directory'.
Fix: use path.resolve(ctx.directory, args.path) to resolve relative paths
against the project directory instead of relying on process.cwd().
Add start_work.auto_commit configuration option to allow users to
disable the automatic commit step in the /start-work workflow.
When auto_commit is false:
- STEP 8: COMMIT ATOMIC UNIT is removed from orchestrator reminder
- STEP 9: PROCEED TO NEXT TASK becomes STEP 8
Resolves#2197
GPT-5.x Codex models occasionally hallucinate malformed tool calls like:
assistant to=functions.XXX <garbled_unicode>json\n{...}
This is a model-level issue where the model outputs tool calls as text
instead of using the native tool calling mechanism. Add explicit prompt
instructions telling the model to use the tool call interface.
Related: #2190
The auto-update checker hook calls getConfigDir() which requires the
config context to be initialized via initConfigContext(). When running
in the OpenCode TUI plugin runtime (vs CLI), this initialization never
happened, causing the warning:
"getConfigContext() called before initConfigContext(); defaulting to CLI paths."
This warning would appear when opening folders containing .mulch or .beads
directories because the lifecycle plugins triggered the auto-update checker.
Fix: Call initConfigContext("opencode", null) at plugin startup to ensure
the config context is properly initialized for all hooks and utilities.
Fixes upstream issue where TUI users see spurious bun install warnings.
getConfigContext() emitted a console.warn when called before
initConfigContext() completed. Since initConfigContext runs async
(spawns opencode --version subprocess), other modules calling
getConfigDir/getConfigJson could trigger this warning during startup.
The fallback behavior is intentional and safe (defaults to standard
CLI paths), but console.warn writes to stderr which the TUI captures,
causing the warning to render inside the user's textbox.
Fixes#2183
The hint '(MOST COMMON for single-line edits)' misleads agents into
thinking pos-only replace is the default behavior. When agents want
to replace multiple lines but only specify pos without end, the tool
only replaces one line, causing duplicate code from retained lines.
Allow users to set `background_task.syncPollTimeoutMs` in config to override
the default 10-minute sync subagent timeout. Affects sync task, sync continuation,
and unstable agent task paths. Minimum value: 60000ms (1 minute).
Co-authored-by: Wine Fox <fox@ling.plus>
Prefer the in-memory session agent set by /start-work when validating idle continuation eligibility, so stale message storage agent values do not block boulder continuation.
Bun's internal download of baseline compile targets from npm registry
consistently fails on Windows CI runners (ExtractionFailed error).
Pre-download the baseline binary via curl into Bun's cache directory
so the compile step finds it already cached and skips the download.
Also makes publish job resilient with if: always() so one failed
platform doesn't block publishing all other successful platforms.
publish job now runs with if: always() && !cancelled(), and gates
each publish step on download.outcome == 'success'. One flaky target
(e.g. windows-x64-baseline) no longer blocks all other platforms.
The auto-commit section instructed Hephaestus to automatically commit after
implementation work. Users who didn't know about this behavior would get
surprise commits — a trust-breaking behavioral change flagged by 5 Oracle
reviews as the sole publish blocker for 3.9.0.
- headless.ts: emit error field on tool_result when output starts with Error:
- test-multi-model.ts: errored/timed-out models now shown as RED and exit(1)
- test-multi-model.ts: validate --timeout arg (reject NaN/negative)
- test-edge-cases.ts: use exact match instead of trim() for whitespace test
- test-edge-cases.ts: skip file pre-creation for create-via-append test
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Standalone headless agent using Vercel AI SDK v6 with FriendliAI provider.
Imports hashline-edit pure functions directly from src/ for benchmarking
the edit tool against LLMs (Minimax M2.5 via FriendliAI).
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Canonicalize anchors in dedupe keys to handle whitespace variants
- Make lines field required in edit operations
- Only allow unanchored append/prepend to create missing files
- Reorder delete/rename validation to prevent edge cases
- Add allow_non_gpt_model and max_prompt_tokens to config schema
```
date is already injected by OpenCode's system.ts. omo-env now contains only
Timezone and Locale, which are stable across requests and never break cache.
Current time with HH:MM:SS changed every second, invalidating the prompt cache
on every request. Date-level precision is sufficient; timezone and locale are
stable. Removes Current time field entirely from createEnvContext output.
Drop provider-specific thinking config injection (THINKING_CONFIGS, getThinkingConfig,
resolveProvider) and instead rely on the provider to handle thinking based on the variant field.
Hook now fires on chat.message using model from input rather than from the message object.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Delegate thinking config control to the provider layer rather than
injecting it manually in ultrawork model override.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
OpenCode's copilot fetch wrapper already sets x-initiator based on the
actual HTTP request body content. When oh-my-opencode's chat.headers
hook overrides it with 'agent', the Copilot API detects a mismatch
between the header and the request body and rejects the request with
'invalid initiator'.
This matches the approach OpenCode's own chat.headers handler uses
(copilot.ts:314) — it explicitly skips @ai-sdk/github-copilot models
because the fetch wrapper handles x-initiator correctly on its own.
The getNextFallback function returned raw model names from the
hardcoded fallback chain without transforming them for the target
provider. For example, github-copilot requires dot notation
(claude-sonnet-4.6) but the fallback chain stores hyphen notation
(claude-sonnet-4-6).
The background-agent retry handler already calls
transformModelForProvider correctly, but the sync chat.message
hook in model-fallback was missing it — a copy-paste omission.
Add transformModelForProvider call in getNextFallback and a test
verifying github-copilot model name transformation.
When a background task completes and the parent session is waiting for
user input, promptAsync() fails with an aborted error. Previously the
notification was silently dropped — lost forever.
Fix: queue the notification text in-memory on the BackgroundManager
when promptAsync fails with an aborted/idle error. On the user's next
message to that session, the queued notifications are injected into the
chat context before the agent sees the message.
- BackgroundManager: add pendingNotifications map + queuePendingNotification()
and injectPendingNotificationsIntoChatMessage() methods
- background-notification hook: add chat.message handler that calls injection
- chat-message.ts: wire backgroundNotificationHook.chat.message into the
message processing chain
- Add tests covering queue-on-abort and next-message delivery
- Rename test to 'should inject when last agent is sisyphus and boulder targets atlas
explicitly' and flip expectation to toHaveBeenCalled() - the old assertion was
testing the buggy deadlock behavior
- Add 'should not inject when last agent is non-sisyphus and does not match boulder
agent' to verify hephaestus (unrelated agents) are still correctly skipped
The test 'hephaestus is created when github-copilot provider is connected'
had incorrect expectation. github-copilot does not provide gpt-5.3-codex,
so hephaestus should NOT be created when only github-copilot is connected.
This test was causing CI flakiness due to incorrect assertion and
missing readConnectedProvidersCache mock (state pollution between tests).
Also adds cacheSpy mock for proper isolation.
The test 'hephaestus is created when github-copilot provider is connected'
had incorrect expectation. github-copilot does not provide gpt-5.3-codex,
so hephaestus should NOT be created when only github-copilot is connected.
This test was causing CI flakiness due to incorrect assertion and
missing readConnectedProvidersCache mock (state pollution between tests).
Also adds cacheSpy mock for proper isolation.
The test 'hephaestus is created when github-copilot provider is connected'
had incorrect expectation. github-copilot does not provide gpt-5.3-codex,
so hephaestus should NOT be created when only github-copilot is connected.
This test was causing CI flakiness due to incorrect assertion and
missing readConnectedProvidersCache mock (state pollution between tests).
Also adds cacheSpy mock for proper isolation.
The boulder continuation in event-handler.ts skipped injection whenever
the last agent was 'sisyphus' and the boulder state had agent='atlas'
set explicitly. The allowSisyphusWhenDefaultAtlas guard required
boulderAgentWasNotExplicitlySet=true, but start-work-hook.ts always
calls createBoulderState(..., 'atlas') which sets the agent explicitly.
This created a chicken-and-egg deadlock: boulder continuation needs
atlas to be the last agent, but the continuation itself is what switches
to atlas. With /start-work, the first iteration was always blocked.
Fix: drop the boulderAgentWasNotExplicitlySet constraint so Sisyphus is
always allowed when the boulder targets atlas (whether explicit or default).
Also reduce todo-continuation-enforcer CONTINUATION_COOLDOWN_MS from
30s to 5s to match atlas hook cooldown and recover interruptions faster.
Hephaestus requires GPT models, which can be provided by github-copilot.
The requiresProvider list was missing github-copilot, causing hephaestus
to not be created when github-copilot was the only GPT provider connected.
This also fixes a flaky CI test that documented this expected behavior.
Hephaestus requires GPT models, which can be provided by github-copilot.
The requiresProvider list was missing github-copilot, causing hephaestus
to not be created when github-copilot was the only GPT provider connected.
This also fixes a flaky CI test that documented this expected behavior.
Hephaestus requires GPT models, which can be provided by github-copilot.
The requiresProvider list was missing github-copilot, causing hephaestus
to not be created when github-copilot was the only GPT provider connected.
This also fixes a flaky CI test that documented this expected behavior.
gpt-5.3-codex is not available on GitHub Copilot. The fallback chains
incorrectly listed github-copilot as a valid provider for this model,
causing the doctor to report 'configured model github-copilot/gpt-5.3-codex
is not valid' for Hephaestus agent.
Affected agents: hephaestus (requiresProvider + fallbackChain)
Affected categories: ultrabrain, deep, unspecified-low
Copilot users can still use Hephaestus via openai or opencode providers.
Fixes#2047
- Fix operator precedence bug in hasActiveWork boolean expression
- Reuse getMainSessionStatus result from watchdog to avoid duplicate API calls
- Add flag to only check secondary timeout once to avoid unnecessary API traffic
Implements fixes from issue #1880 and #1934 to prevent exit code 130 timeout in CI environments:
- Add lastEventTimestamp to EventState for tracking when events were last received
- Add event watchdog: if no events for 30s, verify session status via direct API call
- Add secondary timeout: after 60s without meaningful work events, check for active children/todos and assume work is in progress
This prevents the poll loop from waiting for full 600s timeout when:
1. Event stream drops silently (common in CI with network instability)
2. Main session delegates to children without producing meaningful work on main session
- Replace regex /^([A-Za-z_]+)#.../ with indexOf-based prefix check to catch
line-ref#VK and line.ref#VK style inputs that were previously giving generic errors
- Extract parseLineRefWithHint helper to eliminate duplicated try-catch in
validateLineRef and validateLineRefs
- Restore idempotency guard in appendWriteHashlineOutput using new output format
- Add tests for LINE42 extraction, line-ref hint, line.ref hint, and guard behavior
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- fix(hooks): skip todo continuation when agent has pending question (#1888)
Add pending-question-detection module that walks messages backwards
to detect unanswered question tool_use, preventing CONTINUATION_PROMPT
injection while awaiting user response.
- fix(config): allow custom agent names in disabled_agents (#1693)
Change disabled_agents schema from BuiltinAgentNameSchema to z.string()
and add filterDisabledAgents helper in agent-config-handler to filter
user, project, and plugin agents with case-insensitive matching.
- fix(agents): change primary agents mode to 'all' (#1891)
Update Sisyphus, Hephaestus, and Atlas agent modes from 'primary'
to 'all' so they are available for @mention routing and task()
delegation in addition to direct chat.
EventState interface gained new required fields; the inline literal in the
session.status test was missing them, causing type errors and runtime failures.
applyToolConfig() forcibly overrode the user's external_directory
permission to 'allow' by placing OMO defaults after the user config
spread. Reorder so defaults come first and user config spreads on
top, allowing users to set 'ask' or 'deny'. The task permission
remains forced to 'deny' after the spread for security.
Closes#1973
Replace full hashlined file content in write tool response with a simple
'File written successfully. N lines written.' summary to reduce context
bloat.
- Detect non-numeric prefixes (e.g., "LINE#HK", "POS#VK") and explain
that the prefix must be an actual line number, not literal text
- Add suggestLineForHash() that reverse-looks up a hash in file lines
to suggest the correct reference (e.g., Did you mean "1#HK"?)
- Unify error message format from "LINE#ID" to "{line_number}#{hash_id}"
matching the tool description convention
- Add 3 tests covering non-numeric prefix detection and hash suggestion
applySetLine, applyReplaceLines, applyInsertAfter, applyInsertBefore
were re-exported from both edit-operations.ts and index.ts but have no
external consumers — they are only used internally within the module.
Only applyHashlineEdits (the public API) remains exported.
Remove the old LINE:HEX (e.g. "42:ab") reference format support. All
refs now use LINE#ID format exclusively (e.g. "42#VK"). Also fixes
HASHLINE_OUTPUT_PATTERN to use | separator (was missed in PR #2079).
This function is no longer called from edit-operations.ts after the
op/pos/end/lines schema refactor in PR #2079. Remove the function
definition and its 3 dedicated test cases.
restoreIndentForPairedReplacement() and restoreLeadingIndent() unconditionally
restored original indentation when replacement had none, preventing intentional
indentation changes (e.g. removing a tab from '\t1절' to '1절'). Skip indent
restoration when trimmed content is identical, indicating a whitespace-only edit.
Change LINE#HASH:content format to LINE#HASH|content across the entire
codebase. The pipe separator is more visually distinct and avoids
conflicts with TypeScript colons in code content.
15 files updated: implementation, prompts, tests, and READMEs.
OpenCode updated its read tool output format — the <content> tag now shares
a line with the first content line (<content>1: content) with no newline.
The hook's exact indexOf('<content>') detection returned -1, causing all
read output to pass through unmodified (no hash anchors). This silently
disabled the entire hashline-edit workflow.
Fixes:
- Sub-bug 1: Use findIndex + startsWith instead of exact indexOf match
- Sub-bug 2: Extract inline content after <content> prefix as first line
- Sub-bug 3: Normalize open-tag line to bare tag in output (no duplicate)
Also adds backward compat for legacy <file> + 00001| pipe format.
Unify internal hashline edit handling around replace/append/prepend to remove legacy operation shapes. This keeps normalization, ordering, deduplication, execution, and tests aligned with the new op/pos/end/lines contract.
Move blocking/polling logic before full_session branch so that
block=true waits for task completion regardless of output format.
🤖 Generated with assistance of oh-my-opencode
Unify hashline_edit input with replace/append/prepend + pos/end/lines semantics so callers use a single stable shape. Add normalization coverage and refresh tool guidance/tests to reduce schema confusion and stale legacy payload usage.
- Add normalizeModelFormat() utility for string/object model handling
- Update subagent-resolver to handle both model formats
- Add explicitUserConfig flag to ModelResolutionResult
- Set explicitUserConfig: true when user model is found in pipeline
This fixes the issue where plugin-provided models fail cache validation
and fall through to random fallback models.
Keep current field names but accept a pi-style flexible edit payload that is normalized to concrete operations at execution time.
Response now follows concise update/move status with diff metadata retained, removing full-file hashline echo to reduce model feedback loops.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Switch line hashing to significance-aware seeding so meaningful lines stay stable across reflows while punctuation-only lines still disambiguate by line index.
Also narrow prefix stripping to hashline/diff patterns that reduce accidental content corruption during edit normalization.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add SDKMessage local interface for message type safety
Replace any lambda params and message casts with SDKMessage
Remove eslint-disable comments for no-explicit-any
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Remove @ts-ignore and eslint-disable comments from executor.ts and recovery-hook.ts
- Change client: any to client: Client with proper import
- Rename experimental to _experimental for unused parameter
- Remove @ts-ignore for ctx.client casts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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)
Counter Gemini's tendency to skip Phase 0 intent classification by
injecting a mandatory self-check gate before tool calls. Includes
intent type classification, anti-skip mechanism, and common mistake
table showing wrong vs correct behavior per intent type.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Model fallback is now opt-in via `model_fallback: true` in plugin config,
matching the runtime-fallback pattern. Prevents unexpected automatic model
switching on API errors unless explicitly enabled.
- formatter.test.ts: use dynamic imports with cache-busting to avoid mock pollution from runner.test.ts; test real format output instead of dispatch mocking
- hook.test.ts: rewrite with proper branch coverage (7 tests), add success/guard/subagent paths
- background-update-check.test.ts: rewrite with 10 tests covering all branches (early returns, pinned versions, auto-update success/failure)
- directory-agents-injector/injector.test.ts: replace finder/storage mocks with real filesystem + temp directories, verify actual AGENTS.md injection content
- directory-readme-injector/injector.test.ts: same pattern as agents-injector but for README.md, verifies root inclusion behavior
Remove blocking logic that prevented writes to files outside the
session directory. The guard now only applies to files within the
session directory, allowing free writes to external paths.
- Remove OUTSIDE_SESSION_MESSAGE constant
- Update test to expect outside writes to be allowed
- Add early return for paths outside session directory
- Keep isPathInsideDirectory for session boundary check
TDD cycle:
1. RED: Update test expectation
2. GREEN: Implement early return for outside paths
3. REFACTOR: Clean up unused constants
The extracted handleSessionIdleBackgroundEvent was never imported by
manager.ts — dead code from incomplete refactoring (d53bcfbc). Replace
the inline session.idle handler (58 LOC) with a call to the extracted
function, remove unused MIN_IDLE_TIME_MS import, and add 13 unit tests
covering all edge cases.
Add 'gemini' to prompt source types and route Gemini models to new
Gemini-optimized prompts via isGeminiModel detection. Update barrel
exports for all 3 agent modules. All existing tests pass.
- Track matchedLen separately for stripped continuation token matches
- Map fuzzy index back to original string position via character-by-character
scan that skips operator chars, fixing positional correctness
- maybeExpandSingleLineMerge now uses stripTrailingContinuationTokens and
stripMergeOperatorChars as fallback matching strategies
- Add 'refs interpreted against last read' atomicity clause to tool description
- Add 'output tool calls only; no prose' rule to tool description
- Rewrite restoreOldWrappedLines to use oh-my-pi's span-scanning algorithm
- Add stripTrailingContinuationTokens and stripMergeOperatorChars helpers
- Fix detectLineEnding to use first-occurrence logic instead of any-match
- Fix applyAppend/applyPrepend to replace empty-line placeholder in empty files
- Enhance tool description with 7 critical rules, tag guidance, and anti-patterns
- Revert getMessageDir to original join(MESSAGE_STORAGE, sessionID) behavior
- Fix dead subagentSessions.delete by capturing previousSessionID before tryFallbackRetry
- Add .unref() to process cleanup setTimeout to prevent 6s hang on Ctrl-C
- Add missing isUnstableAgent to fallback retry input mapping
- Fix process-cleanup tests to use exit listener instead of SIGINT at index 0
- Swap test filenames in compaction-aware-message-resolver to exercise skip logic correctly
- Use detached process group (non-Windows) + process.kill(-pid) to kill
the entire process tree, not just the outer shell wrapper
- Add proc.stdin error listener to absorb EPIPE when child exits before
stdin write completes
- code ?? 0 → code ?? 1: signal-terminated processes return null exit code,
which was incorrectly coerced to 0 (success) instead of 1 (failure)
- wrap proc.kill(SIGTERM) in try/catch to match SIGKILL guard and prevent
EPERM/ESRCH from crashing on already-dead processes
Add buildDeepParallelSection() function that injects guidance for non-Claude
models on parallel deep agent delegation:
- Detect when model is non-Claude and 'deep' category is available
- Inject instructions to decompose tasks and delegate to deep agents in parallel
- Give goals, not step-by-step instructions to deep agents
- Update Sisyphus prompt builder to pass model and call new function
This helps GPT-based Sisyphus instances leverage deep agents more effectively
for complex implementation tasks.
🤖 Generated with assistance of OhMyOpenCode
Completely restructure the documentation to explain model-agent matching
through the "Models Are Developers" lens:
- Add narrative sections on Sisyphus (sociable lead) and Hephaestus (deep specialist)
- Explain Claude vs GPT thinking differences (mechanics vs principles)
- Reorganize agent profiles by personality type (communicators, specialists, utilities)
- Simplify model families section
- Add "About Free-Tier Fallbacks" section
- Move example configuration to customization section
This makes the guide more conceptual and memorable for users customizing
agent models.
🤖 Generated with assistance of OhMyOpenCode
Problem: Agents frequently omit both 'category' and 'subagent_type' parameters
when calling the task() tool, causing validation failures. The JSON Schema
marks both as optional, and LLMs follow schema structure over description text.
Solution (Option A): Add aggressive visual warnings and failure-mode examples
to the tool description:
- ⚠️ CRITICAL warning header
- COMMON MISTAKE example showing what will FAIL
- CORRECT examples for both category and subagent_type usage
- Clear explanation that ONE must be provided
Tests: All 153 existing tests pass (no behavior change, only prompt improvement)
Connect the existing plugin loader infrastructure to both slash command
dispatch paths (executor and slashcommand tool), enabling namespaced
commands like /daplug:run-prompt to resolve and execute.
- Add plugin discovery to executor.ts discoverAllCommands()
- Add plugin discovery to command-discovery.ts discoverCommandsSync()
- Add "plugin" to CommandScope type
- Remove blanket colon-rejection error (replaced with standard not-found)
- Update slash command regex to accept namespaced commands
- Thread claude_code.plugins config toggle through dispatch chain
- Add unit tests for plugin command discovery and dispatch
Closes#2019🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
- Add Quick Start section with clear installation link
- Add 'How It Works: Agent Orchestration' section linking to orchestration.md
- Add 'Agent Model Matching' section with JSON configuration examples
- Restructure content flow for better readability
- Add example JSON config to agent-model-matching.md
- Maintain original voice and strong opinions while improving organization
- All links now properly reference related docs
Update README with Anthropic blocking mention and revised model descriptions.
Fix markdown table alignment in both README and installation guide.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Injects a reminder after 10 tool turns without task tool usage. Tracks
per-session counters and cleans up on session deletion.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Restore docs/guide/agent-model-matching.md that was accidentally deleted
in commit 880c5e3b (docs restructure). Updated broken links to point to
current documentation structure.
- Remove runtime-fallback gate from session.status retry handler — runtime-fallback
has no session.status handler, so gating it causes retry signals to be silently dropped
- Fix background_output full_session arg description: default is true, not false
- Remove leading ./ from bin entry (npm strips invalid paths)
- Write schema to dist/ for export map compatibility (keep assets/ for GitHub URL)
- Remove unused codex dep + bump @modelcontextprotocol/sdk to ^1.25.2
- Fix broken relative link in configuration.md (../guide/installation.md)
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- runtime-fallback: guard session.error with sessionRetryInFlight to prevent
double-advance during active retry; expand session.stop abort to include
sessionAwaitingFallbackResult; remove premature pendingFallbackModel clearing
from auto-retry finally block
- hashline-edit: add HASHLINE_LEGACY_REF_PATTERN for backward-compatible
LINE:HEX dual-parse in parseLineRef and normalizeLineRef
- tmux-subagent: defer session on null queryWindowState; unconditionally
re-queue deferred session on spawn failure (not just close+spawn)
- ultrawork-db: wrap new Database(dbPath) in try/catch to handle corrupted DB
- event: add try/catch guards around model-fallback logic in message.updated,
session.status, and session.error handlers
Prevent cross-file mock.module leakage by restoring Bun mocks after recovery-hook test, so executor tests always run against the real module implementation.
Stop patching global timers in every lock-management test. Use scoped fake timers only in continuation tests so lock/notification assertions remain deterministic in CI.
Remove duplicated dispatchToHooks declaration that broke TypeScript parsing, and isolate chat-headers tests from marker cache collisions with unique message IDs.
Closes#1901
Add 'default_strategy' config option (default: 'continue') to control whether ralph-loop creates a new session per iteration ('reset') or keeps the same session ('continue'). The 'reset' strategy keeps the model in the smart zone by starting with fresh context for each iteration.
Supports --strategy flag for per-command override.
recovery-hook.test.ts uses mock.module() at top level which patches the
executor module in the shared bun module cache. When run in the same
batch as executor.test.ts, executeCompact becomes the mocked no-op version,
causing all lock management tests to fail.
Move it to the isolated step (each file gets its own bun process) and
enumerate the remaining anthropic-context-window-limit-recovery test files
explicitly to avoid including recovery-hook.test.ts in the batch.
recovery-hook.test.ts uses mock.module() at top level which patches the
executor module in the shared bun module cache. When run in the same
batch as executor.test.ts, executeCompact becomes the mocked no-op version,
causing all lock management tests to fail.
Move it to the isolated step (each file gets its own bun process) and
enumerate the remaining anthropic-context-window-limit-recovery test files
explicitly to avoid including recovery-hook.test.ts in the batch.
recovery-hook.test.ts uses mock.module() at top level which patches the
executor module in the shared bun module cache. When run in the same
batch as executor.test.ts, executeCompact becomes the mocked no-op version,
causing all lock management tests to fail.
Move it to the isolated step (each file gets its own bun process) and
enumerate the remaining anthropic-context-window-limit-recovery test files
explicitly to avoid including recovery-hook.test.ts in the batch.
Replace exact call count assertions with delta-based checks:
- capture errorSpy.mock.calls.length before processing events
- slice to only check calls made during this test's execution
- use try/finally to guarantee mockRestore() even on assertion failure
This prevents test pollution from cross-file spy leakage in CI batch runs.
Replace exact call count assertions with delta-based checks:
- capture errorSpy.mock.calls.length before processing events
- slice to only check calls made during this test's execution
- use try/finally to guarantee mockRestore() even on assertion failure
This prevents test pollution from cross-file spy leakage in CI batch runs.
Replace exact call count assertions with delta-based checks:
- capture errorSpy.mock.calls.length before processing events
- slice to only check calls made during this test's execution
- use try/finally to guarantee mockRestore() even on assertion failure
This prevents test pollution from cross-file spy leakage in CI batch runs.
Complete the integration of multi-model future vision into all 4 READMEs:
- Korean: Full tagline with orchestration, cheaper/smarter models, open market
- Chinese: Full tagline with model orchestration and future betting
All READMEs now consistently convey: we ride all models, not just Claude.
The future is multi-model orchestration, not picking one winner.
Remove separate 'The Bet' sections and weave the multi-model future
vision directly into the existing 'steroids/prison' taglines:
- English: Expanded tagline with model orchestration and future betting
- Korean: '우리가 보는 미래' 섹션 제거, 태그라인에 통합
- Japanese: '私たちが賭ける未来' セクション削除、タグライン統合
- Chinese: '我们押注的未来' 部分删除,整合到标语中
Key message: Models get cheaper/smarter every month. No provider
will dominate. We ride them all. Built for the open market.
Add 'The Bet' section to all 4 language READMEs (en, ko, ja, zh-cn):
- Models getting cheaper every month
- Models getting smarter every month
- No single provider will dominate the future
- We leverage ALL models, not just Claude
- Architecture gets more valuable as models specialize
- We're building for the open multi-model future
Also update overview.md to move 'Better Than Pure Codex' into
Hephaestus section and add 'Better Than Pure Claude Code' section
with fundamental multi-model advantage explanation.
Fixes#1920
Installer-written exact versions (e.g., oh-my-opencode@3.5.2) were incorrectly treated as user-pinned, blocking auto-updates for all installer users.
Fix isPinned to only block auto-update when pinnedVersion is an explicit semver string (user's intent). Channel tags (latest, beta, next) and bare package name all allow auto-update.
Fix installer fallback to return bare PACKAGE_NAME for stable versions and PACKAGE_NAME@{channel} for prerelease versions, preserving channel tracking.
Fixes#1804, fixes#1962
The migration entry 'gpt-5.2-codex → gpt-5.3-codex' caused the plugin to silently overwrite user configs on every startup with a model that doesn't exist in the OpenAI API. Users explicitly setting gpt-5.2-codex (the correct current model) were forced to revert their config manually every session.
Rewrote prose for SF engineer voice: shorter sentences, punchier copy,
no em-dashes. Kept all structural elements, badges, testimonials, and
code blocks unchanged.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Use tool.schema.enum() for output_mode instead of generic string()
- Remove unsafe type assertion for output_mode
- Fix files_with_matches mode returning empty results by adding
filesOnly flag to parseOutput for --files-with-matches rg output
- Add --threads=4 flag to all rg invocations (grep and glob)
- Add global semaphore limiting concurrent rg processes to 2
- Reduce grep timeout from 300s to 60s (matches tool description)
- Reduce max output from 10MB to 256KB (prevents excessive memory usage)
- Add output_mode parameter (content/files_with_matches/count)
- Add head_limit parameter for incremental result fetching
Closes#2008
Ref: #674, #1722
- BUG-7: Add gpt-5-nano as final fallback in multimodal-looker model requirements
- BUG-14: Remove hardcoded LIBRARIAN_MODEL, let librarian resolve through normal fallback chain
- Update snapshots and tests to reflect new fallback behavior
When browserProvider is not set, agent-browser skill should NOT resolve.
Test assertions were inverted — expected 'Skills not found' but asserted the opposite.
Unhandled SQLite exceptions (SQLITE_BUSY, database locked, etc.) in queueMicrotask/setTimeout callbacks could crash the entire process. Added try/catch/finally to ensure db.close() is always called and errors are logged instead of crashing.
Split 1021-line index.ts into 10 focused modules per project conventions.
New structure:
- error-classifier.ts: error analysis with dynamic status code extraction
- agent-resolver.ts: agent detection utilities
- fallback-state.ts: state management and cooldown logic
- fallback-models.ts: model resolution from config
- auto-retry.ts: retry helpers with mutual recursion support
- event-handler.ts: session lifecycle events
- message-update-handler.ts: message.updated event handling
- chat-message-handler.ts: chat message interception
- hook.ts: main factory with proper cleanup
- types.ts: updated with HookDeps interface
- index.ts: 2-line barrel re-export
Embedded fixes:
- Fix setInterval leak with .unref()
- Replace require() with ESM import
- Add log warning on invalid model format
- Update sessionLastAccess on normal traffic
- Make extractStatusCode dynamic from config
- Remove unused SessionErrorInfo type
All 61 tests pass without modification.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Remove duplicate Runtime Fallback section from configurations.md.
Fix max_fallback_attempts range from (1-10) to (1-20) to match schema.
Update retry_on_errors default to include 400 status code.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Revert test name and assertion to original behavior per PR review feedback.
The test now correctly expects Atlas to respect uiSelectedModel instead of using its own fallback chain.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Make provider auto-retry signal detection respect timeout_seconds setting:
- When timeout_seconds=0, disable quota-based fallback escalation
- Only treat auto-retry signals as errors when timeout is enabled
- Add test to verify behavior when timeout_seconds is disabled
- Update documentation to explain timeout_seconds=0 behavior
This allows users to disable timeout-based fallbacks while keeping
error-based fallback functionality intact.
Refactor retry signal detection to be provider-agnostic:
- Replace hardcoded Copilot/OpenAI checks with generic pattern matching
- Detect any provider message containing limit/quota keywords + [retrying in X]
- Add OpenAI pattern: 'usage limit has been reached [retrying in X]'
- Update logging to use generic 'provider' instead of specific names
- Add 'usage limit has been reached' to RETRYABLE_ERROR_PATTERNS
This enables fallback escalation for any provider that signals automatic
retries due to quota/rate limits, not just Copilot and OpenAI.
Closes PR discussion: generalize retry pattern detection
- Extract duplicated auto-retry logic (~40 lines each) from session.error and
message.updated handlers into shared autoRetryWithFallback() helper
- Fix userFallbackModels path in model-resolution-pipeline to respect
constraints.connectedProviders parameter instead of reading cache directly,
matching the behavior of categoryDefaultModel and fallbackChain paths
Bug fixes:
1. extractStatusCode: handle nested data.statusCode (Anthropic error structure)
2. Error regex: relax credit.*balance.*too.*low pattern for multi-char gaps
3. Zod schema: bump max_fallback_attempts from 10 to 20 (config rejected silently)
4. getFallbackModelsForSession: fallback to sisyphus/any agent when session.error lacks agent
5. Model detection: derive model from agent config when session.error lacks model info
6. Auto-retry: resend last user message with fallback model via promptAsync
7. Persistent fallback: override model on every chat.message (not just pendingFallbackModel)
8. Manual model change: detect UI model changes and reset fallback state
9. Agent preservation: include agent in promptAsync body to prevent defaulting to sisyphus
Additional:
- Add sessionRetryInFlight guard to prevent double-retries
- Add resolveAgentForSession with 3-tier resolution (event → session memory → session ID)
- Add normalizeAgentName for display names like "Prometheus (Planner)" → "prometheus"
- Add resolveAgentForSessionFromContext to fetch agent from session messages
- Move AGENT_NAMES and agentPattern to module scope for reuse
- Register runtime-fallback hooks in event.ts and chat-message.ts
- Remove diagnostic debug logging from isRetryableError
- Add 400 to default retry_on_errors and credit/balance patterns to RETRYABLE_ERROR_PATTERNS
The \b word boundary regex treats '-' as a boundary, causing
'sisyphus-junior-session-123' to incorrectly match 'sisyphus'
instead of 'sisyphus-junior'.
Sorting agent names by length (descending) ensures longer names
are matched first, fixing the hyphenated agent detection issue.
Fixes cubic-dev-ai review issue #8
- Add normalizeFallbackModels helper to centralize string/array normalization (P3)
- Export RuntimeFallbackConfig and FallbackModels types from config/index.ts
- Fix agent detection regex to use word boundaries for sessionID matching
- Improve tests to verify actual fallback switching logic (not just log paths)
- Add SessionCategoryRegistry cleanup in executeSyncTask on completion/error (P2)
- All 24 runtime-fallback tests pass, 115 delegate-task tests pass
Replace word-boundary regex with stricter patterns that match
status codes only at start/end of string or surrounded by whitespace.
Prevents false matches like '1429' or '4290'.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Implement full fallback_models support across all integration points:
1. Model Resolution Pipeline (src/shared/model-resolution-pipeline.ts)
- Add userFallbackModels to ModelResolutionRequest
- Process user fallback_models before hardcoded fallback chain
- Support both connected provider and availability checking modes
2. Agent Utils (src/agents/utils.ts)
- Update applyModelResolution to accept userFallbackModels
- Inject fallback_models for all builtin agents (sisyphus, oracle, etc.)
- Support both single string and array formats
3. Model Resolver (src/shared/model-resolver.ts)
- Add userFallbackModels to ExtendedModelResolutionInput type
- Pass through to resolveModelPipeline
4. Delegate Task Executor (src/tools/delegate-task/executor.ts)
- Extract category fallback_models configuration
- Pass to model resolution pipeline
- Register session category for runtime-fallback hook
5. Session Category Registry (src/shared/session-category-registry.ts)
- New module: maps sessionID -> category
- Used by runtime-fallback to lookup category fallback_models
- Auto-cleanup support
6. Runtime Fallback Hook (src/hooks/runtime-fallback/index.ts)
- Check SessionCategoryRegistry first for category fallback_models
- Fallback to agent-level configuration
- Import and use SessionCategoryRegistry
Test Results:
- runtime-fallback: 24/24 tests passing
- model-resolver: 46/46 tests passing
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
transformModelForProvider only handled github-copilot provider, leaving
google provider models untransformed. This caused ProviderModelNotFoundError
when google/gemini-3-flash was sent to the API (correct ID is
gemini-3-flash-preview).
Changes:
- Add google provider to transformModelForProvider with idempotent regex
negative lookahead to prevent double -preview suffix
- Fix category-default path in model-resolution-pipeline when
availableModels is empty but connected provider exists
- Fix getFirstFallbackModel first-run path that constructed raw model IDs
without transformation
- Fix github-copilot provider gemini transforms to also use idempotent
regex (was vulnerable to double-transform)
- Extract transformModelForProvider to shared module (single source of
truth, imported by cli and shared layers)
- Add 20 new test cases: unit tests for both providers, runtime
integration tests for category-default and fallback-chain paths,
double-transform prevention for both providers
transformModelForProvider only handled github-copilot provider, leaving
google provider models untransformed. This caused ProviderModelNotFoundError
when google/gemini-3-flash was sent to the API (correct ID is
gemini-3-flash-preview).
Add google provider block with -preview suffix guard to prevent double
transformation.
Reorder tool permission spread so getAgentToolRestrictions() comes
last, allowing agent-specific restrictions to override defaults.
Fixes all 3 sites: task-starter.ts (startTask), manager.ts (startTask
and resume paths).
Previously, defaults like call_omo_agent:true would stomp agent
restrictions (e.g., explore's call_omo_agent:false) due to JS
spread semantics.
- Add Category-level fallback_models support in getFallbackModelsForSession()
- Try agent-level fallback_models first
- Then try agent's category fallback_models
- Support all builtin agents including hephaestus, sisyphus-junior, build, plan
- Expand agent name recognition regex to include:
- hephaestus, sisyphus-junior, build, plan, multimodal-looker
- Add comprehensive test coverage (6 new tests, total 24):
- Model switching via chat.message hook
- Agent-level fallback_models configuration
- SessionID agent pattern detection
- Cooldown mechanism validation
- Max attempts limit enforcement
All 24 tests passing
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add configuration schemas for runtime model fallback feature:
- RuntimeFallbackConfigSchema with enabled, retry_on_errors,
max_fallback_attempts, cooldown_seconds, notify_on_fallback
- FallbackModelsSchema for init-time fallback model selection
- Add fallback_models to AgentOverrideConfigSchema and CategoryConfigSchema
- Export types and schemas from config/index.ts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The doctor's fix messages for outdated/mismatched plugin versions were
directing users to ~/.config/opencode with `bun update`, but OpenCode
loads plugins from its cache directory (~/.cache/opencode on Linux,
~/Library/Caches/opencode on macOS). Additionally, pinned versions in
the cache package.json make `bun update` a no-op — `bun add ...@latest`
is required.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- applyReplaceLines: use stripped array directly instead of restoreLeadingIndent
- applySetLine: keep restoreLeadingIndent (1:1 replacement needs indent preservation)
- Added test case for replace_lines preserving new line indentation
- All 3025 tests pass
🤖 Generated with OhMyOpenCode assistance
- 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
Add dedicated '## Hashline Edit' section to configurations.md explaining the hash-anchored Edit tool, its default-on behavior, and how to disable it or its companion hooks. Update src/config/AGENTS.md to reflect hashline_edit moved out of experimental and into root schema (27 fields).
Move hashline_edit out of experimental so it is a stable top-level config with default-on runtime behavior and explicit disable support. Add migration and tests to preserve existing experimental.hashline_edit users without breaking configs.
Breaking Changes:
- Change hashline format from 'lineNum:hex|content' to 'lineNum#CID:content'
- Replace hex-based hashing (00-ff) with CID-based hashing (ZPMQVRWSNKTXJBYH nibbles)
- Simplify constants: HASH_DICT → NIBBLE_STR + HASHLINE_DICT
- Update patterns: HASHLINE_PATTERN → HASHLINE_REF_PATTERN + HASHLINE_OUTPUT_PATTERN
Benefits:
- More compact and memorable CID identifiers
- Better alignment with LSP line reference format (lineNum#ID)
- Improved error messages and diff metadata clarity
- Remove unused toHashlineContent from diff-enhancer hook
Updates:
- Refactor hash-computation for CID generation
- Update all diff-utils to use new format
- Update hook to use raw content instead of hashline format
- Update tests to match new expectations
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add no-hephaestus-non-gpt to hook list for schema validation
- Add disable_omo_env to experimental features schema
- Sync schema with existing hook and feature implementations
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
background_output auto-enabled full_session when the task was still
running, returning the entire session transcript on every poll. When
the parent agent had no other work and polled in a tight loop, this
caused massive token waste because each response dumped thousands of
tokens into the conversation history.
Default full_session to false so running-task checks return a compact
status table (~200 tokens). Callers can still pass full_session=true
explicitly when they need the full transcript.
- Refactor test descriptions for clarity regarding the presence of <omo-env> in generated prompts.
- Ensure that when disable_omo_env is true, <omo-env> is omitted from the sisyphus prompt.
- Confirm that <omo-env> remains in the prompt when disable_omo_env is not specified.
- Added a new configuration option `disable_omo_env` to control the injection of the `<omo-env>` block in agent prompts.
- Updated relevant functions and tests to support this feature, ensuring that the environment context can be toggled on or off as needed.
- Enhanced documentation to reflect the new option and its implications for API cost and cache hit rates.
Apply the internal initiator marker to automated continuation, recovery, babysitter, stop-hook, and hook-message injections so Copilot attribution consistently sets x-initiator=agent for system-generated prompts.
The installation instructions were incorrectly placed:
- 'For Humans' had the curl command (agent behavior)
- 'For LLM Agents' had the copy-paste prompt (human action)
Now correctly:
- 'For Humans': Copy-paste prompt to give to LLM agent
- 'For LLM Agents': Fetch raw installation guide via curl
Fixed in all 4 language versions (EN, KO, JA, ZH-CN).
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Include line number in hash computation to ensure uniqueness
- Add explicit examples of WRONG vs CORRECT LINE:HASH format
- Clarify that hash must be hex characters (0-9, a-f only)
- Update tests to use dynamic hash computation
- Remove formatCustomSkillsBlock function (dead code)
- Remove unused truncateDescription import
- Update buildCategorySkillsDelegationGuide to compact format
- Update tests to match new compact output
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Merge <available_skills> and <available_commands> into single <available_items>
- Sort by priority: project > user > opencode > builtin
- List skills before commands
- Add priority documentation to description
- Add 5 tests for ordering and priority
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Align edit/write hashline handling with TUI expectations by preserving metadata through tool execution, keeping unified diff raw to avoid duplicated line numbers, and tightening read/write/edit outputs plus tests for reliable agent operation.
Add Step 0 intent extraction to counter GPT 5.2's conservative grounding bias:
- Map surface questions to true action intent (e.g., "Did you do X?" → do X now)
- Verbalization pattern: model must state intent before acting, creating commitment
- Turn-end self-check to prevent stopping after only talking about work
Prevents Hephaestus from answering questions then stopping when action is implied.
- Generate unified diff for TUI display via metadata.diff
- Support write tool in addition to edit tool
- Hashline-format before/after content in filediff metadata
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add comprehensive test coverage for:
- Hash consistency validation between Read tool output and Edit tool validateLineRef
- Injected content isolation to prevent hashifying non-file-content lines
- Footer messages and system reminders that should pass through unchanged
Tests ensure Read hook properly handles content boundaries and maintains
hash validity for Edit tool operations.
🤖 Generated with assistance of oh-my-opencode
- Add per-message ultrawork mode detection via keyword matching
- Implement deferred DB override strategy using microtask retry loop
- Fall back to setTimeout after 10 microtask retries for robustness
- Update agent configuration schema with ultrawork model/variant fields
- Integrate with chat.message hook to apply overrides on detection
- Add comprehensive tests for all override scenarios
- Generated schema includes ultrawork configuration
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Capture file content before hashline edit execution and compute filediff
metadata after, enabling opencode TUI to render inline diffs for the
plugin's edit tool (which replaces the built-in EditTool).
Add alternative providers to free-tier and cross-provider models:
- k2p5: add friendli as alternative to kimi-for-coding
- kimi-k2.5-free, minimax-m2.5-free, big-pickle, gpt-5-nano: add opencode-zen-abuse
- grok-code-fast-1: add venice as alternative to github-copilot
- glm-5: add opencode as alternative to zai-coding-plan
Remove the automatic installation of opencode-antigravity-auth plugin
when users have Gemini configured. This change addresses several issues:
1. Antigravity plugin is causing Google account bans for users
2. Users are unaware the plugin was auto-installed
3. Google has built-in OAuth for Gemini that doesn't require third-party plugins
Users who need the antigravity plugin can manually add it to their
plugin configuration if desired.
Fixes issues with unexpected plugin installation and account safety.
Complete rewrite organized around model families, agent roles,
task categories, and selection priority rules.
- Model families: Claude-like (Kimi, GLM/Big Pickle), GPT,
different-behavior (Gemini, MiniMax), speed-focused (Grok, Spark)
- Agent roles: Claude-optimized, dual-prompt, GPT-native, utility
- gpt-5.3-codex-spark: extremely fast but compacts too aggressively
- Big Pickle = GLM 4.6
- Explicit guidance: do not upgrade utility agents to Opus
- opencode models / opencode auth login references at top
- Link to orchestration system guide for task categories
Expand model-specific prompt routing section with insights from
the actual Prometheus GPT prompt development session:
- Why Claude vs GPT models need fundamentally different prompts
- Principle-driven (GPT) vs mechanics-driven (Claude) approach
- "Decision Complete" concept from Codex Plan Mode
- Why more rules help Claude but hurt GPT (contradiction surface)
- Concrete size comparison (1100 lines Claude vs 300 lines GPT)
Rewrite agent-model-matching.md as a technical reference that:
- Documents actual fallback chains from model-requirements.ts
- Explains model-specific prompt routing (Prometheus/Atlas GPT detection)
- Covers safe vs dangerous model substitutions with rationale
- Includes task categories (visual-engineering, deep, quick, etc.)
- Guides agents on how to explain model choices to users
- Adds provider priority chain
Also update installation.md to reference the guide when users
want custom model configuration, with explanation of what is
safe to change and why.
- Add docs/guide/agent-model-matching.md with TL;DR table, detailed
breakdown per agent, configuration examples, decision tree, common
pitfalls, and default fallback chains
- Update README.md to reference the guide in TOC, Just Install This
section, and Features overview
Adds a regression test for the race where /stop-continuation fires after
handleSessionIdle passes the flag check but before injectContinuation runs.
Verifies no injection occurs when the flag becomes true mid-countdown.
When /stop-continuation is invoked during the 2s countdown, the stop flag
was never checked inside injectContinuation, so the injection would still
fire after the countdown elapsed.
Propagate isContinuationStopped from handleSessionIdle through startCountdown
into injectContinuation, where it is now re-checked before any API call.
Atlas and Sisyphus prompts instructed agents to use background_cancel(all=true)
before final answers. This destroys uncollected background task results and
contradicts existing NEVER directives in the Sisyphus prompt, causing agents
to lose explore/librarian outputs mid-session.
Replace with individual task cancellation pattern that preserves completed
task results while still cleaning up running disposable tasks.
- Change MIN_STABILIZATION_MS from 0 to 1_000 to prevent premature exits
- Coerce non-positive minStabilizationMs to default instead of treating as disabled
- Fix stabilization logic: track firstWorkTimestamp inside the meaningful-work branch
- Add tests for default stabilization behavior and zero-value coercion
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Forward session.deleted events to write-existing-file-guard so per-session read permissions are actually cleared in runtime.
Add plugin-level regression test to ensure event forwarding remains wired, alongside the expanded guard behavior and unit coverage.
Remove ultrawork-model-override hook and per-agent ultrawork model swap
config that relied on zen opencode.ai free tier (no longer functional).
Removed:
- src/hooks/ultrawork-model-override/ (hook, test, index)
- ultrawork field from AgentOverrideConfigSchema
- ultrawork-model-override from HookNameSchema
- UltraworkConfig type from model-fallback-types
- Non-max20 sonnet+ultrawork-opus codepath from model-fallback
- Claude subscription model table from installation docs
- All references in plugin-interface, create-session-hooks, schema.json
- Related test cases and updated snapshots
Per reviewer feedback (code-yeongyu), keep the 'skill' tool as the main
tool and merge slashcommand functionality INTO it, rather than the reverse.
Changes:
- skill/tools.ts: Add command discovery (discoverCommandsSync) support;
handle both SKILL.md skills and .omo/commands/ slash commands in a single
tool; show combined listing in tool description
- skill/types.ts: Add 'commands' option to SkillLoadOptions
- skill/constants.ts: Update description to mention both skills and commands
- plugin/tool-registry.ts: Replace createSlashcommandTool with createSkillTool;
register tool as 'skill' instead of 'slashcommand'
- tools/index.ts: Export createSkillTool instead of createSlashcommandTool
- plugin/tool-execute-before.ts: Update tool name checks from 'slashcommand'
to 'skill'; update arg name from 'command' to 'name'
- agents/dynamic-agent-prompt-builder.ts: Categorize 'skill' tool as 'command'
- tools/skill-mcp/tools.ts: Update hint message to reference 'skill' tool
- hooks/auto-slash-command/executor.ts: Update error message
The slashcommand/ module files are kept (they provide shared utilities used
by the skill tool), but the slashcommand tool itself is no longer registered.
- atlas hook: update verification reminder assertions to match new
4-phase QA system (MANDATORY -> PHASE 1/2, LIE -> LYING)
- auto-update-checker: add missing revertPinnedVersion mock export
to fix SyntaxError in background-update-check tests
Note: 4 auto-update-checker tests fail only when run alongside
checker.test.ts due to bun mock.module isolation issue (pre-existing
in v3.7.3, not a regression)
Rewrite Atlas GPT verification from a checklist to a 4-phase protocol:
Phase 1 (Read Code First), Phase 2 (Automated Checks), Phase 3 (Hands-On QA),
Phase 4 (Gate Decision). Hands-on QA is now mandatory for user-facing changes,
not 'if applicable'. Hook message reinforces subagent distrust and requires
actually running deliverables before proceeding to next task.
spyOn(console, 'log') accumulates calls across test files in bun:test.
Add mockClear() after spy creation to prevent cross-file contamination
when run in the same bun test batch as completion.test.ts.
When no agent panes exist, mainPane.width equals windowWidth, making
agentAreaWidth zero. The early return guard blocked initial pane creation
before the currentCount === 0 handler could execute.
Add currentCount > 0 condition so the guard only fires when agent panes
already exist, allowing the bootstrap handler to evaluate canSplitPane.
Closes#1939
Shorter hook name, disableable via disabled_hooks config, migration added
for backward compatibility. Also forces agent switch to Hephaestus on
Sisyphus + GPT detection. Docs updated with new hook name.
Use getAgentConfigKey() to normalize display names (e.g. 'Sisyphus (Ultraworker)')
back to config keys before comparison. Update toast to 10s duration with clearer
line-broken messaging.
Oracle, Librarian, Explore, Momus, and Metis could modify files via
apply_patch despite being read-only agents. Also fixed duplicate task
entries in Librarian and Explore restriction lists.
When port appears available but binding fails (race with another opencode
instance), retry on next available port (auto mode) or attach to existing
server (explicit port mode) instead of crashing with exit code 1.
Add newlines around agent header for visual separation, dim the thinking
label, and add trailing newline after think block close.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
Guard against duplicate tool header/output rendering when both tool.execute
and message.part.updated fire for the same tool, and prevent message counter
resets when message.updated fires multiple times for the same assistant message.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
Replace the single-line "Thinking: <summary>" rendering with direct streaming
of reasoning tokens via writePaddedText. Removes maybePrintThinkingLine and
renderThinkingLine in favor of incremental output with dim styling.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Adds message.part.delta event handling for real-time streaming output,
reasoning/think block display with in-place updates, per-agent profile
colors, padded text output, and semantic tool headers with icons.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Replace two separate triage skills with one unified skill using 'free' category
for all subagents. Action-oriented: auto-answer questions, analyze bugs,
merge safe PRs. All items tracked via TaskCreate, [sisyphus-bot] comment prefix.
Convert all markdown tables in Sisyphus and dynamic-agent-prompt-builder
to plain bullet lists for cleaner prompt rendering.
Add explicit Oracle safeguards:
- Hard Block: background_cancel(all=true) when Oracle running
- Hard Block: delivering final answer before collecting Oracle result
- Anti-Pattern: background_cancel(all=true) and skipping Oracle
- Oracle section: NEVER cancel, collect via background_output first
- Background Result Collection: split cancel/wait into separate steps
with explicit NEVER use background_cancel(all=true) instruction
- features.md: update explore primary model (grok-code-fast-1), fix all agent fallback chains
- configurations.md: add missing deep category, fix all agent/category provider chains, add hephaestus to available agents, update model names to match actual code
Agent keys are remapped to display names, so preserving `default_agent`
values could still select a missing key at runtime.
This regression surfaced after d94a739203 remapped `config.agent` keys
to display names without canonicalizing configured defaults.
Normalize configured `default_agent` through display-name mapping before
fallback logic and extend tests to cover canonical and display-name
inputs.
Remove applyLayout(select-layout main-vertical) call after spawn which
was destroying grid arrangements by forcing vertical stacking. Now only
enforceMainPaneWidth is called, preserving the grid created by manual
split directions. Also fix enforceMainPaneWidth to use config's
main_pane_size percentage instead of hardcoded 50%.
Agent area width now uses real mainPane.width instead of hardcoded 50%
ratio. Grid planning, split availability, and spawn target finding now
respect user's agent_pane_min_width config instead of hardcoded
MIN_PANE_WIDTH=52, enabling 2-column grid layouts on narrower terminals.
Extends conversion logic to handle Base64-encoded images (e.g., from clipboard).
Previously, unsupported formats like HEIC/RAW/PSD in Base64 form bypassed
the conversion check and caused failures at multimodal-looker agent.
Changes:
- Add convertBase64ImageToJpeg() function in image-converter.ts
- Save Base64 data to temp file, convert, read back as Base64
- Update tools.ts to check and convert Base64 images when needed
- Ensure proper cleanup of all temporary files
Testing:
- All tests pass (29/29)
- Verified with 1.7MB HEIC file converted from Base64
- Type checking passes
Adds automatic conversion of unsupported image formats (HEIC, HEIF, RAW, PSD)
to JPEG before sending to multimodal-looker agent.
Changes:
- Add image-converter.ts module with format detection and conversion
- Modify look_at tool to auto-convert unsupported formats
- Extend mime-type-inference.ts to support 15+ additional formats
- Use sips (macOS) and ImageMagick (Linux/Windows) for conversion
- Add proper cleanup of temporary files
Fixes#722
Testing:
- All existing tests pass (29/29)
- TypeScript type checking passes
- Verified HEIC to JPEG conversion on macOS
Use the configured agent pane width consistently in split target selection and avoid close+spawn churn by replacing the oldest pane when eviction is required.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Restore Assumptions Check and When to Challenge the User from Sisyphus intent gate
- Add proactive explore/librarian firing to CORRECT behavior list
- Strengthen parallel execution with GPT-5.2 tool_usage_rules (parallelize ALL independent calls)
- Embed reporting into each Execution Loop step (Tell user pattern)
- Strengthen Progress Updates with plain-language and WHY-not-just-WHAT guidance
- Add post-edit reporting to Output Contract and After Implementation
- Fix Output Contract preamble conflict (skip empty preambles, but DO report actions)
Add OPENCODE_CLI_RUN_MODE environment variable check to skip all startup
toasts and version checks when running in CLI mode. This prevents
notification spam during automated CLI run sessions.
Includes comprehensive test coverage for CLI run mode behavior.
🤖 Generated with OhMyOpenCode assistance
- Add directory parameter to session API calls (session.get, session.todo,
session.status, session.children)
- Improve agent resolver with display name support via agent-display-names
- Add tool execution visibility in event handlers with running/completed
status output
- Enhance poll-for-completion with main session status checking and
stabilization period handling
- Add normalizeSDKResponse import for consistent response handling
- Update types with Todo, ChildSession, and toast-related interfaces
🤖 Generated with OhMyOpenCode assistance
Add propertyNames: { type: "string" } to all object schemas with
additionalProperties to ensure proper JSON schema validation for
dynamic property keys.
🤖 Generated with OhMyOpenCode assistance
The experimental.session.compacting handler was not delegating to
claudeCodeHooks, making PreCompact hooks from .claude/settings.json
dead code. Also fixed premature early-return when compactionContextInjector
was null which would skip any subsequent hooks.
oh-my-opencode overwrote OpenCode's default_agent with sisyphus whenever
Sisyphus orchestration was enabled. This made explicit defaults like
Hephaestus ineffective and forced manual agent switching in new sessions.
Only assign sisyphus as default when default_agent is missing or blank,
and preserve existing configured values. Add tests for both preservation
and fallback behavior to prevent regressions.
- Move src/tools/session-manager to isolated test section
- Prevents mock.module() pollution across parallel test runs
- Fixes 4 flaky storage tests that failed in CI
- P2: Change replace edit sorting from POSITIVE_INFINITY to NEGATIVE_INFINITY
so replace edits run LAST after line-based edits, preventing line number
shifts that would invalidate subsequent anchors
- P3: Update tool description from SHA-256 to xxHash32 to match actual
implementation in hash-computation.ts
Category-based delegation (task(category='quick')) was broken because
SISYPHUS_JUNIOR_AGENT sent 'sisyphus-junior' to session.prompt but
config.agent keys are now display names ('Sisyphus-Junior').
- Use getAgentDisplayName() for SISYPHUS_JUNIOR_AGENT constant
- Replace hardcoded 'sisyphus-junior' strings in tools.ts with constant
- Update background-output local constants to use display names
- Add remapCommandAgentFields() to translate command agent fields
- Add raw-key fallback in tool-config-handler agentByKey()
Use display names as config.agent keys so opencode shows proper names in UI
(Tab/@ menu). Key remapping happens after all agents are assembled but before
reordering, via remapAgentKeysToDisplayNames().
- agent-config-handler: set default_agent to display name, add key remapping
- agent-key-remapper: new module to transform lowercase keys to display names
- agent-priority-order: CORE_AGENT_ORDER uses display names
- tool-config-handler: look up agents by config key via agentByKey() helper
Remove crash-causing name fields from 6 agent configs (sisyphus, hephaestus,
atlas, metis, momus, prometheus). The name field approach breaks opencode
because Agent.get(agent.name) uses name as lookup key.
Add getAgentConfigKey() to agent-display-names.ts for resolving display names
back to lowercase config keys (e.g. 'Atlas (Plan Executor)' -> 'atlas').
- getSdkMessages now handles both response.data and direct array
responses from SDK
- Consolidated getMessageDir: storage.ts now re-exports from shared
opencode-message-dir.ts (with path traversal guards)
- Replace all response.data ?? [] with (response.data ?? response)
pattern across 14 files to handle SDK array-shaped responses
- Normalize SDK parts in parts-reader.ts by injecting sessionID/
messageID before validation (P1: SDK parts lack these fields)
- Treat unknown part types as having content in
recover-empty-content-message-sdk.ts to prevent false placeholder
injection on image/file parts
- Replace local isRecord with shared import in parts-reader.ts
- P1: Use compacted timestamp check instead of nonexistent truncated
field in target-token-truncation.ts
- P1: Use defensive (response.data ?? response) pattern in
hook-message-injector/injector.ts to match codebase convention
- P2: Filter by tool type in countTruncatedResultsFromSDK to avoid
counting non-tool compacted parts
- P2: Treat thinking/meta-only messages as empty in both
empty-content-recovery-sdk.ts and message-builder.ts to align
SDK path with file-based logic
- Re-read messages from SDK after injectTextPartAsync to prevent stale
snapshot from causing duplicate placeholder injection (P2)
- Replace local isRecord with shared import from record-type-guard (P3)
- P2: treat unknown part types as non-content in message-builder messageHasContentFromSDK
- P3: reuse shared isRecord from record-type-guard.ts in opencode-http-api
Unknown part types should be treated as content (return true)
to match parity with the existing message-builder implementation.
Using continue would incorrectly mark messages with unknown part
types as empty, triggering false recovery.
- isTodo: allow optional id to match Todo interface, preventing
todos without ids from being silently dropped
- messageHasContentFromSDK: treat unknown part types as empty
(continue) instead of content (return true) for parity with
existing storage logic
- readMessagesFromSDK in recover-empty-content-message-sdk: wrap
SDK call in try/catch to prevent recovery from throwing
The previous commit incorrectly removed this function and its test
as dead code. While the local implementations in other files have
different return types (MessageData[], MessagePart[]) and cannot be
replaced by this shared version, the function is a valid tested
utility. Deleting tests is an anti-pattern in this project.
- Encode path segments with encodeURIComponent in HTTP API URLs
to prevent broken requests when IDs contain special characters
- Remove unused readMessagesFromSDK from messages-reader.ts
(production callers use local implementations; dead code)
- Reduce timeout from 500ms to 200ms to lower CI execution time
- Add 10ms margin to elapsed time check for scheduler variance
- Replace pc.dim() string matching with call count assertion
to avoid ANSI escape code mismatch on CI runners
- target-token-truncation: eliminate redundant SDK messages fetch by
extracting tool results from already-fetched toolPartsByKey map
- recover-thinking-block-order: wrap SDK message fetches in try/catch
so recovery continues gracefully on API errors
- thinking-strip: guard against missing part.id before calling
deletePart to prevent invalid HTTP requests
The messages() mock in 'session_id with background=false' test did not
filter by session ID, causing resolveParentContext's SDK calls for
parent-session to increment messagesCallCount. This inflated
anchorMessageCount to 4 (matching total messages), so the poll loop
could never detect new messages and always hit MAX_POLL_TIME_MS.
Fix: filter messages() mock by path.id so only target session
(ses_continue_test) increments the counter. Restore MAX_POLL_TIME_MS
from 8000 back to 2000.
- runner.test.ts: waitForEventProcessorShutdown timeout 50ms → 500ms
(50ms was consistently too tight for CI runners)
- tools.test.ts: MAX_POLL_TIME_MS 2000ms → 8000ms
(polling timed out at ~2009ms on CI due to resource contention)
sessionExists() previously returned unconditional true on SQLite,
preventing ralph-loop orphaned-session cleanup from triggering.
Now uses sdkClient.session.messages() to verify session actually
exists. Callers updated to await the async result.
Addresses Cubic review feedback on PR #1837.
- executeDeduplication: now async, reads messages from SDK on SQLite via
client.session.messages() instead of JSON file reads
- truncateToolOutputsByCallId: now async, uses truncateToolResultAsync()
HTTP PATCH on SQLite instead of file-based truncateToolResult()
- deduplication-recovery: passes client through to both functions
- recovery-hook: passes ctx.client to attemptDeduplicationRecovery
Removes the last intentional feature gap on SQLite backend — dynamic
context pruning (dedup + tool-output truncation) now works on both
JSON and SQLite storage backends.
sessionExists() relied on JSON message directories which don't exist on
SQLite. Return true on SQLite and let readSessionMessages() handle lookup.
Also add empty-messages fallback in session_read for graceful not-found.
On SQLite backend, readParts() returns [] since JSON files don't exist.
Add isSqliteBackend() branch that reads parts from SDK via
client.session.messages() when failedAssistantMsg.parts is empty.
Rewrite opencode-message-dir.test.ts to use real temp directories instead
of mocking node:fs/node:path. Rewrite opencode-storage-detection.test.ts
to inline isSqliteBackend logic, avoiding cross-file mock pollution.
Resolves all 195 bun test failures (195 → 0). Full suite: 2707 pass.
On machines running OpenCode beta (v1.1.53+) with SQLite backend,
getMessageDir() returns null because isSqliteBackend() returns true.
This caused all 15 message-storage-dependent tests to fail.
Fix: mock opencode-storage-detection to force JSON mode, and use
ses_ prefixed session IDs to match getMessageDir's validation.
- Create src/shared/opencode-storage-paths.ts with all 4 constants
- Update 4 previous declaration sites to import from shared file
- Update additional OPENCODE_STORAGE usages for consistency
- Re-export from src/shared/index.ts
- No duplicate constant declarations remain
- Use shared OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE constants
- Make isCallerOrchestrator async with SDK fallback for beta
- Fix cache implementation using Symbol sentinel
- Update atlas hooks and sisyphus-junior-notepad to use async isCallerOrchestrator
- When deleting tasks, prefer matching by id if present
- Fall back to content matching only when todo has no id
- Prevents deleting unrelated todos with same subject
- Add content-based fallback matching for todos without ids
- Add TODO comment for exported but unused SDK functions
- Add resetStorageClient() for test isolation
- Fixes todo duplication risk on beta (SQLite backend)
- Add src/shared/opencode-storage-paths.ts with consolidated constants
- Update imports in hook-message-injector and session-manager
- Add src/shared/opencode-storage-detection.ts with isSqliteBackend()
- Add OPENCODE_SQLITE_VERSION constant
- Export all from shared/index.ts
- Make id field optional in all Todo interfaces (TodoInfo, Todo, TodoItem)
- Fix null-unsafe comparisons in todo-sync.ts to handle missing ids
- Add test case for todos without id field preservation
- All tests pass and typecheck clean
The polling loop in executeUnstableAgentTask only checked session status
and message stability, never checking if the background task itself had
been interrupted. This caused the tool call to hang until MAX_POLL_TIME_MS
(10 minutes) when a task was interrupted by prompt errors.
Add manager.getTask() check at each poll iteration to break immediately
on terminal statuses (interrupt, error, cancelled), returning a clear
failure message instead of hanging.
Reduce plan-template from 541 to 335 lines by removing redundant verbose
examples while recovering 3 lost context items: tool-type mapping table in
QA Policy, scenario specificity requirements (selectors/data/assertions/
timing/negative) in TODO template, and structured output format hints for
each Final Verification agent.
Strengthen TODO template to make QA scenarios non-optional with explicit
rejection warning. Add Final Verification Wave with 4 parallel review
agents: oracle (plan compliance audit), unspecified-high (code quality),
unspecified-high (real manual QA), deep (scope fidelity check) — each
with detailed verification steps and structured output format.
Add Maximum Parallelism Principle as a top-level constraint and replace
small-scale plan template examples (6 tasks, 3 waves) with production-scale
examples (24 tasks, 4 waves, max 7 concurrent) to steer the model toward
generating fine-grained, dependency-minimized plans by default.
TaskToastManager entries were never removed when tasks completed via
error, session deletion, stale pruning, or cancelled with
skipNotification. Ghost entries accumulated indefinitely, causing the
'Queued (N)' count in toast messages to grow without bound.
Added toastManager.removeTask() calls to all 4 missing cleanup paths:
- session.error handler
- session.deleted handler
- cancelTask with skipNotification
- pruneStaleTasksAndNotifications
Closes#1866
First message variant gate was unconditionally overwriting message.variant
with the fallback chain value (e.g. 'medium' for Hephaestus), ignoring
any variant the user had already selected via OpenCode UI.
Now checks message.variant === undefined before applying the resolved
variant, matching the behavior already used for subsequent messages.
Closes#1861
OpenCode 1.2.0+ changed reasoning-delta and text-delta to emit
'message.part.delta' instead of 'message.part.updated'. Without
handling this event, lastUpdate was only refreshed at reasoning-start
and reasoning-end, leaving a gap where extended thinking (>3min)
could trigger stale timeout.
Accept both event types as heartbeat sources for forward compatibility.
OpenCode uses 'busy'/'retry'/'idle' session statuses, not 'running'.
The stale timeout guard checked for type === 'running' which never
matched, leaving all background tasks vulnerable to stale-kill even
when their sessions were actively processing.
Change sessionIsRunning to check type !== 'idle' instead, protecting
busy and retrying sessions from premature termination.
The stale detection was checking lastUpdate timestamps BEFORE
consulting session.status(), causing tasks to be unfairly killed
after 3 minutes even when the session was actively running
(e.g., during long tool executions or extended thinking).
Changes:
- Reorder pollRunningTasks to fetch session.status() before stale check
- Skip stale-kill entirely when session status is 'running'
- Port no-lastUpdate handling from task-poller.ts into manager.ts
(previously manager silently skipped tasks without lastUpdate)
- Add sessionStatuses parameter to checkAndInterruptStaleTasks
- Add 7 new test cases covering session-status-aware stale detection
Both parent-session-notifier.ts and notify-parent-session.ts now include
parentTools in the promptAsync body, ensuring tool restrictions are
consistently applied across all notification code paths.
Pass parentTools from session-tools-store through the background task
lifecycle (launch → task → notify) so that when notifyParentSession
sends promptAsync, the original tool restrictions (e.g., question: false)
are preserved. This prevents the Question tool from re-enabling after
call_omo_agent background tasks complete.
Call setSessionTools(sessionID, tools) before every prompt dispatch so
the tools object is captured and available for later retrieval when
background tasks complete.
In-memory Map-based store that records tool restriction objects (e.g.,
question: false) by sessionID when prompts are sent. This enables
retrieving the original session's tool parameters when background tasks
complete and need to notify the parent session.
Add discoverProjectAgentsSkills() for project-level .agents/skills/ and
discoverGlobalAgentsSkills() for ~/.agents/skills/ — matching OpenCode's
native skill discovery paths (https://opencode.ai/docs/skills/).
Updated discoverAllSkills(), discoverSkills(), and createSkillContext()
to include these new sources with correct priority ordering.
Co-authored-by: dtateks <dtateks@users.noreply.github.com>
Closes#1818
The agent_pane_min_width config value was accepted in the schema and
passed as CapacityConfig.agentPaneWidth but never actually used — the
underscore-prefixed _config parameter in decideSpawnActions was unused,
and all split/capacity calculations used the hardcoded MIN_PANE_WIDTH.
Now decideSpawnActions, canSplitPane, isSplittableAtCount,
findMinimalEvictions, and calculateCapacity all accept and use the
configured minimum pane width, falling back to the default (52) when
not provided.
Closes#1781
Add test coverage for detectErrorType and extractMessageIndex with
edge cases: circular references, non-standard proxy errors, null input.
Wrap both functions in try/catch to prevent crashes from malformed
error objects returned by non-standard providers like Antigravity.
LLMs sometimes pass load_skills as a serialized JSON string instead
of an array. Add defensive JSON.parse before validation to handle
this gracefully.
Fixes#1701
Community-reported-by: @omarmciver
Z.ai GLM models don't support thinking/reasoning parameters.
Ensure these are omitted entirely to prevent empty responses.
Fixes#980
Community-reported-by: @iserifith
The isBinaryAvailableOnWindows() function used spawnSync("where")
which fails even when the binary IS on PATH, causing false negatives.
Removed the redundant pre-check and let nodeSpawn handle binary
resolution naturally with proper OS-level error messages.
Fixes#1805
The waitForEventProcessorShutdown test was comparing exact string match
against console.log spy, but picocolors wraps the message in ANSI dim
codes. On CI (bun 1.3.9) this caused the assertion to fail. Use
string containment check instead of exact argument match.
Tasks with no progress.lastUpdate were silently skipped in
checkAndInterruptStaleTasks, causing them to hang forever when the model
hangs before its first tool call. Now falls back to checking startedAt
against a configurable messageStalenessTimeoutMs (default: 10 minutes).
Closes#1769
loader.test.ts creates and deletes temp directories via process.chdir()
which causes 'current working directory was deleted' errors for subsequent
tests running in the same process. Move it to isolated step and enumerate
remaining skill-loader test files individually.
formatter.test.ts, format-default.test.ts, sync-executor.test.ts, and
session-creator.test.ts use mock.module() which pollutes bun's module
cache. Previously they ran both in the isolated step AND again in the
remaining tests step (via src/cli and src/tools wildcards), causing
cross-file contamination failures.
Now the remaining tests step enumerates subdirectories explicitly,
excluding the 4 mock-heavy files that are already run in isolation.
Reasoning/thinking models (Oracle, Claude Opus) were being killed by the
stale timeout because lastUpdate was only refreshed on tool-type events.
During extended thinking, no tool events fire, so after 3 minutes the
task was incorrectly marked as stale and aborted.
Move progress initialization and lastUpdate refresh before the tool-type
conditional so any message.part.updated event (text, thinking, tool)
keeps the task alive.
The non-interactive-env hook was prepending environment variables without checking
if the prefix was already applied to the command, causing duplication when multiple
git commands were executed in sequence.
This fix adds an idempotent check: if the command already starts with the env prefix,
the hook returns early without modification. This maintains the non-interactive behavior
while ensuring the operation is idempotent across multiple tool executions.
Remove boulder session restriction (f84ef532) and stagnation cap (10a60854)
that prevented continuation from firing in regular sessions.
Changes:
- Remove boulder/subagent session gate in idle-event.ts — continuation now
fires for ANY session with incomplete todos, as originally intended
- Remove stagnation cap (MAX_UNCHANGED_CYCLES) — agent must keep rolling
the boulder until all todos are complete, no giving up after 3 attempts
- Remove lastTodoHash and unchangedCycles from SessionState type
- Keep 30s cooldown (CONTINUATION_COOLDOWN_MS) as safety net against
re-injection loops
- Update tests: remove boulder gate tests, update stagnation test to verify
continuous injection, update non-main-session test to verify injection
42 tests pass, typecheck and build clean.
Records task history at 6 status transitions (pending, running×2, error,
cancelled, completed). Exports TaskHistory from background-agent barrel.
Passes backgroundManager and sessionID through compaction hook chain.
Adds §8 to compaction prompt instructing the LLM to preserve spawned agent
session IDs and resume them post-compaction instead of starting fresh.
Injects actual TaskHistory data when BackgroundManager is available.
In-memory tracker that survives BackgroundManager's cleanup cycles.
Records agent delegations with defensive copies, MAX 100 cap per parent,
undefined-safe upsert, and newline-sanitized formatForCompaction output.
Rename header to oMoMoMoMo Doctor to match installation guide branding.
Remove providers check entirely — no longer meaningful for diagnostics.
Fix comment-checker detection by resolving @code-yeongyu/comment-checker package path
in addition to PATH lookup.
When a custom agent's last assistant message contains only tool calls (no text/reasoning parts), the sync result fetcher returned empty content. Walk assistant messages newest-first to find the first one with actual text content.
Replace PreToolUse hook-based question tool blocking with the existing
tools parameter approach (tools: { question: false }) which physically
removes the tool from the LLM's toolset before inference.
The hook was redundant because every session.prompt() call already passes
question: false via the tools parameter. OpenCode converts this to a
PermissionNext deny rule and deletes the tool from the toolset, preventing
the LLM from even seeing it. The hook only fired after the LLM already
called the tool, wasting tokens.
Changes:
- Remove subagent-question-blocker hook invocation from PreToolUse chain
- Remove hook registration from create-session-hooks.ts
- Delete src/hooks/subagent-question-blocker/ directory (dead code)
- Remove hook from HookNameSchema and barrel export
- Fix sync-executor.ts missing question: false in tools parameter
- Add regression tests for both the removal and the tools parameter
- patch: ask user whether to add enhanced summary (skippable)
- minor/major: enhanced summary is now mandatory, not optional
- Update TODO descriptions and skip conditions accordingly
Extends the process.cwd() fix to cover all project-level loaders. In the desktop app, process.cwd() points to the app installation directory instead of the project directory, causing project-level agents, commands, and slash commands to not be discovered. Each function now accepts an optional directory parameter (defaulting to process.cwd() for backward compatibility) and callers pass ctx.directory from the plugin context.
OpenCode TUI reads input.subagent_type to display task type. When
subagent_type was missing (e.g., category-only or session continuation),
TUI showed 'Unknown Task'.
Fix:
- category provided: always set subagent_type to 'sisyphus-junior'
(previously only when subagent_type was absent)
- session_id continuation: resolve agent from session's first message
- fallback to 'continue' if session has no agent info
Project-level skills (.opencode/skills/ and .claude/skills/) were not
discovered in desktop app environments because the discover functions
hardcoded process.cwd() to resolve project paths. In desktop apps,
process.cwd() points to the app installation directory rather than the
user's project directory.
Add optional directory parameter to all project-level skill discovery
functions and thread ctx.directory from the plugin context through the
entire skill loading pipeline. Falls back to process.cwd() when
directory is not provided, preserving CLI compatibility.
isGptModel only matched openai/ and github-copilot/gpt- prefixes, causing
models like litellm/gpt-5.2 to fall into the Claude code path. This
injected Claude-specific thinking config, which the opencode runtime
translated into a reasoningSummary API parameter — rejected by OpenAI.
Extract model name after provider prefix and match against GPT model
name patterns (gpt-*, o1, o3, o4).
Closes#1788
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Port devxoul's PR #821 feature to current codebase structure.
Supports absolute, relative, ~/home paths with percent-encoding.
Gracefully handles malformed URIs and missing files with warnings.
Co-authored-by: devxoul <devxoul@gmail.com>
Commit 598a4389 refactored config-handler into separate modules but
dropped the disabledMcps parameter from loadMcpConfigs() and did not
handle the spread-order overwrite where .mcp.json MCPs (hardcoded
enabled:true) overwrote user's enabled:false from opencode.json.
Changes:
- Re-add disabledMcps parameter to loadMcpConfigs() in loader.ts
- Capture user's enabled:false MCPs before merge, restore after
- Pass disabled_mcps to loadMcpConfigs for .mcp.json filtering
- Delete disabled_mcps entries from final merged result
- Add 8 new tests covering both fixes
resolveSymlink and resolveSymlinkAsync incorrectly resolved relative
symlinks by using path.resolve(filePath, '..', linkTarget). This fails
when symlinks use multi-level relative paths (e.g. ../../skills/...) or
when symlinks are chained (symlink pointing to a directory containing
more symlinks).
Replace with fs.realpathSync/fs.realpath which delegates to the OS for
correct resolution of all symlink types: relative, absolute, chained,
and nested.
Fixes#1738
AI-assisted-by: claude-opus-4.6 via opencode
AI-contribution: partial
AI-session: 20260212-120629-4gTXvDGV
When delegate-task resumes a session via session_id, the response
task_metadata now includes a subagent field identifying which agent
was running in the resumed session. This allows the parent agent to
know what type of subagent it is continuing.
- sync-continuation: uses resumeAgent extracted from session messages
- background-continuation: uses task.agent from BackgroundTask object
- Gracefully omits subagent when agent info is unavailable
Previously, executeStopHooks returned immediately after the first hook
that produced valid JSON stdout, even if it was non-blocking. This
prevented subsequent hooks from executing.
This was problematic when users had multiple Stop hooks (e.g.,
check-console-log.js + task-complete-notify.sh in settings.json),
because the first hook's stdout (which echoed stdin data as JSON)
caused an early return, silently skipping all remaining hooks.
Now only explicitly blocking results (exit code 2 or decision=block)
cause an early return, matching Claude Code's behavior of executing
all Stop hooks sequentially.
Closes#1707
The SSE event stream subscription was missing the directory parameter,
causing the OpenCode server to only emit global events (heartbeat,
connected, toast) but not session-scoped events (session.idle,
session.status, tool.execute, message.updated, message.part.updated).
Without session events:
- hasReceivedMeaningfulWork stays false (no message/tool events)
- mainSessionIdle never updates (no session.idle/status events)
- pollForCompletion either hangs or exits for unrelated reasons
Fix: Pass { directory } to client.event.subscribe(), matching the
pattern already used by client.session.promptAsync().
Also adds a stabilization period (10s) after first meaningful work
as defense-in-depth against early exit race conditions.
Previously, a single validation error (e.g. wrong type for
prometheus.permission.edit) caused safeParse to fail and the
entire oh-my-opencode.json was silently replaced with {}.
Now loadConfigFromPath falls back to parseConfigPartially() which
validates each top-level key in isolation, keeps the sections that
pass, and logs which sections were skipped.
Closes#1767
The hook used exact string equality (agentName !== "prometheus") which fails
when display names like "Prometheus (Plan Builder)" are stored in session state.
Replace with case-insensitive substring matching via isPrometheusAgent() helper,
consistent with the pattern used in keyword-detector hook.
Closes#1764 (Bug 3)
- Detect namespaced commands (containing ':') from Claude marketplace plugins
- Provide clear error message explaining marketplace plugins are not supported
- Point users to .claude/commands/ as alternative for custom commands
- Fixes issue where /daplug:run-prompt gave ambiguous 'command not found'
Closes#1682
Replace path.startsWith('/') with path.isAbsolute() in directory
injector hooks. The startsWith('/') check only works on Unix-like
systems where absolute paths begin with '/'. On Windows, absolute
paths start with drive letters (e.g., C:\), causing resolveFilePath
to incorrectly treat them as relative and prepend the project
directory.
This follows the same pattern already used in
src/features/claude-tasks/storage.ts (commit 8e349aa).
Affected hooks:
- directory-agents-injector: AGENTS.md injection
- directory-readme-injector: README.md injection
MCP tool responses can have undefined output.output, causing TypeError
crashes in tool.execute.after hooks.
Changes:
- comment-checker/hook.ts: guard output.output with ?? '' before toLowerCase()
- edit-error-recovery/hook.ts: guard output.output with ?? '' before toLowerCase()
- task-resume-info/hook.ts: extract output.output ?? '' into outputText before all string operations
- Added tests for undefined output.output in edit-error-recovery and task-resume-info
When a user pins oh-my-opencode to a specific version (e.g., oh-my-opencode@3.4.0),
the auto-update checker now respects that choice and only shows a notification toast
instead of overwriting the pinned version with latest.
- Skip updatePinnedVersion() when pluginInfo.isPinned is true
- Show update-available toast only (notification, no modification)
- Added comprehensive tests for pinned/unpinned/autoUpdate scenarios
Fixes#1745
MCP tools can return non-string results (e.g. structured JSON objects).
When this happens, output.output is undefined, causing TypeError crashes
in edit-error-recovery and delegate-task-retry hooks that call methods
like .toLowerCase() without checking the type first.
Add typeof string guard in both hooks, consistent with the existing
pattern used in tool-output-truncator.
Allow individual categories to be disabled via `disable: true` in
config. Introduce shared `mergeCategories()` utility to centralize
category merging and disabled filtering across all 7 consumption sites.
When bun install fails after updating the config pin, the config now shows the
new version but the actual package is the old one. Add revertPinnedVersion() to
roll back the config entry on install failure, keeping config and installed
version in sync.
Ref #1472
Child session creation was injecting permission: { question: 'deny' } which
conflicted with OpenCode's child session permission handling, causing subagent
sessions to hang with 0 messages after creation (zombie state).
Remove the permission override from all session creators (BackgroundManager,
sync-session-creator, call-omo-agent) and rely on prompt-level tool restrictions
(tools.question=false) to maintain the intended policy.
Closes#1711
Instructs the orchestrator to read subagent notepad files
(.sisyphus/notepads/{planName}/) after task completion, ensuring
learnings, issues, and problems are propagated to subsequent delegations.
boulderState?.session_ids.includes() only guards boulderState, not
session_ids. If boulder.json is corrupted or missing the field,
session_ids is undefined and .includes() crashes silently, losing
subagent results.
Changes:
- readBoulderState: validate parsed JSON is object, default session_ids to []
- atlas hook line 427: boulderState?.session_ids?.includes
- atlas hook line 655: boulderState?.session_ids?.includes
- prometheus-md-only line 93: boulderState?.session_ids?.includes
- appendSessionId: guard with ?. and initialize to [] if missing
Fixes#1672
GitHub Web UI commits have web-flow as the author/committer,
causing CLA checks to fail even after the contributor signs.
Adding web-flow to the allowlist resolves this for all
contributors who edit files via the GitHub web interface.
df0b9f76 regressed look_at from synchronous prompt (session.prompt) to
async prompt (session.promptAsync) + pollSessionUntilIdle polling. This
introduced a race condition where the poller fires before the server
registers the session as busy, causing it to return immediately with no
messages available.
Fix: restore promptSyncWithModelSuggestionRetry (blocking HTTP call) and
remove polling entirely. Catch prompt errors gracefully and still attempt
to fetch messages, since session.prompt may throw even on success.
Closes#1716
## Summary
- Added 4 tests for disabled_agents validation in call_omo_agent tool
- Tests verify agent rejection when in disabled_agents list
- Tests verify case-insensitive matching
- Tests verify agents not in disabled list are allowed
- Tests verify empty disabled_agents allows all agents
Migration changes were only applied to rawConfig if file write succeeded,
leaving the running process on stale config. Also stops logging backup
path when the backup copy itself failed.
Reasoning parts could contain completion-like text triggering false
positives. Also handles session.messages returning either an array
or {data: [...]} shape.
DEFAULT_TIMEOUT_MS was 0 (no timeout), causing opencode run to hang forever
if the session never completed. Also attached .catch() to processEvents()
immediately to prevent unhandled promise rejections before Promise.race.
Main session was unconditionally allowed through the boulder session guard,
causing continuation injection into sessions not part of the active boulder.
Now only sessions explicitly in boulder's session_ids (or background tasks)
receive boulder continuation, matching todo-continuation-enforcer behavior.
- fix(background): include "interrupt" status in all terminal status checks (3 files)
- fix(background): display "INTERRUPTED" instead of "CANCELLED" for interrupted tasks
- fix(cli): add error recovery grace period in poll-for-completion
- fix(lsp): use JSONC parser for config loading to support comments
All changes verified with tests and typecheck.
- fix(delegate-task): return error on poll timeout instead of silent null
- fix(delegate-task): ensure toast and session cleanup on all error paths with try/finally
- fix(delegate-task): apply agent tool restrictions in sync-prompt-sender
- fix(plugin): add symmetric idle dedup to prevent double hook triggers
- fix(cli): replace regex-based JSONC editing with jsonc-parser in auth-plugins
- fix(cli): abort event stream after completion and restore no-timeout default
All changes verified with tests and typecheck.
- Add comprehensive TODO SYNC section documenting automatic
bidirectional sync between tasks and OpenCode todo system
- Improve sync-continuation.test.ts with proper mock modules
for pollSyncSession and fetchSyncResult dependencies
Replace unified 'task' tool documentation with 4 individual tools:
- task_create: Create task with auto-generated T-{uuid} ID
- task_list: List active tasks with summary
- task_get: Retrieve full task object by ID
- task_update: Update task fields with dependency support
Add detailed TASK TOOLS section with args tables and usage examples.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add tests for sync-continuation error paths and toast cleanup
- Add tests for sync-result-fetcher with anchor message support
- Expand sync-session-poller tests for edge cases and completion detection
- Add bulk cleanup test for recent-synthetic-idles
- Add proper error handling in executeSyncContinuation with try-catch blocks
- Ensure toast cleanup happens in all error paths via finally block
- Add anchorMessageCount tracking for accurate result fetching after continuation
- Improve fetchSyncResult to filter messages after anchor point
- Add silent failure detection when no new response is generated
- VERIFICATION_REMINDER: add Step 2 manual code review (non-negotiable)
- Require Read of EVERY changed file line by line
- Cross-check subagent claims vs actual code
- Verify logic correctness, completeness, edge cases, patterns
- Add Step 5: direct boulder state check via Read plan file
- Count remaining tasks directly, no cached state
- BOULDER_CONTINUATION_PROMPT: add first rule to read plan file immediately
- verification-reminders.ts: restructure steps 5-8 for boulder/todo checks
- Atlas default.ts (Claude): enhance 3.4 QA with A/B/C/D sections
- A: Automated verification
- B: Manual code review (non-negotiable)
- C: Hands-on QA (if applicable)
- D: Check boulder state directly
- Atlas gpt.ts (GPT-5.2): apply same QA enhancements with GPT-optimized structure
- verification_rules: update both Claude and GPT versions with manual review requirements
Addresses issue where Atlas would skip manual code inspection after delegation,
leading to rubber-stamping of broken or incomplete work.
The todo-continuation-enforcer was firing boulder continuation in ALL main
sessions with incomplete todos, regardless of whether /start-work was ever
executed. This caused unwanted BOULDER CONTINUATION directives in sessions
that never invoked /start-work.
Changes:
- Add readBoulderState check in idle-event.ts to verify session is registered
in boulder.json's session_ids array
- Change filter condition from main session check to boulder session check
- Add 4 new test cases for boulder session gate behavior
- Update all existing 41 tests to set up boulder state appropriately
Now boulder continuation only fires when:
1. Session is in boulder.json's session_ids (/start-work was executed), OR
2. Session is a background task session (subagent)
TDD cycle:
- RED: 2 new tests failed as expected (no boulder check in implementation)
- GREEN: Implementation added, all 41 tests pass
- REFACTOR: Full test suite 2513 pass, typecheck & build clean
Expand prompt structure comment to 4-field format (CONTEXT/GOAL/DOWNSTREAM/REQUEST).
Update all explore/librarian task() examples across Sisyphus, Hephaestus,
Prometheus interview-mode, and both ultrawork variants with richer context
including downstream usage, scope limits, and return format expectations.
OpenCode SDK does not expose client.model.list API. This caused the
provider-models cache to always be empty (models: {}), which in turn
caused delegate-task categories with requiresModel (e.g., 'deep',
'artistry') to fail with misleading 'Unknown category' errors.
Changes:
- connected-providers-cache.ts: Extract models from provider.list()
response's .all array instead of calling non-existent client.model.list
- category-resolver.ts: Distinguish between 'unknown category' and
'model not available' errors with clearer error messages
- Add comprehensive tests for both fixes
Bug chain:
client.model?.list is undefined -> empty cache -> isModelAvailable
returns false for requiresModel categories -> null returned from
resolveCategoryConfig -> 'Unknown category' error (wrong message)
ast-grep CLI silently ignores --update-all when --json=compact is
present, causing replace operations to report success while never
modifying files. Split into two separate CLI invocations.
Add session-status-normalizer to handle session.status events and
convert idle status to synthetic session.idle events. Includes
deduplication logic to prevent duplicate idle events within 500ms.
When boulderState.agent is not explicitly set (defaults to 'atlas'),
allow continuation for sessions where the last agent is 'sisyphus'.
This fixes the issue where boulder continuation was skipped when
Sisyphus took over the conversation after boulder creation.
Replace mock.module with spyOn + mockRestore to prevent fs module
pollution across test files. mock.module replaces the entire module
and caused 69 test failures in other files that depend on fs.
When task_system is enabled, the prompt said 'task tool: BLOCKED' which
LLMs interpreted as blocking task_create/task_update/task_list/task_get
too. Now the constraints section explicitly separates 'task (agent
delegation tool): BLOCKED' from 'task_create, task_update, ...: ALLOWED'
so Junior no longer refuses to use task management tools.
sisyphus-junior prompt always used todo-based discipline text regardless of
experimental.task_system setting because the useTaskSystem flag was never
forwarded from agent-config-handler to createSisyphusJuniorAgentWithOverrides.
Update notification systems to display INTERRUPTED status.
Add interrupt handling to background_output tool (terminal status).
Add interrupt-specific status note to formatTaskStatus.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Change promptAsync catch blocks to set status = "interrupt" instead of "error".
This distinguishes prompt errors from stale timeouts (cancelled) and TTL expirations (error).
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Category-based delegation should always route to sisyphus-junior even if
subagent_type is mistakenly provided, matching the original behavior and
preventing accidental bypass of category routing.
Sync task completion was fragile — detecting premature stability during
brief idle periods between tool calls. Now mirrors opencode's native
SessionPrompt.loop() logic: checks assistant finish reason is terminal
(not tool-calls/unknown) and assistant.id > user.id.
Also switches sync prompt sender from blocking HTTP (promptSync) to
async fire-and-forget (promptAsync) to avoid JSON parse errors in ACP.
session.prompt() may throw {} or JSON parse errors even when the server
successfully processes the request. Instead of crashing the tool, catch
all errors and proceed to fetch messages — if the response is available,
return it; otherwise return a clean error string.
Skill loaders previously only told agents that @path references are
relative to the skill directory, but agents often failed to resolve
them. Now @path/with/slash patterns are automatically expanded to
absolute paths during template construction.
pollForCompletion exited immediately when session went idle before agent
created TODOs or registered children (0 todos + 0 children = vacuously
complete). Add consecutive stability checks (3x500ms debounce) and
currentTool guard to prevent premature exit.
Extract pollForCompletion to dedicated module for testability.
Dev removed task-continuation-enforcer entirely. Remove all remaining
references from plugin hooks, event handler, tool-execute-before, and
config schema to align with origin/dev.
Previously, migrateConfigFile() mutated rawConfig directly. If the file
write failed (e.g. read-only file, permissions), the in-memory config was
already changed to the migrated values, causing the plugin to use migrated
models even though the user's file was untouched. On the next run, the
migration would fire again since _migrations was never persisted.
Now all mutations happen on a structuredClone copy. The original rawConfig
is only updated after the file write succeeds. If the write fails,
rawConfig stays untouched and the function returns false.
- Add improved type definitions for skill resolution
- Enhance executor with better type safety for delegation flows
- Add comprehensive test coverage for delegation tool behavior
- Improve code organization for skill resolver integration
🤖 Generated with assistance of OhMyOpenCode
- Use namespace import for connected-providers-cache for better clarity
- Add explicit type annotation for modelsByProvider to improve type safety
- Update tests to reflect refactored module organization
- Improve code organization while maintaining functionality
🤖 Generated with assistance of OhMyOpenCode
- Deny question prompts in CLI run mode since there's no TUI to answer them
- Inherit parent session permission rules in background task sessions
- Force deny questions while preserving other parent permission settings
- Add test coverage for permission inheritance behavior
🤖 Generated with assistance of OhMyOpenCode
Add permission: [{ permission: 'question', action: 'deny', pattern: '*' }]
to client.session.create() call to prevent background sessions from
asking questions that go unanswered, causing hangs.
- Create available-models.ts for model availability checking
- Create model-selection.ts for category-to-model resolution logic
- Update category-resolver, subagent-resolver, and sync modules to import
from new focused modules instead of monolithic sources
- Change BackgroundManager import to type-only to prevent global process
listener pollution across parallel test files
- Replace real BackgroundManager construction with createMockBackgroundManager
- Fix nested spyOn in config-handler tests to reuse beforeEach spy via
mockResolvedValue instead of re-spying inside test bodies
Migrate imports from monolithic `model-availability` to split modules
(`model-name-matcher`, `available-models-fetcher`, `model-cache-availability`).
Replace XDG_CACHE_HOME env var manipulation with `mock.module` for
`data-path`, ensuring test isolation without polluting process env.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add skill-resolver.ts for resolving skill configurations
- Handles skill loading and configuration resolution
- Part of modular delegate-task refactoring effort
🤖 Generated with assistance of OhMyOpenCode
- Export session-storage from claude-tasks/index.ts
- Add CLAUDE_CODE_TASK_LIST_ID fallback support in storage.ts
- Add comprehensive tests for CLAUDE_CODE_TASK_LIST_ID handling
- Prefer ULTRAWORK_TASK_LIST_ID, fall back to CLAUDE_CODE_TASK_LIST_ID
- Both env vars are properly sanitized for path safety
🤖 Generated with assistance of OhMyOpenCode
- Convert index.ts to clean barrel export
- Extract hook implementation to hook.ts
- Extract terminal parsing to parser.ts
- Extract state management to state-manager.ts
- Reduce index.ts from ~276 to ~5 lines
- Follow modular code architecture principles
🤖 Generated with assistance of OhMyOpenCode
- Update main AGENTS.md with current file sizes
- Update complexity hotspot line counts
- Update agent count from 11 to 32 files
- Update CLI utility count to 70
- Update test file count from 100+ to 163
🤖 Generated with assistance of OhMyOpenCode
- Change PROMETHEUS_PERMISSION bash from 'allow' to 'deny' to prevent unrestricted bash execution
- Prometheus is a read-only planner and should not execute bash commands
- The prometheus-md-only hook provides additional blocking as backup
- Extract getMessageDir to message-dir.ts
- Extract executeBackground to background-executor.ts
- Extract session creation logic to session-creator.ts
- Extract polling logic to completion-poller.ts
- Extract message processing to message-processor.ts
- Create sync-executor.ts to orchestrate sync execution
- Add ToolContextWithMetadata type to types.ts
- tools.ts now <200 LOC and focused on tool definition
Port handoff concept from ampcode as a builtin command that extracts
detailed context summary from current session for seamless continuation
in a new session. Enhanced with programmatic context gathering:
- Add HANDOFF_TEMPLATE with phased extraction (gather programmatic
context via session_read/todoread/git, extract context, format, instruct)
- Gather concrete data: session history, todo state, git diff/status
- Include compaction-style sections: USER REQUESTS (AS-IS) verbatim,
EXPLICIT CONSTRAINTS verbatim, plus all original handoff sections
- Register handoff in BuiltinCommandName type and command definitions
- Include session context variables (SESSION_ID, TIMESTAMP, ARGUMENTS)
- Add 14 tests covering registration, template content, programmatic
gathering, compaction-style sections, and emoji-free constraint
Revert .default([]) on load_skills schema back to required, restore the runtime error for missing load_skills, and add explicit load_skills=[] to all task() examples in agent prompts that were missing it.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
When experimental.task_system is enabled, add todowrite: deny and
todoread: deny to per-agent permissions for all primary agents
(sisyphus, hephaestus, atlas, prometheus, sisyphus-junior).
This ensures the model never sees these tools in its tool list,
complementing the existing global tools config and runtime hook.
Replace promptAsync + manual polling loop with promptSyncWithModelSuggestionRetry
(session.prompt) which blocks until the LLM response completes. This matches
OpenCode's native task tool behavior and fixes empty/broken responses that
occurred when polling declared stability prematurely.
Applied to both executeSyncTask and executeSyncContinuation paths.
Remove 'prometheus' from PLAN_AGENT_NAMES so isPlanAgent() no longer
matches prometheus. The only remaining connection is model inheritance
via buildPlanDemoteConfig() in plan-model-inheritance.ts.
- Remove 'prometheus' from PLAN_AGENT_NAMES array
- Update self-delegation error message to say 'plan agent' not 'prometheus'
- Update tests: prometheus is no longer treated as a plan agent
- Update task permission: only plan agents get task tool, not prometheus
Previously, demoted plan agent only received { mode: 'subagent' } with no
model settings, causing fallback to step-3.5-flash. Now inherits all
model-related settings (model, variant, temperature, top_p, maxTokens,
thinking, reasoningEffort, textVerbosity, providerOptions) from the
resolved prometheus config. User overrides via agents.plan.* take priority.
Prompt, permission, description, and color are intentionally NOT inherited.
When Anthropic models reject requests with 'This model does not support
assistant message prefill', detect this as a recoverable error type and
automatically send 'Continue' once to resume the conversation.
Extends session-recovery hook with new 'assistant_prefill_unsupported'
error type. The existing session.error handler in index.ts already sends
'continue' after successful recovery, so no additional logic needed.
Add targeted regression tests for the exact reproduction scenario from issue #1295:
- quick category with sisyphusJuniorModel override (the reported scenario)
- user-defined custom category with sisyphusJuniorModel fallback
The underlying fix was already applied in PRs #1470 and #1556. These tests
ensure the fix does not regress.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The ralph-loop hook calls promptAsync in the implementation, but the
test mock only defined prompt(). Added promptAsync with identical
behavior to make tests pass.
- All 38 ralph-loop tests now pass
- Total test suite: 2361 pass, 3 fail (unrelated to this change)
PR #1620 migrated all prompt calls from session.prompt (blocking) to
session.promptAsync (fire-and-forget HTTP 204). This broke look_at which
needs the multimodal-looker response to be available immediately after
the prompt call returns.
Fix: add promptSyncWithModelSuggestionRetry() that uses session.prompt
(blocking) with model suggestion retry support. look_at now uses this
sync variant while all other callers keep using promptAsync.
- Add promptSyncWithModelSuggestionRetry to model-suggestion-retry.ts
- Switch look_at from promptWithModelSuggestionRetry to sync variant
- Add comprehensive tests for the new sync function
- No changes to other callers (delegate-task, background-agent)
Convert grep, glob, ast-grep, and session-manager tools from static exports to factory functions that receive PluginInput context. This allows them to use ctx.directory instead of process.cwd(), fixing issue #658 where tools search from wrong directory in OpenCode Desktop app.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Addresses cubic review feedback — resolvedPath may contain
non-canonical segments when filePath is absolute, causing
the startsWith check against sisyphusRoot to fail.
Add isContinuationStopped check to atlas hook's session.idle handler
so boulder continuation stops when user runs /stop-continuation.
Previously, todo continuation and session recovery checked the guard,
but boulder continuation did not — causing work to resume after stop.
Fixes#1575
- Uses path.join(ctx.directory, '.sisyphus') + sep as prefix instead of loose .includes()
- Prevents false positive when .sisyphus exists in parent directories outside project root
- Adds test for the false positive case (cubic review feedback)
On Linux systems, 'sg' is a mailutils command, not ast-grep. The previous
fallback would silently run the wrong binary when ast-grep wasn't found.
Changes:
- getSgCliPath() now returns string | null instead of string
- Fallback changed from 'sg' to null
- Call sites now check for null and return user-facing error with
installation instructions
- checkEnvironment() updated to handle null path
Fixes#1365
- Add _migrations field to OhMyOpenCodeConfigSchema to track applied migrations
- Update migrateModelVersions() to accept appliedMigrations Set and return newMigrations array
- Skip migrations that are already in _migrations (preserves user reverts)
- Update migrateConfigFile() to read/write _migrations field
- Add 8 new tests for migration history tracking
Fixes#1570
Remove duplicate consoleErrorSpy declarations in 'command failure' and
'spawn error' tests that shadowed the outer beforeEach/afterEach-managed
spy. The inner declarations created a second spy on the already-spied
console.error, causing restore confusion and potential test leakage.
The 'port with available port starts server' test was calling
createOpencode from the SDK which spawns an actual opencode binary.
CI environments don't have opencode installed, causing ENOENT.
Mock @opencode-ai/sdk and port-utils (same pattern as
server-connection.test.ts) so the test verifies integration
logic without requiring the binary.
Implement all 5 CLI extension options for external orchestration:
- --port <port>: Start server on port, or attach if port occupied
- --attach <url>: Connect to existing opencode server
- --session-id <id>: Resume existing session instead of creating new
- --on-complete <command>: Execute shell command with env vars on completion
- --json: Output structured RunResult JSON to stdout
Refactor runner.ts into focused modules:
- agent-resolver.ts: Agent resolution logic
- server-connection.ts: Server connection management
- session-resolver.ts: Session create/resume with retry
- json-output.ts: Stdout redirect + JSON emission
- on-complete-hook.ts: Shell command execution with env vars
Fixes#1586
Some models (e.g. kimi-k2.5) return tool names with leading spaces
like ' delegate_task', causing tool matching to fail.
Add .trim() in transformToolName() and defensive trim in claude-code-hooks.
Fixes#1568
Add exception in write-existing-file-guard for .sisyphus/*.md files
so Prometheus can rewrite plan files without being blocked by the guard.
The prometheus-md-only hook (which runs later) still validates that only
Prometheus can write to these paths, preserving security.
Fixes#1576
When user explicitly configures an agent model in oh-my-opencode.json,
that model should take priority over the active model in OpenCode's config
(which may just be the system default, not a deliberate UI selection).
This fixes the issue where user-configured models from plugin providers
(e.g., google/antigravity-*) were being overridden by the fallback chain
because config.model was being passed as uiSelectedModel regardless of
whether the user had an explicit config.
The fix:
- Only pass uiSelectedModel when there's no explicit userModel config
- If user has configured a model, let resolveModelPipeline use it directly
Fixes#1573
Co-authored-by: Rishi Vhavle <rishivhavle21@gmail.com>
When user explicitly configures an agent model in oh-my-opencode.json,
that model should take priority over the active model in OpenCode's config
(which may just be the system default, not a deliberate UI selection).
This fixes the issue where user-configured models from plugin providers
(e.g., google/antigravity-*) were being overridden by the fallback chain
because config.model was being passed as uiSelectedModel regardless of
whether the user had an explicit config.
The fix:
- Only pass uiSelectedModel when there's no explicit userModel config
- If user has configured a model, let resolveModelPipeline use it directly
Fixes#1573
- Add "anthropic-effort" to HookNameSchema enum
- Import and create hook in plugin entry with isHookEnabled guard
- Wire chat.params event handler to invoke the effort hook
- First hook to use the chat.params lifecycle event from plugin
Injects `output_config: { effort: "max" }` via AI SDK's providerOptions
when all conditions are met:
- variant is "max" (sisyphus, prometheus, metis, oracle, unspecified-high, ultrawork)
- model matches claude-opus-4[-.]6 pattern
- provider is anthropic, opencode, or github-copilot (with claude model)
Respects existing effort value if already set. Normalizes model IDs
with dots to hyphens for consistent matching.
Fixes#1521. When hook matcher patterns contained regex special characters
like parentheses, the pattern-matcher would throw 'SyntaxError: Invalid
regular expression: unmatched parentheses' because these characters were
not escaped before constructing the RegExp.
The fix escapes all regex special characters (.+?^${}()|[\]\) EXCEPT
the asterisk (*) which is intentionally converted to .* for glob-style
matching.
Add comprehensive test suite for pattern-matcher covering:
- Exact matching (case-insensitive)
- Wildcard matching (glob-style *)
- Pipe-separated patterns
- All regex special characters (parentheses, brackets, etc.)
- Edge cases (empty matcher, complex patterns)
After model version update (opus-4-5 → opus-4-6), several agents had
identical duplicate fallback entries for the same model. The anthropic-only
entry was a superset covered by the broader providers entry, making it dead
code. Consolidate to single entry with all providers.
Cubic found that registering task-continuation-enforcer recovery callbacks
overrode the todo-continuation-enforcer callbacks. Compose the callbacks
so both enforcers receive abort/recovery notifications.
Mirrors todo-continuation-enforcer but reads from file-based task storage
instead of OpenCode's todo API. Includes 19 tests covering all skip
conditions, abort detection, countdown, and recovery scenarios.
Update plan-generation.ts to guide users to run /start-work with plan name.
For example: /start-work fix-bug instead of just /start-work
This makes it clearer which plan the user wants to execute.
Hephaestus now appears when any of its providers (openai, github-copilot, opencode) is
connected, rather than requiring the exact gpt-5.2-codex model. This allows users with
newer codex models (e.g., gpt-5.3-codex) to use Hephaestus without manual config overrides.
- Add requiresProvider field to ModelRequirement type
- Add isAnyProviderConnected() helper in model-availability
- Update hephaestus config from requiresModel to requiresProvider
- Update cli model-fallback to handle requiresProvider checks
Add claude-opus-4-6 as the first anthropic provider entry before
claude-opus-4-5 across all agent and category fallback chains.
Also add high variant mapping for think-mode switcher.
Gemini 3 Pro only supports 'low' and 'high' thinking levels according to
Google's official API documentation. The 'max' variant is not supported
and would result in API errors.
Changed variant: 'max' -> 'high' for gemini-3-pro in:
- oracle agent
- metis agent
- momus agent
- ultrabrain category
- deep category
- artistry category
Ref: https://ai.google.dev/gemini-api/docs/thinking-modeCloses#1433
Bun has unfixed segfault issues on Windows when spawning subprocesses
(oven-sh/bun#25798, #26026, #23043). Even upgrading to Bun v1.3.6+
does not resolve the crashes.
Instead of blocking LSP on Windows with version checks, use Node.js
child_process.spawn as fallback. This allows LSP to work on Windows
regardless of Bun version.
Changes:
- Add UnifiedProcess interface bridging Bun Subprocess and Node ChildProcess
- Use Node.js spawn on Windows, Bun spawn on other platforms
- Add CWD validation before spawn to prevent libuv null dereference
- Add binary existence pre-check on Windows with helpful error messages
- Enable shell: true for Node spawn on Windows for .cmd/.bat resolution
- Remove ineffective Bun version blocking (v1.3.5 check)
- Add tests for CWD validation and start() error handling
Closes#1047
Ref: oven-sh/bun#25798
Category delegation fails when provider-models.json contains model objects
with metadata (id, provider, context, output) instead of plain strings.
Line 196 in model-availability.ts assumes string[] format, causing:
- Object concatenation: `${providerId}/${modelId}` becomes "ollama/[object Object]"
- Empty availableModels Set passed to resolveModelPipeline()
- Error: "Model not configured for category"
This is the root cause of issue #1508 where delegate_task(category='quick')
fails despite direct agent routing (delegate_task(subagent_type='explore'))
working correctly.
Changes:
- model-availability.ts: Add type check to handle both string and object formats
- connected-providers-cache.ts: Update ProviderModelsCache interface to accept both formats
- model-availability.test.ts: Add 4 test cases for object[] format handling
Direct agent routing bypasses fetchAvailableModels() entirely, explaining why
it works while category routing fails. This fix enables category delegation
to work with manually-populated Ollama model caches.
Fixes#1508
When the main session is aborted while background tasks are running,
notifyParentSession() would attempt to call session.messages() and
session.prompt() on the aborted parent session, causing exceptions
that could crash the TUI.
- Add isAbortedSessionError() helper to detect abort-related errors
- Add abort check in session.messages() catch block with early return
- Add abort check in session.prompt() catch block with early return
- Add test case covering aborted parent session scenario
Fixes TUI crash when aborting main session with running background tasks.
- Changed priority order to: opencode-project > opencode > project > user
(OpenCode Global skills now take precedence over legacy Claude project skills)
- Updated JSDoc comments to reflect correct priority order
- Fixed test to use actual discoverSkills() for deduplication verification
- Changed test assertion from 'source' to 'scope' (correct field name)
- Added port-utils module with isPortAvailable, findAvailablePort, getAvailableServerPort
- Modified runner.ts to automatically find available port if preferred port is busy
- Shows warning message when using auto-selected port
- Eliminates need for manual OPENCODE_SERVER_PORT workaround
ToolContext type from @opencode-ai/plugin/tool does not include
a 'directory' property, causing typecheck failure after rebase from dev.
Changed to use process.cwd() which is the same pattern used in
session-manager/tools.ts.
Adds a PreToolUse hook that intercepts write operations and throws an error
if the target file already exists, guiding users to use the edit tool instead.
- Throws error: 'File already exists. Use edit tool instead.'
- Hook is enabled by default, can be disabled via disabled_hooks
- Includes comprehensive test suite with BDD-style comments
The auto-update-checker was operating on the wrong directory:
- CACHE_DIR (~/.cache/opencode) was used for node_modules, package.json, and bun.lock
- But plugins are installed in USER_CONFIG_DIR (~/.config/opencode)
This caused auto-updates to fail silently:
1. Update detected correctly (3.x.x -> 3.y.y)
2. invalidatePackage() tried to delete from ~/.cache/opencode (wrong!)
3. bun install ran but respected existing lockfile
4. Old version remained installed
Fix: Use USER_CONFIG_DIR consistently for all invalidation operations.
Also moves INSTALLED_PACKAGE_JSON constant to use USER_CONFIG_DIR for consistency.
Address review feedback (P3): The User-Installed Skills block was duplicated verbatim in two if/else branches in both buildCategorySkillsDelegationGuide() and Atlas buildSkillsSection(). Extract shared formatCustomSkillsBlock() with configurable header level (#### vs **) so both builders reference a single source of truth.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Atlas had its own buildSkillsSection() in atlas/utils.ts that rendered all skills in a flat table without distinguishing built-in from user-installed. Apply the same HIGH PRIORITY emphasis and CRITICAL warning pattern used in the shared prompt builder.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Custom skills from .config/opencode/skills/ were visible in agent prompts but the model consistently ignored them when delegating via delegate_task(). The flat skill table made no distinction between built-in and user-installed skills, causing the model to default to built-in ones only.
- Separate skills into 'Built-in Skills' and 'User-Installed Skills (HIGH PRIORITY)' sections in buildCategorySkillsDelegationGuide()
- Add CRITICAL warning naming each custom skill explicitly
- Add priority note: 'When in doubt, INCLUDE rather than omit'
- Show source column (user/project) for custom skills
- Apply same separation in buildUltraworkSection()
- Add 10 unit tests covering all skill combination scenarios
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Root cause fix for issue #927:
- After /plan → /start-work → interruption, in-memory sessionAgentMap is cleared
- getAgentFromMessageFiles() returns 'prometheus' (oldest message from /plan)
- But boulder.json has agent: 'atlas' (set by /start-work)
Fix: Check boulder state agent BEFORE falling back to message files
Priority: in-memory → boulder state → message files
Test: 3 new tests covering the priority logic
Address code review: continuation was blocked unless last agent was Atlas,
making the new agent parameter ineffective. Now the idle handler checks if
the last session agent matches boulderState.agent (defaults to 'atlas'),
allowing non-Atlas agents to resume when properly configured.
- Add getLastAgentFromSession helper for agent lookup
- Replace isCallerOrchestrator gate with boulder-agent-aware check
- Add test for non-Atlas agent continuation scenario
Add 'agent' field to BoulderState to track which agent (atlas) should
resume on session continuation. Previously, when user typed 'continue'
after interruption, Prometheus (planner) resumed instead of Sisyphus
(executor), causing all delegate_task calls to get READ-ONLY mode.
Changes:
- Add optional 'agent' field to BoulderState interface
- Update createBoulderState() to accept agent parameter
- Set agent='atlas' when /start-work creates boulder.json
- Use stored agent on boulder continuation (defaults to 'atlas')
- Add tests for new agent field functionality
OmoConfig interface was missing variant property, causing doctor to show
variants from ModelRequirement fallback chain instead of user's config.
- Add variant to OmoConfig agent/category entries
- Add userVariant to resolution info interfaces
- Update getEffectiveVariant to prioritize user variant
- Add tests verifying variant capture
- Make storage_path truly optional (remove default)
- Add task_list_id as config alternative to env var
- Fix build-schema.ts to use zodToJsonSchema
🤖 Generated with assistance of OhMyOpenCode
Remove outdated configuration section links that no longer exist.
Applies changes from PR #1386 (pierrecorsini).
Co-authored-by: Pierre CORSINI <pierrecorsini@users.noreply.github.com>
- Separate directory and file entries, process directories first
- Use Map to deduplicate skills by name (first-wins)
- Directory skills (SKILL.md, {dir}.md) take precedence over file skills (*.md)
- Add test for collision scenario
Addresses Oracle P2 review feedback from PR #1254
When promptWithModelSuggestionRetry() fails, the session was not being aborted, causing the polling loop to wait forever for an idle state. Added session.abort() calls in startTask() and resume() catch blocks.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Hephaestus: #FF4500 (Magma Orange) → #708090 (Slate Gray)
Blacksmith's hammer/iron theme, visible in both light and dark modes
- Prometheus: #9D4EDD (Amethyst Purple) → #FF5722 (Deep Orange)
Fire/flame theme, restoring the original fire color concept
Closes#704
Add support for base64-encoded image data in the look_at tool,
enabling analysis of clipboard/pasted images without requiring
a file path.
Changes:
- Add optional image_data parameter to LookAtArgs type
- Update validateArgs to accept either file_path or image_data
- Add inferMimeTypeFromBase64 function to detect image format
- Add try/catch around atob() to handle invalid base64 gracefully
- Update execute to handle both file path and data URL inputs
- Add comprehensive tests for image_data functionality
call_omo_agent is for lightweight exploration agents (explore, librarian).
metis/momus are consultation agents that should be invoked via delegate_task.
Reverts part of #1462 that incorrectly added metis/momus to call_omo_agent.
- Add metis and momus to AGENT_RESTRICTIONS with same pattern as oracle
- Deny write, edit, task, and delegate_task tools
- Enforces read-only design for these advisor agents
- Addresses cubic review feedback on #1462
* fix(model-requirements): use supported variant for gemini-3-pro
* fix(delegate-task): update artistry variant to high for gemini-3-pro
- Update DEFAULT_CATEGORIES artistry variant from 'max' to 'high'
- Update related test comment
- gemini-3-pro only supports low/high thinking levels, not max
- Addresses Oracle review feedback
* fix(model-availability): prefer exact model ID match in fuzzyMatchModel
* fix(model-availability): use filter+shortest for multi-provider tie-break
- Change Priority 2 from find() to filter()+reduce()
- Preserves shortest-match tie-break when multiple providers share model ID
- Add test for multi-provider same model ID case
- Addresses Oracle review feedback
The shellType was hardcoded to 'unix' which breaks on native Windows shells
(cmd.exe, PowerShell) when running without Git Bash or WSL.
This change uses the existing detectShellType() function to dynamically
determine the correct shell type, enabling proper env var syntax for all
supported shell environments.
createWebsearchConfig was called eagerly before checking disabledMcps,
causing Tavily missing-key error even when websearch was disabled.
Now each MCP is only created if not in disabledMcps list.
Previously tests were tautological - they defined local logic
instead of invoking the actual implementation. Now all tests
properly exercise createWebsearchConfig.
- Add skipNotification option to cancelTask method
- Apply skipNotification to background_cancel tool
- Prevents unwanted notifications when user cancels via tool
- Document TaskCreate, TaskGet, TaskList, TaskUpdate tools
- Note that these tools follow Claude Code internal specs but are not officially documented by Anthropic
- Include schema, dependency system, and usage examples
Plan agent demote now only sets mode to 'subagent' without spreading
prometheus config. This ensures plan agent uses OpenCode's default
prompt instead of inheriting prometheus prompt.
* fix(prometheus): enforce path constraints and atomic write protocol
- Add FORBIDDEN PATHS section blocking docs/, plan/, plans/ directories
- Add SINGLE ATOMIC WRITE protocol to prevent content loss from multiple writes
- Simplify PROMETHEUS_AGENTS array to single PROMETHEUS_AGENT string
* fix: reconcile Edit tool signature in interview-mode.ts with identity-constraints.ts
Identified by cubic: Edit tool usage was inconsistent between files.
- interview-mode.ts showed: Edit(path, content)
- identity-constraints.ts showed: Edit(path, oldString="...", newString="...")
Updated interview-mode.ts to use the correct Edit signature with oldString and newString parameters to match the actual tool API and prevent agent hallucination.
* refactor(background-agent): optimize cache timer lifecycle and result handling
Ultraworked with Sisyphus
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* refactor(background-task): simplify tool implementation and expand test coverage
Ultraworked with Sisyphus
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* fix(background-task): fix BackgroundCancel tool parameter handling
Correct parameter names and types in BackgroundCancel tool to match actual usage patterns. Add comprehensive test coverage for parameter validation.
---------
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Restructure prompt with XML tags for better instruction adherence
- Add output_verbosity_spec with concrete limits (≤7 steps, ≤3 sentences)
- Add uncertainty_and_ambiguity section with decision tree
- Add scope_discipline to prevent scope drift
- Add tool_usage_rules for efficient tool calling
- Add high_risk_self_check for architecture/security answers
- Add long_context_handling for large code inputs
- Update context to support session continuation follow-ups
- Convert github-pr-triage to streaming architecture (process PRs one-by-one with immediate reporting)
- Convert github-issue-triage to streaming architecture (process issues one-by-one with real-time updates)
- Add mandatory initial todo registration for both triage skills
- Add phase-by-phase todo status updates
- Generate final comprehensive report at the end
- Show live progress every 5 items during processing
Split monolithic atlas.ts into modular structure: index.ts (routing), default.ts (Claude-optimized), gpt.ts (GPT-optimized), utils.ts (shared utilities). Atlas now routes to appropriate prompt based on model type instead of overriding model settings.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* fix(shared): honor agent variant overrides
* test(shared): use model in fallback chain to verify override precedence
Address PR review: test now uses claude-opus-4-5 (which has default
variant 'max' in sisyphus chain) to properly verify that agent override
'high' takes precedence over the fallback chain's default variant.
Remove duplicate removeCodeBlocks() call in keyword-detector/index.ts.
The detectKeywordsWithType() function already calls removeCodeBlocks() internally, so calling it before passing the text was redundant and caused unnecessary double processing.
- Add syncTaskTodoUpdate function for immediate todo updates
- Integrate with TaskCreate and TaskUpdate tools
- Preserve existing todos when updating single task
- Add comprehensive tests for new sync function
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
In CLI run mode there is no TUI to answer questions, so the Question
tool would hang forever. This sets OPENCODE_CLI_RUN_MODE env var in
runner.ts and config-handler uses it to set question permission to
deny for sisyphus, hephaestus, and prometheus agents.
Add unit tests for resolveRunAgent() covering:
- CLI flag takes priority over env and config
- Env var takes priority over config
- Config takes priority over default
- Falls back to sisyphus when none set
- Skips disabled agent and picks next available core agent
Add resolveRunAgent() to determine agent with priority:
1. CLI --agent flag (highest)
2. OPENCODE_DEFAULT_AGENT environment variable
3. oh-my-opencode.json 'default_run_agent' config
4. 'sisyphus' (fallback)
Features:
- Case-insensitive agent name matching
- Warn and fallback when requested agent is disabled
- Pick next available core agent when default is disabled
Add optional 'default_run_agent' field to OhMyOpenCodeConfig schema.
This field allows users to configure the default agent for the 'run' command
via oh-my-opencode.json configuration file.
- Add Zod schema: z.string().optional()
- Regenerate JSON schema for IDE support
- Add github-pr-triage skill with conservative auto-close logic
- Update github-issue-triage ratio to 7:2:1 (unspecified-low:quick:writing)
- Add gh_fetch.py script for exhaustive GitHub pagination (issues/PRs)
- Script bundled in both skills + available standalone in uvscripts/
- Add task ID pattern validation (T-[A-Za-z0-9-]+) to prevent path traversal
- Refactor lock mechanism to use UUID-based IDs for reliable ownership tracking
- Implement atomic lock creation with stale lock detection and cleanup
- Add lock acquisition checks in create/update/delete handlers
- Expand task-reminder hook to track split tool names and clean up on session deletion
- Add comprehensive test coverage for validation and lock handling
* chore: pin bun-types to 1.3.6
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* chore: exclude test files and script from tsconfig
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor: remove sisyphus-swarm feature
Remove mailbox types and swarm config schema. Update docs.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor: remove legacy sisyphus-tasks feature
Remove old storage and types implementation, replaced by claude-tasks.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(claude-tasks): add task schema and storage utilities
- Task schema with Zod validation (pending, in_progress, completed, deleted)
- Storage utilities: getTaskDir, readJsonSafe, writeJsonAtomic, acquireLock
- Atomic writes with temp file + rename
- File-based locking with 30s stale threshold
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(tools/task): add task object schemas
Add Zod schemas for task CRUD operations input validation.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(tools): add TaskCreate tool
Create new tasks with sequential ID generation and lock-based concurrency.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(tools): add TaskGet tool
Retrieve task by ID with null-safe handling.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(tools): add TaskUpdate tool with claim validation
Update tasks with status transitions and owner claim validation.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(tools): add TaskList tool and exports
- TaskList for summary view of all tasks
- Export all claude-tasks tool factories from index
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hooks): add task-reminder hook
Remind agents to use task tools after 10 turns without task operations.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(config): add disabled_tools setting and tasks-todowrite-disabler hook
- Add disabled_tools config option to disable specific tools by name
- Register tasks-todowrite-disabler hook name in schema
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(config-handler): add task_* and teammate tool permissions
Grant task_* and teammate permissions to atlas, sisyphus, prometheus, and sisyphus-junior agents.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(delegate-task): add execute option for task execution
Add optional execute field with task_id and task_dir for task-based delegation.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(truncator): add type guard for non-string outputs
Prevent crashes when output is not a string by adding typeof checks.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* chore: export config types and update task-resume-info
- Export SisyphusConfig and SisyphusTasksConfig types
- Add task_tool to TARGET_TOOLS list
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(storage): remove team namespace, use flat task directory
* feat(task): implement unified task tool with all 5 actions
* fix(hooks): update task-reminder to track unified task tool
* refactor(tools): register unified task tool, remove 4 separate tools
* chore(cleanup): remove old 4-tool task implementation
* refactor(config): use new_task_system_enabled as top-level flag
- Add new_task_system_enabled to OhMyOpenCodeConfigSchema
- Remove enabled from SisyphusTasksConfigSchema (keep storage_path, claude_code_compat)
- Update index.ts to gate on new_task_system_enabled
- Update plugin-config.ts default for config initialization
- Update test configs in task.test.ts and storage.test.ts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* fix: resolve typecheck and test failures
- Add explicit ToolDefinition return type to createTask function
- Fix planDemoteConfig to use 'subagent' mode instead of 'all'
---------
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Unify slot ownership: processKey() owns the slot until task.concurrencyKey is set.
Previously, startTask() released the slot on errors (session.create catch,
createResult.error), but processKey() catch block didn't release, causing slot
leaks when errors occurred between acquire() and task.concurrencyKey assignment.
Changes:
- Remove all pre-transfer release() calls in startTask()
- Add conditional release in processKey() catch: only if task.concurrencyKey not set
- Add validation for createResult.data?.id to catch malformed API responses
This fixes 'Task failed to start within timeout' errors caused by exhausted
concurrency slots that were never released.
GitHub Copilot uses gemini-3-pro-preview and gemini-3-flash-preview as
the official model identifiers. The CLI installer was generating config
with incorrect names (gemini-3-pro, gemini-3-flash).
Reported by user: the install command was creating config with wrong
model names that don't work with GitHub Copilot API.
Remove the 'enabled' flag from babysitting config - the hook now runs
automatically when not disabled via disabled_hooks. This simplifies
configuration and makes the unstable model monitoring a default behavior.
BREAKING CHANGE: babysitting.enabled config option is removed. Use
disabled_hooks: ['unstable-agent-babysitter'] to disable the hook instead.
- Change session title from 'Task: {desc}' to '{desc} (@{agent} subagent)'
- Move session_id to structured <task_metadata> block for better parsing
- Add category tracking to BackgroundTask type and LaunchInput
- Add tests for new title format and metadata block
* refactor(keyword-detector): split constants into domain-specific modules
* feat(shared): add requiresAnyModel and isAnyFallbackModelAvailable
* feat(config): add hephaestus to agent schemas
* feat(agents): add Hephaestus autonomous deep worker
* feat(cli): update model-fallback for hephaestus support
* feat(plugin): add hephaestus to config handler with ordering
* test(delegate-task): update tests for hephaestus agent
* docs: update AGENTS.md files for hephaestus
* docs: add hephaestus to READMEs
* chore: regenerate config schema
* fix(delegate-task): bypass requiresModel check when user provides explicit config
* docs(hephaestus): add 4-part context structure for explore/librarian prompts
* docs: fix review comments from cubic (non-breaking changes)
- Move Hephaestus from Primary Agents to Subagents (uses own fallback chain)
- Fix Hephaestus fallback chain documentation (claude-opus-4-5 → gemini-3-pro)
- Add settings.local.json to claude-code-hooks config sources
- Fix delegate_task parameters in ultrawork prompt (agent→subagent_type, background→run_in_background, add load_skills)
- Update line counts in AGENTS.md (index.ts: 788, manager.ts: 1440)
* docs: fix additional documentation inconsistencies from oracle review
- Fix delegate_task parameters in Background Agents example (docs/features.md)
- Fix Hephaestus fallback chain in root AGENTS.md to match model-requirements.ts
* docs: clarify Hephaestus has no fallback (requires gpt-5.2-codex only)
Hephaestus uses requiresModel constraint - it only activates when gpt-5.2-codex
is available. The fallback chain in code is unreachable, so documentation
should not mention fallbacks.
* fix(hephaestus): remove unreachable fallback chain entries
Hephaestus has requiresModel: gpt-5.2-codex which means the agent only
activates when that specific model is available. The fallback entries
(claude-opus-4-5, gemini-3-pro) were unreachable and misleading.
---------
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
Replace platform-specific 'which'/'where' commands with cross-platform Bun.which() API to fix Windows compatibility issues and simplify code.
Fixes:
- #1027: Comment-checker binary crashes on Windows (missing 'check' subcommand)
- #1036: Session-notification listens to non-existent events
- #1033: Infinite loop in session notifications
- #599: Doctor incorrectly reports OpenCode as not installed on Windows
- #1005: PowerShell path detection corruption on Windows
Changes:
- Use Bun.which() instead of spawning 'which'/'where' commands
- Add 'check' subcommand to comment-checker invocation
- Remove non-existent event listeners (session.updated, message.created)
- Prevent notification commands from resetting their own state
- Fix edge case: clear notifiedSessions if activity occurs during notification
All changes are cross-platform compatible and tested on Windows/Linux/macOS.
- Extract prompt_append from override and append to prompt instead of shallow spread
- Add test verifying prompt_append is appended, not overwriting base prompt
- Fixes#723
Co-authored-by: Gabriel Ečegi <gabriel-ecegi@users.noreply.github.com>
* fix(tmux): send Ctrl+C before kill-pane and respawn-pane to prevent orphaned processes
* fix(tmux-subagent): prevent premature pane closure with stability detection
Implements stability detection pattern from background-agent to prevent
tmux panes from closing while agents are still working (issue #1330).
Problem: Session status 'idle' doesn't mean 'finished' - agent may still
be thinking/reasoning. Previous code closed panes immediately on idle.
Solution:
- Require MIN_STABILITY_TIME_MS (10s) before stability detection activates
- Track message count changes to detect ongoing activity
- Require STABLE_POLLS_REQUIRED (3) consecutive polls with same message count
- Double-check session status before closing
Changes:
- types.ts: Add lastMessageCount and stableIdlePolls to TrackedSession
- manager.ts: Implement stability detection in pollSessions()
- manager.test.ts: Add 4 tests for stability detection behavior
* test(tmux-subagent): improve stability detection tests to properly verify age gate
- First test now sets session age >10s and verifies 3 polls don't close
- Last test now does 5 polls to prove age gate prevents closure
- Added comments explaining what each poll does
- Add stubNotifyParentSession implementation to stub manager's notifyParentSession method
- Add stubNotifyParentSession calls to checkAndInterruptStaleTasks tests
- Add messages mock to client mocks for completeness
- Fix timer-based tests by using real timers (fakeTimers.restore) with wait()
- Increase timeout for tests that need real time delays
Remove isNonInteractive() check that was incorrectly added in PR #573.
The check prevented env var injection when OpenCode runs in a TTY,
causing git commands like 'git rebase --continue' to open editors (nvim)
that hang forever. The agent cannot interact with spawned bash processes
regardless of whether OpenCode itself is in a TTY.
Add CONTEXT + GOAL + QUESTION + REQUEST structure to agent delegation examples.
This guides users to provide richer context when invoking explore/librarian agents.
- Add thinking_max_chars?: number to BackgroundOutputOptions type
- Add thinking_max_chars argument to background_output tool schema
- Add formatFullSession option for controlling output format
- Add 2 tests for thinking_max_chars functionality
- Use nick-fields/retry@v3 for Build binary step
- 5 minute timeout per attempt
- Max 5 attempts with 10s wait between retries
- Prevents infinite hang on Bun cross-compile network issues
- Remove non-functional batch tool handling (OpenCode has no batch tool)
- Keep working direct tool call path (read/write/edit/multiedit)
- Apply same cleanup to directory-agents-injector and directory-readme-injector
- Add .sisyphus/rules directory support
- Replace setMainSession(undefined) with _resetForTesting() in keyword-detector tests
- Add _resetForTesting() to afterEach hooks for proper cleanup
- Un-skip the previously flaky mainSessionID test in state.test.ts
Fixes#848
Co-authored-by: 배지훈 <new0126@naver.com>
Track setTimeout timers in notifyParentSession using a completionTimers Map.
Clear all timers on shutdown() and when tasks are deleted via session.deleted.
This prevents the BackgroundManager instance from being held in memory by
uncancelled timer callbacks.
Fixes#1043
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
* fix: prevent zombie processes with proper process lifecycle management
- Await proc.exited for fire-and-forget spawns in tmux-utils.ts
- Remove competing process.exit() calls from LSP client and skill-mcp-manager
signal handlers to let background-agent manager coordinate final exit
- Await process exit after kill() in interactive-bash timeout handler
- Await process exit after kill() in LSP client stop() method
These changes ensure spawned processes are properly reaped and prevent
orphan/zombie processes when running with tmux integration.
* fix: address Copilot review comments on process cleanup
- LSP cleanup: use async/sync split with Promise.allSettled for proper subprocess cleanup
- LSP stop(): make idempotent by nulling proc before await to prevent race conditions
- Interactive-bash timeout: use .then()/.catch() pattern instead of async callback to avoid unhandled rejections
- Skill-mcp-manager: use void+catch pattern for fire-and-forget signal handlers
* fix: address remaining Copilot review comments
- interactive-bash: reject timeout immediately, fire-and-forget zombie cleanup
- skill-mcp-manager: update comments to accurately describe signal handling strategy
* fix: address additional Copilot review comments
- LSP stop(): add 5s timeout to prevent indefinite hang on stuck processes
- tmux-utils: log warnings when pane title setting fails (both spawn/replace)
- BackgroundManager: delay process.exit() to next tick via setImmediate to allow other signal handlers to complete cleanup
* fix: address code review findings
- Increase exit delay from setImmediate to 100ms setTimeout to allow async cleanup
- Use asyncCleanup for SIGBREAK on Windows for consistency with SIGINT/SIGTERM
- Add try/catch around stderr read in spawnTmuxPane for consistency with replaceTmuxPane
* fix: address latest Copilot review comments
- LSP stop(): properly clear timeout when proc.exited wins the race
- BackgroundManager: use process.exitCode before delayed exit for cleaner shutdown
- spawnTmuxPane: remove redundant log import, reuse existing one
* fix: address latest Copilot review comments
- LSP stop(): escalate to SIGKILL on timeout, add logging
- tmux spawnTmuxPane/replaceTmuxPane: drain stderr immediately to avoid backpressure
* fix: address latest Copilot review comments
- Add .catch() to asyncCleanup() signal handlers to prevent unhandled rejections
- Await proc.exited after SIGKILL with 1s timeout to confirm termination
* fix: increase exit delay to 6s to accommodate LSP cleanup
LSP cleanup can take up to 5s (timeout) + 1s (SIGKILL wait), so the exit
delay must be at least 6s to ensure child processes are properly reaped.
- Clear stop state when user sends new message (chat.message handler)
- Add isContinuationStopped check to session error recovery block
- Continuation resumes automatically after user interaction
- Add critical warnings about using --limit 500 instead of 100
- Add verification checklist before proceeding to Phase 2
- Add severity levels to anti-patterns (CRITICAL/HIGH/MEDIUM)
- Emphasize counting results and fetching additional pages if needed
* fix: resolve deadlock in config handler during plugin initialization
The config handler and createBuiltinAgents were calling fetchAvailableModels
with client, which triggers client.provider.list() API call to OpenCode server.
This caused a deadlock because:
- Plugin initialization waits for server response
- Server waits for plugin init to complete before handling requests
Now using cache-only mode by passing undefined instead of client.
If cache is unavailable, the fallback chain will use the first model.
Fixes#1301
* test: add regression tests for deadlock prevention in fetchAvailableModels
Add tests to ensure fetchAvailableModels is called with undefined client
during plugin initialization. This prevents regression on issue #1301.
- config-handler.test.ts: verify config handler does not pass client
- utils.test.ts: verify createBuiltinAgents does not pass client
* test: restore spies in utils.test.ts to prevent test pollution
Add mockRestore() calls for all spies created in test cases to ensure proper cleanup between tests and prevent state leakage.
* test: restore fetchAvailableModels spy
---------
Co-authored-by: robin <robin@watcha.com>
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
When cwd equals home directory, ~/.claude/settings.json was being loaded
twice (once as home config and once as cwd config), causing hooks like
Stop to execute twice.
This adds deduplication using Set to ensure each config file is only
loaded once.
- Reduce prompt from 392 to 125 lines
- Add APPROVAL BIAS: approve by default, reject only for blockers
- Limit max 3 issues per rejection to prevent overwhelming feedback
- Remove 'ruthlessly critical' tone, add 'practical reviewer' approach
- Add explicit anti-patterns section for what NOT to reject
- Define 'good enough' criteria (80% clear = pass)
- Update tests to match simplified prompt structure
* fix: exclude prompt/permission from plan agent config
plan agent should only inherit model settings from prometheus,
not the prompt or permission. This ensures plan agent uses
OpenCode's default behavior while only overriding the model.
* test(todo-continuation-enforcer): use FakeTimers for 15x faster tests
- Add custom FakeTimers implementation (~100 lines)
- Replace all real setTimeout waits with fakeTimers.advanceBy()
- Test time: 104.6s → 7.01s
* test(callback-server): fix race conditions with Promise.all and Bun.fetch
- Use Bun.fetch.bind(Bun) to avoid globalThis.fetch mock interference
- Use Promise.all pattern for concurrent fetch/waitForCallback
- Add Bun.sleep(10) in afterEach for port release
* test(concurrency): replace placeholder assertions with getCount checks
Replace 6 meaningless expect(true).toBe(true) assertions with
actual getCount() verifications for test quality improvement
* refactor(config-handler): simplify planDemoteConfig creation
Remove unnecessary IIFE and destructuring, use direct spread instead
* test(executor): use FakeTimeouts for faster tests
- Add custom FakeTimeouts implementation
- Replace setTimeout waits with fakeTimeouts.advanceBy()
- Test time reduced from ~26s to ~6.8s
* test: fix gemini model mock for artistry unstable mode
* test: fix model list mock payload shape
* test: mock provider models for artistry category
---------
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
- fetchAvailableModels now falls back to client.model.list() when cache is empty
- provider-models cache empty → models.json → client API (3-tier fallback)
- look-at tool explicitly passes registered agent's model to session.prompt
- Ensures multimodal-looker uses correctly resolved model (e.g., gemini-3-flash-preview)
- Add comprehensive tests for fuzzy matching and fallback scenarios
- Add kimiForCoding field to ProviderAvailability interface
- Add kimi-for-coding provider mapping in isProviderAvailable
- Include kimi-for-coding in Sisyphus fallback chain for non-max plan
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Remove uiSelectedModel from Atlas model resolution (use k2p5 as primary)
- Always overwrite provider-models.json on session start to prevent stale cache
- Add oracle vs artistry distinction in MANDATORY CERTAINTY PROTOCOL
- Update WHEN IN DOUBT examples with both delegation options
- Add artistry to IF YOU ENCOUNTER A BLOCKER section
- Add 'Hard problem (non-conventional)' row to AGENTS UTILIZATION table
- Update analyze-mode message with artistry specialist option
Oracle: conventional problems (architecture, debugging, complex logic)
Artistry: non-conventional problems (different approach needed)
- MUST search existing codebase for patterns before writing code
- MUST match project's existing conventions
- MUST write readable, human-friendly code
- Add variant: max to ultrabrain's gemini-3-pro fallback entry
- Rename STRATEGIC_CATEGORY_PROMPT_APPEND to ULTRABRAIN_CATEGORY_PROMPT_APPEND
- Keep original strategic advisor prompt content (no micromanagement instructions)
- Update description: use only for genuinely hard tasks, give clear goals only
- Update tests to match renamed constant
Subagents (explore, librarian, oracle, etc.) now use their own fallback
chain instead of inheriting the UI-selected model. This fixes the issue
where explore agent was incorrectly using Opus instead of Haiku.
- Add AgentMode type and static mode property to AgentFactory
- Each agent declares its own mode via factory.mode = MODE pattern
- createBuiltinAgents() checks source.mode before passing uiSelectedModel
setup-node with registry-url injects NODE_AUTH_TOKEN secret which is revoked.
Create .npmrc manually with empty _authToken to force OIDC authentication.
- Remove registry-url from setup-node (was injecting NODE_AUTH_TOKEN)
- Add npm version check and auto-upgrade for OIDC support (11.5.1+)
- Add explicit --registry flag to npm publish
- Remove empty NODE_AUTH_TOKEN/NPM_CONFIG_USERCONFIG env vars that were breaking OIDC
- Fix sessionTag showing '[undefine]' when sessionID is undefined
- System events now display as '[system]' instead
- Fix message.updated expecting non-existent 'content' field
- SDK's EventMessageUpdated only contains info metadata, not content
- Content is streamed via message.part.updated events
- Add text preview to message.part.updated verbose logging
- Update MessageUpdatedProps type to match SDK structure
- Update tests to reflect actual SDK behavior
PR #1227 incorrectly removed resolved.model from the userModel chain,
assuming it was bypassing the fallback chain. However, resolved.model
contained the category's DEFAULT_CATEGORIES model (e.g., quick ->
claude-haiku-4-5), not the main session model.
Without resolved.model, when connectedProvidersCache is null and
availableModels is empty, category model resolution falls through to
systemDefaultModel (opus) instead of using the category's default.
This fix restores the original priority:
1. User category model override
2. Category default model (from resolved.model)
3. sisyphusJuniorModel
4. Fallback chain
5. System default
The run command's completion check had a race condition: when a session
transitions busy->idle before the LLM generates any output (empty
response or API delay), checkCompletionConditions() returns true because
0 incomplete todos + 0 busy children = complete. This caused the runner
to exit with 'All tasks completed' before any work was done.
Fix:
- Add hasReceivedMeaningfulWork flag to EventState
- Set flag on: assistant text content, tool execution, or message update
with actual content (all scoped to main session only)
- Guard completion check in runner poll loop: skip if no meaningful work
has been observed yet
This ensures the runner waits until the session has produced at least one
observable output before considering completion conditions.
Adds 6 new test cases covering the race condition scenarios.
Add recursive directory scanning to discover skills in nested directories
like superpowers (e.g., skills/superpowers/brainstorming/SKILL.md).
Changes:
- Add namePrefix, depth, and maxDepth parameters to loadSkillsFromDir
- Recurse into subdirectories when no SKILL.md found at current level
- Construct hierarchical skill names (e.g., 'superpowers/brainstorming')
- Limit recursion depth to 2 levels to prevent infinite loops
This enables compatibility with the superpowers plugin which installs
skills as: ~/.config/opencode/skills/superpowers/ -> superpowers/skills/
Fixes skill discovery for nested directory structures.
* refactor(lsp): migrate to vscode-jsonrpc for improved stability
Replace custom JSON-RPC implementation with vscode-jsonrpc library.
Use MessageConnection with StreamMessageReader/Writer.
Implement Bun↔Node stream bridges for compatibility.
Preserve all existing functionality (warmup, cleanup, capabilities).
Net reduction of ~60 lines while improving protocol handling.
* fix(lsp): clear timeout on successful response to prevent unhandled rejections
---------
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
* fix: expand override.category and explicit reasoningEffort priority (#1219)
Two bugs fixed:
1. createBuiltinAgents(): override.category was never expanded into concrete
config properties (model, variant, reasoningEffort, etc.). Added
applyCategoryOverride() helper and applied it in the standard agent loop,
Sisyphus path, and Atlas path.
2. Prometheus config-handler: reasoningEffort/textVerbosity/thinking from
direct override now use explicit priority chains (direct > category)
matching the existing variant pattern, instead of relying on spread
ordering.
Priority order (highest to lowest):
1. Direct override properties
2. Override category properties
3. Resolved variant from model fallback chain
4. Factory base defaults
Closes#1219
* fix: use undefined check for thinking to allow explicit false
- BackgroundManager.shutdown() now aborts all running child sessions via
client.session.abort() before clearing state, preventing orphaned
opencode processes when parent exits
- Add onShutdown callback to BackgroundManager constructor, used to
trigger TmuxSessionManager.cleanup() on process exit signals
- Interactive bash session hook now aborts tracked subagent opencode
sessions when killing tmux sessions (defense-in-depth)
- Add 4 tests verifying shutdown abort behavior and callback invocation
Closes#1240
Tests in utils.test.ts were written before bffa1ad introduced
connected-providers-cache fallback in resolveModelWithFallback.
Update assertions to match the new resolution path:
- Oracle resolves to openai/gpt-5.2 via cache (not systemDefault)
- Agents are created via cache fallback even without systemDefaultModel
When delegate_task uses subagent_type, extract the matched agent's model
object and pass it explicitly to session.prompt/manager.launch. This
ensures the model is always in the correct object format regardless of
how OpenCode handles string→object conversion for plugin-registered
agents.
Closes#1225
* fix(start-work): prevent overwriting session agent if already set; inherit parent model for subagent types
* fix(model): include variant in StoredMessage model structure for better context propagation
* fix(injector): include variant in model structure for hook message injection
- Add uiSelectedModel parameter to resolveModelWithFallback()
- Update model resolution priority: UI Selection → Config Override → Fallback → System Default
- Pass config.model as uiSelectedModel in createBuiltinAgents()
- Fix ProviderModelNotFoundError when model is unset in config but selected in UI
- Remove resolved.model from userModel in tools.ts (was bypassing fallback chain)
- Use connected providers cache in model-resolver when availableModels is empty
- Allows proper provider selection (e.g., github-copilot instead of google)
When model cache is empty, the fallback chain resolution was blindly
trusting connected providers without verifying if the model actually
exists. This caused errors when a provider (e.g., opencode) was marked
as connected but didn't have the requested model (e.g., claude-haiku-4-5).
Now skips fallback chain entirely when model cache is unavailable and
falls through to system default, letting OpenCode handle the resolution.
When multimodal-looker agent returns empty/malformed response, the SDK
throws 'JSON Parse error: Unexpected EOF'. This commit adds try-catch
around session.prompt() to provide user-friendly error message with
troubleshooting guidance.
- Add error handling for JSON parse errors with detailed guidance
- Add error handling for generic prompt failures
- Add test cases for both error scenarios
- Change all prometheus references to plan agent in ultrawork mode
- Add MANDATORY OUTPUT section to ULTRAWORK_PLANNER_SECTION:
- Parallel Execution Waves structure
- Dependency Matrix format
- TODO List with category + skills + parallel group
- Agent Dispatch Summary table
- Plan agent now outputs parallel task graphs for orchestrator execution
* docs: add Ollama streaming NDJSON issue troubleshooting guide
- Document problem: JSON Parse error when using Ollama with stream: true
- Explain root cause: NDJSON vs single JSON object mismatch
- Provide 3 solutions: disable streaming, avoid tool agents, wait for SDK fix
- Include NDJSON parsing code example for SDK maintainers
- Add curl testing command for verification
- Link to issue #1124 and Ollama API docs
Fixes#1124
* docs: add Ollama provider configuration with streaming workaround
- Add Ollama Provider section to configurations.md
- Document stream: false requirement for Ollama
- Explain NDJSON vs single JSON mismatch
- Provide supported models table (qwen3-coder, ministral-3, lfm2.5-thinking)
- Add troubleshooting steps and curl test command
- Link to troubleshooting guide
feat: add NDJSON parser utility for Ollama streaming responses
- Create src/shared/ollama-ndjson-parser.ts
- Implement parseOllamaStreamResponse() for merging NDJSON lines
- Implement isNDJSONResponse() for format detection
- Add TypeScript interfaces for Ollama message structures
- Include JSDoc with usage examples
- Handle edge cases: malformed lines, stats aggregation
This utility can be contributed to Claude Code SDK for proper NDJSON support.
Related to #1124
* fix: use logger instead of console, remove trailing whitespace
- Replace console.warn with log() from shared/logger
- Remove trailing whitespace from troubleshooting guide
- Ensure TypeScript compatibility
* feat(delegate-task): add prometheus self-delegation block and delegate_task permission
- Block prometheus from delegating to itself via delegate_task
- Grant delegate_task permission to prometheus when called as subagent
- Other subagents still have delegate_task disabled
* feat(version): add OPENCODE_NATIVE_AGENTS_INJECTION_VERSION constant
* docs: add deprecation notes for directory-agents-injector
* feat(hooks): auto-disable directory-agents-injector for OpenCode 1.1.37+
---------
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
- Block prometheus from delegating to itself via delegate_task
- Grant delegate_task permission to prometheus when called as subagent
- Other subagents still have delegate_task disabled
- Add permission field to look_at and call_omo_agent session.create()
- Match pattern used in delegate_task and background-agent
- Add better error messages for Unauthorized failures
- Provide actionable guidance in error messages
This addresses potential session creation failures by ensuring
consistent session configuration across all tools that create
child sessions.
/review command and some Claude Code built-in commands trigger
tool.execute.after hooks with undefined output, causing crashes
when accessing output.metadata or output.output.
Fixes#1035
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Automated system messages with <system-reminder> tags were incorrectly
triggering [search-mode], [analyze-mode], and other keyword modes when
they contained words like "search", "find", "explore", etc.
Changes:
- Add removeSystemReminders() to strip <system-reminder> content before keyword detection
- Add hasSystemReminder() utility function
- Update keyword-detector to clean text before pattern matching
- Add comprehensive test coverage for system-reminder filtering
Fixes issue where automated system notifications caused agents to
incorrectly enter MAXIMUM SEARCH EFFORT mode.
Co-authored-by: TheEpTic <git@eptic.me>
Fixes#1021
The allowed-tools field in skill frontmatter now supports both formats:
- Space-separated string: 'allowed-tools: Read Write Edit Bash'
- YAML array: 'allowed-tools: [Read, Write, Edit, Bash]'
- Multi-line YAML array format also works
Previously, skills using YAML array format would silently fail to parse,
causing them to not appear in the <available_skills> list.
Changes:
- Updated parseAllowedTools() in loader.ts, async-loader.ts, and merger.ts
to handle both string and string[] types
- Updated SkillMetadata type to accept string | string[] for allowed-tools
- Added 4 test cases covering all allowed-tools formats
When oh-my-opencode is installed via npm global install and run as a
compiled binary, import.meta.url returns a virtual bun path ($bunfs)
instead of the actual filesystem path. This caused getCachedVersion()
to return null, resulting in 'unknown' version display.
Add fallback using process.execPath which correctly points to the actual
binary location, allowing us to walk up and find the package.json.
Fixes#1182
The repository owner (code-yeongyu) was not in the CLA allowlist,
causing CLA signature requirement on their own PRs.
Added code-yeongyu to the allowlist to skip CLA for owner commits.
Co-authored-by: 김연규 <yeongyu@mengmotaMacbookAir.local>
- Add spyOn for readConnectedProvidersCache to return connected providers
- Tests now work consistently regardless of actual provider cache state
- Fixes CI failures for category variant and unstable agent tests
- Add timing.ts module for test-only timing configuration
- Replace hardcoded wait times with getTimingConfig()
- Enable all previously skipped tests (ralph-loop, session-state, delegate-task)
- Tests now complete in ~2s instead of timing out
Show warning toast when hasConnectedProvidersCache() returns false,
indicating model filtering is disabled. Prompts user to restart
OpenCode for full functionality.
When no provider cache exists, skip the fallback chain entirely and let
OpenCode use Provider.defaultModel() as the final fallback. This prevents
incorrect model selection when the plugin loads before providers connect.
- Remove forced first-entry fallback when no cache
- Add log messages for cache miss scenarios
- Update tests for new behavior
Config validation was failing when 'dev-browser' was set as the browser
automation provider, causing the entire config to be rejected. This
silently disabled all config options including tmux.enabled.
- Add 'dev-browser' as valid option in BrowserAutomationProviderSchema
- Update JSDoc with dev-browser description
- Regenerate JSON schema
- Change prometheus mode from 'primary' to 'all' to allow delegate_task calls
- Restore plan agent demote logic to use prometheus config as base
- Revert d481c596 changes that broke plan agent inheritance
Plan agent was incorrectly inheriting prometheus's entire config (prompt,
permission, etc.) causing it to behave as primary instead of subagent.
Now plan agent:
1. Uses plan config model if explicitly set
2. Falls back to prometheus model only if plan config has no model
3. Keeps original OpenCode plan config intact
This PR was incorrectly merged by AI agent without proper project owner review.
The AI evaluated this as 'ULTRA SAFE' because it only modified README files,
but failed to recognize that adding external fork promotions to the project
README requires explicit project owner approval - not just technical safety.
This reverts commit 912a56db85.
- Add permission: [{ permission: 'question', action: 'deny' }] to session.create()
in background-agent and delegate-task for SDK-level blocking
- Add subagent-question-blocker hook as backup layer to intercept question tool
calls in tool.execute.before event
- Ensures subagents cannot ask questions to users and must work autonomously
Add support for customizing the OpenCode server port and hostname via
environment variables. This enables orchestration tools like Open Agent
to run multiple concurrent missions without port conflicts.
Environment variables:
- OPENCODE_SERVER_PORT: Custom port for the OpenCode server
- OPENCODE_SERVER_HOSTNAME: Custom hostname for the OpenCode server
When running oh-my-opencode in parallel (e.g., multiple missions in
Open Agent), each instance can now use a unique port to avoid conflicts
with the default port 4096.
The previous documentation implied that categories automatically use their
built-in default models (e.g., Gemini for visual, GPT-5.2 for ultrabrain).
This was misleading. Categories only use built-in defaults if explicitly
configured. Otherwise, they fall back to the system default model.
Changes:
- Add explicit warning about model resolution priority
- Document all 7 built-in categories (was only showing 2)
- Show complete example config with all categories
- Explain the wasteful fallback scenario
- Add 'variant' to supported category options
Fixes confusion where users expect optimized model selection but get
system default for all unconfigured categories.
Co-authored-by: DC <vmlinux@p16.tailnet.freeflight.co>
Context7 should mirror `websearch` by only sending auth when
`CONTEXT7_API_KEY` is set.
Change: set bearer auth in `headers` using `CONTEXT7_API_KEY` if said environment variable is set, otherwise leave `headers` to `undefined`.
- Add zai-coding-plan provider with GLM 4.7 and GLM 4.6v models
- Add OpenAI provider with GPT-5.2 models
- Configure unspecified-low category to use zai-coding-plan/glm-4.7
- Auth is provided via OPENCODE_AUTH_JSON secret
- 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
- Add MANDATORY section for delegate_task(subagent_type='plan') at top of ultrawork prompt
- Establish 'DELEGATE by default, work yourself only when trivial' principle
- Add parallel execution rules with anti-pattern and correct pattern examples
- Remove emoji (checkmark/cross) from PLAN_AGENT_SYSTEM_PREPEND
- Restructure workflow into clear 4-step sequence
- Add prometheus model fallback chain (claude-opus-4-5 → gpt-5.2 → gemini-3-pro)
- Plan agent now inherits prometheus settings (model, prompt, permission, variant)
- Plan agent mode remains 'subagent' while using prometheus config
- Add name field to prometheus config to fix agent.name undefined error
Add mandatory sections to PLAN_AGENT_SYSTEM_PREPEND:
- Task Dependency Graph with blockers/dependents/reasons
- Parallel Execution Graph with wave structure
- Category + Skills recommendations per task
- Response format specification with exact structure
Uses ASCII art banners and visual emphasis for critical requirements.
When plan agent (plan/prometheus/planner) is invoked via delegate_task,
automatically prepend a <system> prompt instructing the agent to:
- Launch explore/librarian agents in background to gather context
- Summarize user request and list uncertainties
- Ask clarifying questions until requirements are 100% clear
- Remove mandatory model requirement from plugin initialization
- Allow OpenCode to use its built-in model fallback when user doesn't specify
- Update model-resolver to handle undefined systemDefaultModel
- Remove throw errors in config-handler, utils, atlas, delegate-task
- Add tests for optional model scenarios
Closes#1129
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
Closes#1063
Investigation findings:
- The CLI code correctly reads version from package.json
- The reported issue (bunx showing old version) is a caching issue
- Added test to ensure version is read as valid semver from package.json
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
- Add --port flag requirement for tmux subagent pane spawning
- Add Fish shell function example with automatic port allocation
- Add Bash/Zsh equivalent function example
- Document how subagent panes work (opencode attach flow)
- Add OPENCODE_PORT environment variable documentation
- Add server mode reference section with opencode serve command
- Account for tmux pane dividers (1 char) in all size calculations
- Reduce MIN_PANE_WIDTH from 53 to 52 to fit 2 columns in standard terminals
- Fix enforceMainPaneWidth to use (windowWidth - divider) / 2
- Add virtual mainPane handling for close-spawn eviction loop
- Add comprehensive decision-engine tests (23 test cases)
* fix: generate skill/slashcommand tool descriptions synchronously when pre-provided
When skills are passed via options (pre-resolved), build the tool description
synchronously instead of fire-and-forget async. This eliminates the race
condition where the description getter returns the bare prefix before the
async cache-warming microtask completes.
Fixes#1039
* chore: changes by sisyphus-dev-ai
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
All documentation, agent prompts, and skill descriptions were still
referencing the old 'skills' parameter name for delegate_task, but the
tool implementation requires 'load_skills' (renamed in commit aa2b052).
This caused confusion and errors for users following the docs.
Fixes#1008
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
* fix(ralph-loop): skip user messages in transcript completion detection (#622)
The transcript-based completion detection was searching the entire JSONL
file for <promise>DONE</promise>, including user message entries. The
RALPH_LOOP_TEMPLATE instructional text contains this literal pattern,
which gets recorded as a user message, causing false positive completion
detection on every iteration. This made the loop always terminate at
iteration 1.
Fix: Parse JSONL entries line-by-line and skip entries with type 'user'
so only tool_result/assistant entries are checked for the completion
promise. Also remove the hardcoded <promise>DONE</promise> from the
template exit conditions as defense-in-depth.
* chore: changes by sisyphus-dev-ai
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Update TIP banner from beta.10 to stable 3.0 in all languages
- Add Korean language link to Japanese and Chinese READMEs
- Add DeepWiki badge to Japanese and Chinese READMEs
- Adjust DeepWiki badge position in Korean README for consistency
MODEL_TO_CATEGORY_MAP was missing the mapping for google/gemini-3-flash
to the 'writing' category. Users who had configured agents with
model: 'google/gemini-3-flash' would not get auto-migrated to
category: 'writing'.
Ref: PR #1057 review comment
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
On Windows with Bun v1.3.5 and earlier, spawning LSP servers causes
a segmentation fault crash. This is a known Bun bug fixed in v1.3.6.
Added version check before LSP server spawn that:
- Detects Windows + affected Bun versions (< 1.3.6)
- Throws helpful error with upgrade instructions instead of crashing
- References the Bun issue for users to track
Closes#1047
Add thinking mode support for Z.AI's GLM-4.7 model via the zai-coding-plan provider.
Changes:
- Add zai-coding-plan to THINKING_CONFIGS with extra_body.thinking config
- Add glm pattern to THINKING_CAPABLE_MODELS
- Add comprehensive tests for GLM thinking mode
GLM-4.7 uses OpenAI-compatible API with extra_body wrapper for thinking:
- thinking.type: 'enabled' or 'disabled'
- thinking.clear_thinking: false (Preserved Thinking mode)
Closes#1030
- Remove invalid Pick<Plugin> type usage
- Add explicit input/output type annotations
- Add comprehensive test suite (5 tests)
- Tests verify truncation at 30 chars with '...' suffix
When AI generates AskUserQuestion tool calls with option labels longer
than 30 characters, opencode validation rejects them with "too_big" error.
This fix adds a pre-tool-use hook that automatically truncates labels
to 30 characters (with "..." suffix) before the validation occurs.
Fixes the error:
"The question tool was called with invalid arguments: expected string
to have <=30 characters"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a later-loaded MCP config (e.g., .claude/.mcp.json) marks a server
as disabled, it now properly removes that server from both the servers
object and loadedServers array.
Previously, disabled servers were only skipped during loading, which
meant they wouldn't override servers loaded from earlier configs. This
made it impossible to disable project-level MCPs using local overrides.
Now the disabled flag works as expected: local configs can disable
servers defined in project or user configs.
This ensures that commands defined in src/features/builtin-commands/commands.ts
(like /start-work, /refactor, /init-deep) are visible to the slashcommand tool
and the agent. Previously, only markdown-based commands were discovered.
The background_task config (providerConcurrency, modelConcurrency, etc.)
was not being passed to BackgroundManager, causing all models to use
the hardcoded default limit of 5 instead of user-configured values.
- Add 'compaction' to DEFAULT_SKIP_AGENTS
- Skip compaction agent messages when resolving agent info
- Skip injection when compaction occurred but no real agent resolved
- Replace cooldown-based approach with agent-based filtering
- Create Header component with logo, nav, theme toggle, language switcher
- Create Sidebar component with doc navigation from config
- Create Footer component
- Create MobileNav component with hamburger menu
- Create navigation config file (docsConfig)
- Integrate all layout components into [locale]/layout.tsx
- Add framer-motion for mobile nav animations
- All tests passing, build successful
- Successfully installed @opennextjs/cloudflare v1.15.1
- Fixed Vitest configuration to exclude e2e tests
- Renamed e2e test files from .spec.ts to .e2e.ts to avoid Bun test runner conflicts
- Updated eslint.config.mjs and playwright.config.ts
- All tests passing: Vitest (1/1), Playwright (6/6)
- Production bundle size: ~5MB < 10MiB limit
- Marked TODO 0 complete in plan
OpenCode downloads LSP servers (like clangd) to ~/.local/share/opencode/bin,
but isServerInstalled() only checked ~/.config/opencode/bin. This caused
LSP tools to report servers as 'not installed' even when OpenCode had
successfully downloaded them.
Add ~/.local/share/opencode/bin to the detection paths to match OpenCode's
actual behavior.
Co-authored-by: yimingll <yimingll@users.noreply.github.com>
* fix(skill): enforce agent restriction in createSkillTool
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* fix(skill): block restricted skills when agent context missing
Addresses cubic review feedback: previously agent-restricted skills
could be invoked when ctx or ctx.agent was undefined because the
guard only ran when ctx?.agent was truthy.
Changed condition from:
skill.definition.agent && ctx?.agent && skill.definition.agent !== ctx.agent
To:
skill.definition.agent && (!ctx?.agent || skill.definition.agent !== ctx.agent)
This ensures restricted skills are blocked unless the exact matching
agent is present in the context.
---------
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Bun cross-compilation from Linux to Windows produces binaries that crash
with 'Segmentation fault at address 0xFFFFFFFFFFFFFFFF'.
Root cause: oven-sh/bun#18416
Solution:
- Use windows-latest runner for Windows platform in publish-platform.yml
- Set shell: bash for consistent behavior across runners
This is a simpler fix than PR #938 which modified publish.yml (wrong workflow).
The platform binaries are built and published by publish-platform.yml.
Fixes#873Fixes#844
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
When git commands fail (e.g., not in a repo, invalid HEAD), git outputs
help text to stderr. Without explicit stdio option, execSync inherits
the parent's stdio causing help text to appear on terminal during
delegate_task execution.
Add stdio: ['pipe', 'pipe', 'pipe'] to capture stderr instead of
letting it leak to terminal.
When availableModels is empty (no cache in CI), use the first entry
from fallbackChain directly instead of falling back to systemDefault.
This ensures categories and agents use their configured models even
when the model cache file doesn't exist.
Fixes:
- model-resolution check returning 'warn' instead of 'pass' in CI
- DEFAULT_CATEGORIES not being used when no cache available
- Unstable agent detection failing (models falling back to non-gemini)
resolveModelWithFallback() returns entry-specific variant but it was being
ignored. Agents like oracle now correctly get variant 'high' from their
fallback chain entry instead of undefined.
- Added isModelCacheAvailable() to check if cache file exists
- Shows warning toast on session start if cache is missing
- Suggests running 'opencode models --refresh' or restarting
- Changed fetchAvailableModels to read from ~/.cache/opencode/models.json
- Prevents plugin startup hanging caused by SDK client.config.providers() call
- Updated doctor model-resolution check to show available models from cache
- Added cache info display: provider count, model count, refresh command
- Remove Step 3 in model-resolver that forced first fallbackChain entry
even when unavailable, blocking system default fallback
- Add sisyphusJuniorModel option to delegate_task so agents["Sisyphus-Junior"]
model override is respected in category-based delegation
- Update tests to reflect new fallback behavior
- Add variant to ModelResolutionResult return type
- Return variant from matched fallback entry
- Add normalizeModelName() for Claude model hyphen/period differences
- Add transformModelForProvider() for github-copilot model names
- Update delegate-task to use resolved variant (user config takes priority)
- Fix test expectations for new fallback behavior
- Replace collector.register() with direct output.parts[textIndex].text modification
- All keyword types (ultrawork, search, analyze) now prepend to user message text
- Message format: keyword message + '---' separator + original text
- Update tests to verify text transformation instead of collector registration
- All 18 tests pass
- Add sisyphus-orchestrator → atlas hook rename mapping
- Add null mappings for removed hooks (preemptive-compaction, empty-message-sanitizer)
- Update migrateHookNames() to filter out removed hooks and return removed list
- Log warning when obsolete hooks are removed from disabled_hooks
- Add tests for new migration scenarios
Apply case-insensitive utilities across agents, delegation, and tool
restrictions. Removes duplicate implementations from agents/utils.ts.
Agent validation now normalizes input to canonical names.
Add findCaseInsensitive, includesCaseInsensitive, findByNameCaseInsensitive,
and equalsIgnoreCase functions for consistent case-insensitive lookups across
the codebase. Enables 'Oracle', 'oracle', 'ORACLE' to work interchangeably.
- Update category tables to match DEFAULT_CATEGORIES in constants.ts
- Remove non-existent 'most-capable' and 'general' categories
- Add 'unspecified-low' and 'unspecified-high' categories
- Update model names to full paths (e.g., openai/gpt-5.2-codex)
- Add new CategoryConfig schema fields: description, variant, top_p, etc.
- Fix atlas.ts prompt examples with correct category names
Generate tool description dynamically from available categories and skills. Remove hardcoded DELEGATE_TASK_DESCRIPTION constant. Improve parameter handling with unified 'subagent_type' field replacing 'agent'.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Simplify sisyphus prompt by removing redundant sections and inline generation. Delete generate-sisyphus-prompt.ts as prompts are now managed directly in the agent definition.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Convert createBuiltinAgents to async function that fetches available models at plugin init time. Add case-insensitive matching helpers and integrate discovered skills from both builtin and user sources.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add new 'model-resolution' check to diagnose model fallback chain health. Validates that configured agents and categories can resolve to available models, surfacing misconfiguration early.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Replace complex fallback logic with new shared model resolution utilities. The model-fallback module now delegates to resolveModelWithFallback() for cleaner, consistent model selection across the codebase.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Implement resolveModelWithFallback() that tries: 1) user override, 2) fuzzy match from requirements chain against available models, 3) system default. Export new model utilities from shared index.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Implement fuzzyMatchModel() for case-insensitive substring matching with provider filtering. Add fetchAvailableModels() to get available models from OpenCode client with caching.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Define ModelRequirement type with FallbackEntry chains for multi-provider model resolution. Each agent and category specifies ordered fallback preferences with provider arrays and optional variants.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Multiple files were hardcoding ~/.config/opencode paths instead of using
getOpenCodeConfigDir() which respects the OPENCODE_CONFIG_DIR env var.
This broke profile isolation features like OCX ghost mode, where users
set OPENCODE_CONFIG_DIR to a custom path but oh-my-opencode.json and
other configs weren't being read from that location.
Changes:
- plugin-config.ts: Use getOpenCodeConfigDir() directly
- cli/doctor/checks: Use getOpenCodeConfigDir() for auth and config checks
- tools/lsp/config.ts: Use getOpenCodeConfigDir() for LSP config paths
- command loaders: Use getOpenCodeConfigDir() for global command dirs
- hooks: Use getOpenCodeConfigDir() for hook config paths
- config-path.ts: Mark getUserConfigDir() as deprecated
- tests: Ensure OPENCODE_CONFIG_DIR is properly isolated in tests
- publish.yml: main package only, triggers platform workflow on success
- publish-platform.yml: dedicated workflow with fresh OIDC token per run
- Fixes OIDC token expiration during large binary uploads (~40MB+)
- Platform workflow can also be triggered manually via workflow_dispatch
OpenCode v1.1.30+ added HTTP-based SessionList/Read/Search/Info tools that
require localhost:4096 server. Renamed our tools to PascalCase to override
them with local file-based implementation, fixing 'Unable to connect' errors.
- Split monolithic publish into build + parallel publish-platform + publish-main + release jobs
- Each platform package gets its own OIDC token (fixes token expiration during large binary uploads)
- Add --prepare-only flag to publish.ts for build step version sync
- Matrix strategy: 7 parallel platform jobs
- publish-main waits for all platforms before publishing main package
NPM_CONFIG_PROVENANCE env var was overriding useProvenance=false in code.
Now explicitly sets NPM_CONFIG_PROVENANCE=false for platform packages
to prevent OIDC token expiration during large binary uploads.
- Fix 404 error handling: no longer incorrectly marks failed publishes as 'already published'
- Add REPUBLISH mode: allows re-publishing missing platform packages without version check
- Separate tag and branch push: tag push (critical) succeeds even if branch push fails
- Fix changelog for beta releases: compares against previous beta tag instead of latest stable
- Add checkPackageVersionExists for accurate E403 error handling
Fixes#472
When user sets agents.explore.model in oh-my-opencode.json, the config
was being ignored because OpenCode's built-in explore agent overwrote it.
Filter out agents that oh-my-opencode provides from OpenCode's config
to ensure user config takes precedence.
- Change skill directory from 'skill' (singular) to 'skills' (plural) to match OpenCode standard
- Use getOpenCodeConfigDir() to respect OPENCODE_CONFIG_DIR environment variable
- Update documentation and tests to reflect correct paths
Fixes#810
Use dynamic import instead of require.resolve() to detect @ast-grep/napi
installation. This fixes false negatives when running via bunx where the
module exists in ~/.config/opencode/node_modules but isn't resolvable
from the temporary execution directory.
Also adds fallback path checks for common installation locations.
Fixes#898
Anthropic's extended thinking error messages contain 'tool_use' and 'tool_result'
in the documentation URL text, causing incorrect detection as tool_result_missing
instead of thinking_block_order.
Fix: Check thinking_block_order BEFORE tool_result_missing.
Previously, unstable agents (gemini models, is_unstable_agent=true) were
forced to background mode but returned immediately with task ID. This
caused callers to lose visibility into results.
Now: launch as background for monitoring stability, but poll and wait
for completion, returning actual task output like sync mode.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Implements intelligent model selection based on available providers.
Priority order: Native > Copilot > OpenCode Zen > Z.ai > Ultimate Fallback.
- Add model-fallback.ts with MODEL_CATALOG and capability-based resolution
- Extend InstallConfig with hasOpencodeZen and hasZaiCodingPlan
- Add TUI prompts and CLI args for new provider options
- Z.ai gets Librarian priority (zai-coding-plan/glm-4.7)
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add 'CORRECT: Background Exploration' example with run_in_background=true
- Update PARALLEL_EXECUTION examples with correct params (subagent_type, run_in_background, skills)
- Ensures agents fire explore/librarian in parallel as background tasks
- Rename agent name from 'atlas' to 'Atlas' (PascalCase like Sisyphus, Metis, Momus)
- Add migration for lowercase 'atlas' -> 'Atlas' for backward compatibility
- Keep hook name as 'atlas' (lowercase) to match other hook naming conventions
- Update all references in types, schema, hooks, commands, and tests
Detects unstable agents via is_unstable_agent config or gemini in model
name. Forces background mode even when run_in_background=false, with
system message explaining the forced conversion for monitoring.
Adds optional is_unstable_agent boolean field to CategoryConfigSchema.
When enabled (or auto-detected for gemini models), forces background
mode for monitoring stability even when run_in_background=false.
Sisyphus and Atlas prompts were missing delegation guide because
availableCategories and availableSkills were not being passed to
createSisyphusAgent() and createAtlasAgent() in utils.ts.
This caused buildCategorySkillsDelegationGuide() to return empty string,
resulting in agents not knowing when/how to delegate to explore, librarian,
or use category+skills based delegation.
Previously, when using categories like 'quick', the parent session's model
(e.g., Opus 4.5) would override the category's built-in model (e.g., Haiku).
Fixed priority: userConfig.model → category built-in → systemDefault
The inherited model from parent session no longer affects category-based
delegation - categories have their own explicit models.
- Delete document-writer.ts agent file
- Remove from types, schema, utils, index exports
- Remove tool restrictions entry
- Remove migration mappings
- Update atlas.ts to use category="writing" instead of agent="document-writer"
- Update init-deep command template
- Update all documentation (AGENTS.md, README.*, docs/)
- Regenerate schema.json
document-writer functionality is now handled via delegate_task with
category="writing" which uses the writing category's model config.
- Remove temperature from all categories
- Consolidate CATEGORY_MODEL_CATALOG into DEFAULT_CATEGORIES
- Replace 'general' and 'most-capable' with 'unspecified-low' and 'unspecified-high'
- Add Selection_Gate to unspecified categories to force deliberate selection
- Update quick category to use claude-haiku-4-5
- Update all references and tests across codebase
- Remove chatgpt option from CLI args and types
- Remove ChatGPT prompt from TUI installer flow
- Update config detection to not include hasChatGPT
- Update related tests
Update all documentation files to use 'atlas' instead of 'orchestrator-sisyphus'. AGENTS.md, src/agents/AGENTS.md, docs/features.md, docs/guide/overview.md all updated.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The OpenCode server may not be fully initialized even after
reporting 'listening'. Add retry with exponential backoff (3 attempts)
and proper error handling to make session creation more robust.
This fixes CI failures where session.create() fails immediately
after server startup.
Fixes#935 (CI failure)
- Add session.status re-check in stability detection before completing
- Reset stablePolls if session is not idle (agent still working)
- Fix statusText to show CANCELLED instead of COMPLETED for non-completed tasks
- Add GitHub Copilot subscription question to Step 0
- Add --copilot flag to CLI examples
- Change 'WE ALL COVER THEM' to 'OPENCODE COVERS THEM ALL'
- Add 'For Humans' section with bunx/npx commands to Japanese README
- Create docs/features.md with full Features documentation
- Update README.md with compact summary and link to docs
- Update README.ja.md with localized compact summary
- Update README.zh-cn.md with localized compact summary
- Remove 831 lines of duplicated content across READMEs
- Fixed delegate-task/tools.ts to access openCodeConfig.data.model instead of openCodeConfig.model
- Updated error messages to use getOpenCodeConfigPaths() for cross-platform paths
- Fixed 12 test mocks to use correct { data: { model: ... } } structure
- Fixes delegation failing with 'requires a default model' even when model is configured
BREAKING CHANGE: Model resolution overhauled
- Created centralized model-resolver.ts with priority chain:
userModel → inheritedModel → systemDefaultModel
- Removed model field from all 7 DEFAULT_CATEGORIES entries
- Removed DEFAULT_MODEL constants from 10 agents
- Removed singleton agent exports (use factories instead)
- Made CategoryConfigSchema.model optional
- CLI no longer generates model overrides
- Empty strings treated as unset (uses fallback)
Users must now:
1. Use factory functions (createOracleAgent, etc.) instead of singletons
2. Provide model explicitly or use systemDefaultModel
3. Configure category models explicitly if needed
Fixes model fallback bug where hardcoded defaults overrode
user's OpenCode configured model.
Remove overly restrictive parallel execution constraints that were
preventing orchestrator from using background agents effectively.
- Change from 'RARELY NEEDED' to 'DEFAULT behavior'
- Remove 5+ query requirement for background agents
- Remove anti-pattern warnings that discouraged delegation
- Align with sisyphus.ts parallel execution philosophy
- Change skills type from string[] | null to string[]
- Allow skills=[] for no skills, reject skills=null
- Remove emojis from error messages and prompts
- Update tests accordingly
OpenCode's OAuth auto-detection was causing context7 and grep_app MCPs
to be disabled despite having enabled: true. Only websearch was working.
Root cause: Remote MCP servers trigger OAuth detection by default in
OpenCode, which can mark MCPs as 'needs_auth' or 'disabled' status
even when they don't require OAuth.
Fix: Add oauth: false to all 3 built-in MCP configs to explicitly
disable OAuth auto-detection. These MCPs either:
- Use no auth (context7, grep_app)
- Use API key header auth (websearch with EXA_API_KEY)
- Root AGENTS.md: Updated timestamp, commit hash, line counts
- src/agents/AGENTS.md: Updated to 50 lines, current structure
- src/cli/AGENTS.md: Updated to 57 lines, current structure
- src/features/AGENTS.md: Updated to 65 lines, current structure
- src/hooks/AGENTS.md: Updated to 53 lines, current structure
- src/shared/AGENTS.md: Updated to 52 lines, core utilities
- src/tools/AGENTS.md: Updated to 50 lines, tool categories
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Changed lsp_diagnostics error handling to throw errors instead of returning strings
- Line 211: Changed from `return output` to `throw new Error(output)`
- Makes errors display as proper error blocks in TUI
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Added withOperationRetry<T>() helper method that retries operations up to 3 times
- Catches "Not connected" errors (case-insensitive)
- Cleans up stale client before retry
- Modified callTool, readResource, getPrompt to use retry logic
- Added tests for retry behavior (3 new test cases)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
fix: pass model parameter when resuming background tasks
Ensure resumed tasks maintain their original model configuration
from category settings, preventing unexpected model switching.
Previous test was setting mainSessionID to 'main-session-123' and the
next test expected undefined. The outer beforeEach wasn't properly
resetting state between tests in the nested describe block.
Adding a nested beforeEach ensures proper test isolation.
Skip all keyword detection for background task sessions to prevent mode
injection (e.g., [analyze-mode], [search-mode]) which incorrectly triggers
Prometheus planner restrictions on Sisyphus sessions.
This aligns with the existing pattern used in:
- sisyphus-orchestrator (line 504)
- todo-continuation-enforcer (line 303)
- session-notification (line 278)
Closes#713
The import was pointing to non-existent sisyphus-task/constants,
updated to delegate-task/constants where DEFAULT_CATEGORIES is defined.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Handle Windows where lookup and prefer exe/cmd/bat; fall back to ps1 and run via PowerShell for version detection.
Tests: bun test src/cli/doctor/checks/opencode.test.ts
Add 5-second cooldown between continuation injections to prevent rapid-fire
session.idle events from causing infinite loop when boulder has incomplete tasks.
Bug: When switching from Prometheus to Sisyphus, the Prometheus ultrawork
template was still injected because:
1. setSessionAgent() only sets on first call, ignoring subsequent updates
2. keyword-detector relied solely on input.agent which could be stale
Fix:
- Use updateSessionAgent() instead of setSessionAgent() in index.ts
- keyword-detector now uses getSessionAgent() as primary source, fallback to input.agent
- Added tests for agent switch scenario
category-default is the intended behavior for builtin categories,
not a fallback. Only show toast warning when:
- inherited: model from parent session (custom category without model)
- system-default: OpenCode's global default model
User-defined and category-default are both expected behaviors,
so no warning is needed.
Previously, parent model string would override category default model,
causing categories like 'ultrabrain' to use the parent's model (e.g., sonnet)
instead of the intended category default (e.g., gpt-5.2).
Model priority is now:
1. userConfig.model (oh-my-opencode.json override)
2. defaultConfig.model (category default)
3. parentModelString (fallback)
4. systemDefaultModel (last resort)
The transform hook was failing to inject synthetic parts because
message.info.sessionID is not always available in the OpenCode SDK.
Fix: Use getMainSessionID() as fallback when message.info.sessionID is undefined.
This ensures keyword-detector and claude-code-hooks content (like ulw/ultrawork)
is properly injected even when the SDK doesn't provide sessionID in message.info.
- Remove injectPendingContext function (no longer needed)
- Remove createContextInjectorHook function (chat.message hook removed)
- Change transform hook from prepend to synthetic part insertion
- Follow empty-message-sanitizer pattern (minimal field set)
- synthetic: true flag hides content from UI but passes to model
- Synthetic part inserted BEFORE user text part
- Remove intermediate questions before plan generation
- Auto-proceed with Metis consultation
- Generate plan immediately after Metis review
- Add Post-Plan Self-Review with gap classification:
- CRITICAL: requires user input
- MINOR: auto-resolve silently
- AMBIGUOUS: apply default and disclose
- Present summary with auto-resolved items and decisions needed
- Ask high accuracy question after summary
The resume method was not passing the stored model from the task,
causing Sisyphus-Junior to revert to the default model when resumed.
This fix adds the model to the prompt body in resume(), matching
the existing behavior in launch().
Fixes#826
- Add sisyphus_task: deny to global config.permission
- Add sisyphus_task: allow exception for orchestrator-sisyphus, Sisyphus, and Prometheus (Planner)
- Ensures only orchestrator agents can spawn sisyphus_task subagents
Use createAgentToolAllowlist to allow only 'read' tool for multimodal-looker agent.
Previously denied write/edit/bash but allowed other tools.
Now uses wildcard deny pattern (*: deny) with explicit read allow.
- Add createAgentToolAllowlist function for allowlist-based restrictions
- Support legacy fallback for older OpenCode versions
- Add 4 test cases covering both permission systems
- Add mandatory PROJECT-LEVEL code checks (lsp_diagnostics at src/ or . level)
- Strengthen verification duties with explicit QA checklist
- Add 'SUBAGENTS LIE - VERIFY EVERYTHING' reminders throughout
- Emphasize that only orchestrator sees full picture of cross-file impacts
- Remove 'Start Sisyphus work session' text check, keep only <session-context> tag
- Update interactive_bash description with WARNING: TMUX ONLY emphasis
- Update tests to use <session-context> wrapper
OpenCode API returns different structures for user vs assistant messages:
- User: info.model = { providerID, modelID } (nested)
- Assistant: info.modelID, info.providerID (flat top-level)
Previous code only checked nested format, causing model info loss when
continuation hooks fired after assistant messages.
Files modified:
- todo-continuation-enforcer.ts
- ralph-loop/index.ts
- sisyphus-task/tools.ts
- background-agent/manager.ts
Added test for assistant message model extraction.
- Unified verification (Step 1-3) and post-verification (Step 4-6) into continuous workflow
- Step 4: Immediate plan file marking after verification passes
- Step 5: Commit atomic unit
- Step 6: Proceed to next task
- Emphasized immediacy: 'RIGHT NOW - Do not delay'
- Applied to both boulder state and standalone reminder contexts
- Move Turn Termination Rules inside <system-reminder> block (from line 488 to ~186)
- Add Final Constraint Reminder at end of prompt (constraint sandwich pattern)
- Preserve all existing interview mode detail and strategies
Applies OpenCode's effective constraint patterns to prevent plan-mode agents
from offering to implement work instead of staying in consultation mode.
- Change skills type from string[] to string[] | null
- Empty array [] now returns error with available skills list
- null is allowed for tasks that genuinely need no skills
- Updated tests to use skills: null instead of skills: []
- Forces explicit decision: either specify skills or justify with null
The prometheus-md-only hook was not enforcing file restrictions because
getSessionAgent() returned undefined - setSessionAgent was only called
in message.updated event which doesn't always provide agent info.
- Add setSessionAgent call in chat.message hook when input.agent exists
- Add session state tests for setSessionAgent/getSessionAgent
- Add clearSessionAgent cleanup to prometheus-md-only tests
This ensures prometheus-md-only hook can reliably identify Prometheus
sessions and enforce .sisyphus/*.md write restrictions.
When transitioning from Prometheus (Planner) to Sisyphus via /start-work,
the session agent was not being cleared. This caused prometheus-md-only
hook to continue injecting READ-ONLY constraints into sisyphus_task calls.
- Add clearSessionAgent() call when start-work command is detected
- Add TDD test verifying clearSessionAgent is called with sessionID
- Add shared/system-directive.ts with SYSTEM_DIRECTIVE_PREFIX constant
- Unify all system message prefixes to [SYSTEM DIRECTIVE: OH-MY-OPENCODE - ...]
- Add isSystemDirective() filter to keyword-detector to skip system messages
- Update prometheus-md-only tests to use new prefix constants
- Delete src/hooks/preemptive-compaction/ entirely
- Remove dcp_for_compaction from schema and executor
- Clean up related imports, options, and test code
- Update READMEs to remove experimental options docs
The tools restriction was defined in sisyphus.ts but not enforced in
config-handler.ts like other agents (orchestrator-sisyphus, Prometheus).
Added explicit tools setting to guarantee call_omo_agent is disabled.
Remove OpenCode built-in tools (lsp_goto_definition, lsp_find_references, lsp_symbols, lsp_servers) that are not provided by oh-my-opencode. Keep only lsp_diagnostics, lsp_prepare_rename, lsp_rename.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
lsp_goto_definition, lsp_find_references, lsp_symbols are provided by OpenCode, not oh-my-opencode. Keep only the 4 tools we actually provide: lsp_diagnostics, lsp_servers, lsp_prepare_rename, lsp_rename.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The watermark (commit footer and co-author) was inconsistently applied because:
1. The skill tool didn't receive gitMasterConfig
2. The approach was 'default ON, inject DISABLED override' which LLMs sometimes ignored
This refactors to 'inject only when enabled' approach:
- Remove hardcoded watermark section from base templates
- Dynamically inject section 5.5 based on config values
- Default is still ON (both true when no config)
- When both disabled, no injection occurs (clean prompt)
Also fixes missing config propagation to skill tool and createBuiltinAgents.
feat(concurrency): prevent background task races and leaks
Summary
Fixes race conditions and memory leaks in the background task system that could cause "all tasks complete" notifications to never fire, leaving parent sessions waiting indefinitely.
Why This Change?
When background tasks are tracked for completion notifications, the system maintains a pendingByParent map to know when all tasks for a parent session are done. Several edge cases caused "stale entries" to accumulate in this map:
1. Re-registering completed tasks added them back to pending tracking, but they'd never complete again
2. Changing a task's parent session left orphan entries in the old parent's tracking set
3. Concurrent task operations could cause double-acquisition of concurrency slots
These bugs meant the system would sometimes wait forever for tasks that were already done.
What Changed
- Concurrency management: Added proper acquire/release lifecycle with cleanup on process exit (SIGINT, SIGTERM)
- Parent session tracking: Fixed cleanup order. Now clears old parent's tracking before updating parent ID
- Stale entry prevention: Only tracks tasks that are actually running; actively cleans up completed tasks
- Renamed registerExternalTask → trackTask: Clearer name (the old name implied external API consumers, but it's internal)
Update BackgroundManager to rename the method for tracking external tasks, improving clarity and consistency in task management. Adjust related tests to reflect the new method name.
Previously, continuation hooks (todo-continuation, boulder-continuation, ralph-loop)
and background tasks resolved model info from filesystem cache, which could be stale
or missing. This caused session.prompt to fallback to default model (Sonnet) instead
of using the originally configured model (e.g., Opus).
Now all session.prompt calls first try API (session.messages) to get current model
info, with filesystem as fallback if API fails.
Affected files:
- todo-continuation-enforcer.ts
- sisyphus-orchestrator/index.ts
- ralph-loop/index.ts
- background-agent/manager.ts
- sisyphus-task/tools.ts
- hook-message-injector/index.ts (export ToolPermission type)
- Delete PSModulePath in beforeEach() to prevent CI cross-platform detection
- Set SHELL=/bin/bash to ensure tests start with clean Unix-like environment
- Fixes flaky test failures on GitHub Actions CI runners
- Tests can still override these values for PowerShell-specific behavior
Add formatDetailedError helper that includes:
- Full args dump (description, category, agent, skills)
- Session ID and agent info
- Stack trace (first 10 lines)
Applied to all catch blocks for better debugging.
When user types '/start-work my-plan ultrawork', the hook now:
1. Extracts plan name from <user-request> section
2. Strips ultrawork/ulw keywords from the plan name
3. Searches for matching plan (exact then partial match)
4. Uses the matched plan instead of resuming stale boulder state
This fixes the bug where '/start-work [PLAN] ultrawork' would:
- Include 'ultrawork' as part of the plan name argument
- Ignore the explicit plan and resume an old stale plan from boulder.json
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Enhance the BackgroundManager to properly clean up pending tasks when the parent session ID changes. This prevents stale entries in the pending notifications and ensures that the cleanup process is only executed when necessary, improving overall task management reliability.
Restore zero-tolerance policy for visual/styling changes in frontend files.
Visual keyword detection now triggers mandatory delegation to frontend-ui-ux-engineer.
Update BackgroundManager to track batched notifications only for running tasks. Implement cleanup for completed or cancelled tasks to avoid stale entries in pending notifications. Enhance logging to include task status for better debugging.
Add functionality to manage process cleanup by registering and unregistering signal listeners. This ensures that BackgroundManager instances properly shut down and remove their listeners on process exit. Introduce tests to verify listener removal after shutdown.
- Update generated timestamp and commit hash metadata
- Normalize agent model names with provider prefixes (anthropic/, opencode/, google/)
- Remove deprecated Google OAuth/Antigravity references
- Update line counts and complexity hotspot entries
- Adjust test count from 82 to 80+ files and assertions from 2559+ to 2500+
🤖 Generated with assistance of oh-my-opencode
LLMs often call look_at with 'path' instead of 'file_path' parameter,
causing TypeError and infinite retry loops.
- Add normalizeArgs() to accept both 'path' and 'file_path'
- Add validateArgs() with clear error messages showing correct usage
- Add tests for normalization and validation
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ensure queue waiters settle once, centralize completion with status guards, and release slots before async work so shutdown and cancellations don’t leak concurrency. Internal hardening only.
Remove COMMENT_CHECKER_CLI_PATH constant that was blocking on module import.
Replace with getCommentCheckerPathSync() lazy function call.
- Defer file system sync calls (existsSync, require.resolve) to first use
- Add cli.test.ts with 4 BDD tests for lazy behavior verification
Rename to signal mutation behavior - the function advances the cursor
as a side effect, so 'consume' better reflects that calling it twice
with the same input yields different results.
Installer validation already requires --copilot, but the CLI
command did not expose the option, so non-TUI runs could not
supply the flag. Add the option and update help examples.
- Prioritize 'latest', 'beta', 'next' tags in getPluginNameWithVersion()
to ensure deterministic results when version matches multiple tags
- Add 5s timeout to fetchNpmDistTags() to prevent blocking on slow networks
- Remove unused 'join' import from node:path
- Merge upstream/dev and resolve conflicts in config-manager.test.ts
Add mocks for HTTP transport to avoid real network calls during tests.
This addresses reviewer feedback about test reliability:
- Tests are now faster (no network latency)
- Tests are deterministic across environments
- Test intent is clearer (unit testing error handling logic)
The mock throws immediately with a controlled error message,
allowing tests to validate error handling without network dependencies.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove hardcoded "anthropic/claude-sonnet-4-5" fallback
- Fetch systemDefaultModel from client.config.get() at tool boundary
- Add 'category-default' and 'system-default' fallback types
- Use switch(actualModel) for cleaner type detection
- Add guard clauses and fail-loud validation for invalid models
- Wrap config fetch in try/catch for graceful degradation
- Update toast messages with typed suffixMap
The previous detection checked if parentModelString exists, but the
resolution uses a ?? chain where default may win over parent. Now
compares actualModel against each source to correctly identify type.
Fixes: model toast incorrectly showing 'inherited' when default was used
- Change model priority: user override > parent model > category default
- Add ModelFallbackInfo to track model resolution type
- Show warning toast when category uses inherited or default model
- Add tests for model fallback info in task toast
- Add word boundary to ulw/ultrawork regex to prevent false matches on substrings like 'StatefulWidget' (fixes#779)
- Handle object type in parseArguments to prevent [object Object] JSON parse error (fixes#747)
- Add test cases for word boundary behavior
- frontend-ui-ux-engineer, document-writer, multimodal-looker, explore
now use Copilot models when no native providers available
- Category overrides (visual-engineering, artistry, writing) also use
Copilot models as fallback
- Priority: native providers (Gemini/Claude) > Copilot > free models
- Login guide moved to bottom with GitHub Copilot auth option added
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
- Combine and simplify Q&A about Claude subscription usage
- Remove separate OAuth implementation question
- Clarify: technically possible but not recommended
Instead of using stale parentModel/parentAgent from task state, now
dynamically looks up the current message to get fresh model/agent values.
Applied across all prompt injection points:
- background-agent notifyParentSession
- ralph-loop continuation
- sisyphus-orchestrator boulder continuation
- sisyphus-task resume
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
- Add prominent notice about Anthropic's third-party OAuth restriction
- Include disclaimer about oauth spoofing tools in community
- Clarify project has no custom oauth implementations
- Update version reference to 3.0.0-beta.6
- Add GitHub Copilot section to table of contents
- Add pendingByParent cleanup to ALL completion paths (session.idle, polling, stability)
- Add null guard for task.parentSessionID before Map access
- Add consistency guard in prune function (set concurrencyKey = undefined)
- Remove redundant setTimeout release (already released at completion)
- Reset startedAt on resume to prevent immediate false completion
- Release concurrency immediately on completion with double-release guard
- Clean up pendingByParent on session.deleted to prevent stale entries
Previously, background task completion notifications passed parentModel when defined, causing OpenCode to use default Sonnet model when parentModel was undefined. Now model field is always omitted, letting OpenCode use the session's existing lastModel (like todo-continuation hook).
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
OpenCode now natively supports OpenAI authentication, so we no longer
need to:
- Add opencode-openai-codex-auth plugin
- Configure CODEX_PROVIDER_CONFIG provider settings
The --chatgpt flag still controls Oracle agent model selection
(GPT-5.2 vs fallback).
Prometheus (Planner) agent should not have access to call_omo_agent tool
to prevent direct agent spawning. Uses the same pattern as orchestrator-sisyphus.
Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
Fixes model switching bug where sisyphus_task with category would
change the main session's model after completion.
- Add parentModel to session.prompt body in notifyParentSession
- Add test verifying model is included when parentModel is defined
Add GitHub Copilot as a fallback provider option in the installer. Native providers (Claude/ChatGPT/Gemini) have priority over Copilot.
- Add hasCopilot field to InstallConfig and DetectedConfig types
- Add --copilot flag support for both TUI and non-TUI modes
- Add Copilot prompt in interactive installer (after Gemini)
- Update model selection logic to use Copilot fallback when native providers unavailable
- Update configuration summary to display Copilot status
Addresses #762
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add event-based abort detection as primary method
- Keep API-based detection as fallback
- Track abort events via session.error with 3s time window
- Clear abort flag on user/assistant activity and tool execution
- Add comprehensive tests for hybrid approach (8 new test cases)
- All 663 tests pass
Fixes#577
When merging user and project configs, categories were simply
spread instead of deep merged. This caused user-level category
model settings to be completely overwritten by project-level
configs, even when the project config only specified partial
overrides like temperature.
Add deepMerge for categories field and comprehensive tests.
Allow Sisyphus-Junior (category-based tasks) to spawn explore/librarian
agents via call_omo_agent for research capabilities.
Changes:
- Remove call_omo_agent from BLOCKED_TOOLS in sisyphus-junior.ts
- Update prompt to show ALLOWED status for call_omo_agent
- Remove global call_omo_agent blocking in config-handler.ts
- Keep blocking for orchestrator-sisyphus (use sisyphus_task instead)
- Keep runtime recursion prevention in index.ts for explore/librarian
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Enable call_omo_agent tool for skill execution in BackgroundManager
- Enable call_omo_agent tool for agent execution in BackgroundManager
- Enable call_omo_agent tool for sisyphus_task resume operations
- Enable call_omo_agent tool for sisyphus_task category-based delegation
- Restrict recursive task and sisyphus_task calls to prevent loops
- Allows background agents to delegate to other agents cleanly
🤖 Generated with OhMyOpenCode assistance
Use version-aware permission system instead of hardcoded tools object.
This ensures call_omo_agent is properly denied on both old (tools) and
new (permission) OpenCode versions.
Allow Sisyphus and orchestrator-sisyphus agents to use OpenCode's
question tool for interactive user prompts. OpenCode defaults
question permission to "deny" for all agents except build/plan.
Background tasks were defaulting to $HOME instead of the parent session's
working directory. This caused background agents to scan the entire home
directory instead of the project directory, leading to:
- High CPU/memory load from scanning unrelated files
- Permission errors on system directories
- Task failures and timeouts
The fix retrieves the parent session's directory before creating a new
background session and passes it via the query.directory parameter.
Files modified:
- manager.ts: Look up parent session directory in launch()
- call-omo-agent/tools.ts: Same fix for sync mode
- look-at/tools.ts: Same fix for look_at tool
- sisyphus-task/tools.ts: Same fix + interface update for directory prop
- index.ts: Pass directory to sisyphusTask factory
Allow optional model variant config for agents and categories.
Propagate category variants into task model payloads so
category-driven runs inherit provider-specific variants.
Closes: #647
The implementation preserves original subagent responses for debugging failed tasks.
Updated test assertion from .not.toContain() to .toContain() to match this behavior.
- Add follow?: boolean option to GlobOptions interface
- Change buildRgArgs to use !== false pattern for hidden and follow flags
- Change buildFindArgs to use === false pattern, add -L for symlinks
- Change buildPowerShellCommand to use !== false pattern for hidden
- Remove -FollowSymlink from PowerShell (unsupported in PS 5.1)
- Export build functions for testing
- Add comprehensive BDD-style tests (18 tests, 21 assertions)
Note: Symlink following via -FollowSymlink is not supported in Windows
PowerShell 5.1. OpenCode auto-downloads ripgrep which handles symlinks
via --follow flag. PowerShell fallback is a safety net that rarely triggers.
Fixes#631
* fix(config): allow Sisyphus-Junior agent customization via oh-my-opencode.json
Allow users to configure Sisyphus-Junior agent via agents["Sisyphus-Junior"]
in oh-my-opencode.json, removing hardcoded defaults while preserving safety
constraints.
Closes#623
Changes:
- Add "Sisyphus-Junior" to AgentOverridesSchema and OverridableAgentNameSchema
- Create createSisyphusJuniorAgentWithOverrides() helper with guardrails
- Update config-handler to use override helper instead of hardcoded values
- Fix README category wording (runtime presets, not separate agents)
Honored override fields:
- model, temperature, top_p, tools, permission, description, color, prompt_append
Safety guardrails enforced post-merge:
- mode forced to "subagent" (cannot change)
- prompt is append-only (base discipline text preserved)
- blocked tools (task, sisyphus_task, call_omo_agent) always denied
- disable: true ignores override block, uses defaults
Category interaction:
- sisyphus_task(category=...) runs use the base Sisyphus-Junior agent config
- Category model/temperature overrides take precedence at request time
- To change model for a category, set categories.<cat>.model (not agent override)
- Categories are runtime presets applied to Sisyphus-Junior, not separate agents
Tests: 15 new tests in sisyphus-junior.test.ts, 3 new schema tests
Co-Authored-By: Sisyphus <sisyphus@mengmota.com>
* test(sisyphus-junior): add guard assertion for prompt anchor text
Add validation that baseEndIndex is not -1 before using it for ordering
assertion. Previously, if "Dense > verbose." text changed in the base
prompt, indexOf would return -1 and any positive appendIndex would pass.
Co-Authored-By: Sisyphus <sisyphus@mengmota.com>
---------
Co-authored-by: Sisyphus <sisyphus@mengmota.com>
- Add serializeError utility to handle Error instances, plain objects, and nested message paths
- Fix handleSessionError to use serializeError instead of naive String() conversion
- Fix runner.ts catch block to use serializeError for detailed error messages
- Add session.error case to logEventVerbose for better error visibility
- Add comprehensive tests for serializeError function
Fixes error logging in sisyphus-agent workflow where errors were displayed as '[object Object]'
* fix(config): resolve category to model for Prometheus (Planner) agent
When Prometheus (Planner) was configured with only a category (e.g.,
"ultrabrain") and no explicit model, the category was ignored and the
agent fell back to the hardcoded default "anthropic/claude-opus-4-5".
Add resolveModelFromCategoryWithUserOverride() helper that checks user
categories first, then DEFAULT_CATEGORIES, to resolve category names
to their corresponding models. Apply this resolution when building
the Prometheus agent configuration.
Co-Authored-By: Sisyphus <sisyphus@mengmota.com>
* fix(test): use actual implementation instead of local duplicate
Co-Authored-By: Sisyphus <sisyphus@mengmota.com>
* fix(config): apply all category properties, not just model for Prometheus (Planner)
The resolveModelFromCategoryWithUserOverride() helper only extracted
the model field from CategoryConfig, ignoring critical properties like
temperature, top_p, tools, maxTokens, thinking, reasoningEffort, and
textVerbosity. This caused categories like "ultrabrain" (temperature:
0.1) to run with incorrect default temperatures.
Refactor resolveModelFromCategoryWithUserOverride() to
resolveCategoryConfig() that returns the full CategoryConfig. Update
Prometheus (Planner) configuration to apply all category properties
(temperature, top_p, tools, etc.) when a category is specified, matching
the pattern established in Sisyphus-Junior. Explicit overrides still
take precedence during merge.
Co-Authored-By: Sisyphus <sisyphus@mengmota.com>
---------
Co-authored-by: Sisyphus <sisyphus@mengmota.com>
Update CLI commands to use channel-aware version fetching:
- doctor check now reports channel in error messages
- get-local-version uses channel from pinned version
Depends on channel detection from previous commit.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add support for npm dist-tag channels (@beta, @next, @canary) in auto-update mechanism. Users pinned to oh-my-opencode@beta now correctly fetch and compare against beta channel instead of stable latest.
- Add extractChannel() to detect channel from version string
- Modify getLatestVersion() to accept channel parameter
- Update auto-update flow to use channel-aware fetching
- Add comprehensive tests for channel detection and fetching
- Resolves#687
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Use regex /\.sisyphus[/\\]/i instead of checking first path segment. This fixes Windows paths where ctx.directory is parent of the actual project (e.g., project\.sisyphus\drafts\...).
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Addresses cubic review feedback: installer now replaces existing
oh-my-opencode entries with the new version-aware entry, allowing
users to switch between @latest, @beta, or pinned versions.
Previously, the installer always wrote 'oh-my-opencode' without a version,
causing users who installed beta versions (e.g., bunx oh-my-opencode@beta)
to unexpectedly load the stable version on next OpenCode startup.
Now the installer queries npm dist-tags and writes:
- @latest when current version matches the latest tag
- @beta when current version matches the beta tag
- @<version> when no tag matches (pins to specific version)
This ensures:
- bunx oh-my-opencode install → @latest (tracks stable)
- bunx oh-my-opencode@beta install → @beta (tracks beta tag)
- bunx oh-my-opencode@3.0.0-beta.2 install → @3.0.0-beta.2 (pinned)
- Revert messages.transform-only approach (experimental hook unreliable)
- Inject context in chat.message after claudeCodeHooks runs
- Order: keywordDetector → claudeCodeHooks → contextInjector
- Works independently of claude-code-hooks being enabled/disabled
- Ultrawork content now reliably injected to model
- Remove contextInjector call from chat.message hook chain
- Context injection now only happens in messages.transform hook
- This ensures UI displays original user message while model receives prepended context
- Fixes bug where commit message promised clone behavior but implementation mutated directly
Replace brittle string checks with robust path.resolve/relative validation:
- Fix Windows backslash paths (.sisyphus\plans\x.md) being incorrectly blocked
- Fix case-sensitive extension check (.MD now accepted)
- Add workspace confinement (block paths outside root even if containing .sisyphus)
- Block nested .sisyphus directories (only first segment allowed)
- Block path traversal attempts (.sisyphus/../secrets.md)
- Use ALLOWED_EXTENSIONS and ALLOWED_PATH_PREFIX constants (case-insensitive)
The new isAllowedFile() uses Node's path module for cross-platform compatibility
instead of string includes/endsWith which failed on Windows separators.
- keyword-detector now registers keywords to ContextCollector
- context-injector consumes and injects via chat.message hook
- Removed keyword detection logic from claude-code-hooks
- Hook order: keyword-detector → context-injector → claude-code-hooks
- ultrawork now works even when claude-code-hooks is disabled
- Add env var check to getCliConfigDir() for config directory override
- Update detectExistingConfigDir() to include env var path in locations
- Add comprehensive tests (7 test cases)
- Document in README
Closes#627
* fix(lsp): cleanup orphaned LSP servers on session.deleted
When parallel background agent tasks complete, their LSP servers (for
repos cloned to /tmp/) remain running until a 5-minute idle timeout.
This causes memory accumulation with heavy parallel Sisyphus usage,
potentially leading to OOM crashes.
This change adds cleanupTempDirectoryClients() to LSPServerManager
(matching the pattern used by SkillMcpManager.disconnectSession())
and calls it on session.deleted events.
The cleanup targets idle LSP clients (refCount=0) for temporary
directories (/tmp/, /var/folders/) where agent tasks clone repos.
* chore: retrigger CI checks
The author name "Named by [YeonGyu Kim]" in the Sisyphus role section
causes LLMs to sometimes infer Korean language output, even when the
user's locale is en-US.
This happens because the model sees a Korean name in the system prompt
and may interpret it as a signal to respond in Korean.
Removing the author attribution from the runtime prompt fixes this issue.
The attribution is preserved in README, LICENSE, and package.json.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: background task completion detection and silent notifications
- Fix TS2742 by adding explicit ToolDefinition type annotations
- Add stability detection (3 consecutive stable polls after 10s minimum)
- Remove early continue when sessionStatus is undefined
- Add silent notification system via tool.execute.after hook injection
- Change task retention from 200ms to 5 minutes for background_output retrieval
- Fix formatTaskResult to sort messages by time descending
Fixes hanging background tasks that never complete due to missing sessionStatus.
* fix: improve background task completion detection and message extraction
- Add stability-based completion detection (10s min + 3 stable polls)
- Fix message extraction to recognize 'reasoning' parts from thinking models
- Switch from promptAsync() to prompt() for proper agent initialization
- Remove model parameter from prompt body (use agent's configured model)
- Add fire-and-forget prompt pattern for sisyphus_task sync mode
- Add silent notification via tool.execute.after hook injection
- Fix indentation issues in manager.ts and index.ts
Incorporates fixes from:
- PR #592: Stability detection mechanism
- PR #610: Model parameter passing (partially)
- PR #628: Completion detection improvements
Known limitation: Thinking models (e.g. claude-*-thinking-*) cause
JSON Parse errors in child sessions. Use non-thinking models for
background agents until OpenCode core resolves this.
* fix: add tool_result handling and pendingByParent tracking for resume/external tasks
Addresses code review feedback from PR #638:
P1: Add tool_result type to validateSessionHasOutput() to prevent
false negatives for tool-only background tasks that would otherwise
timeout after 30 minutes despite having valid results.
P2: Add pendingByParent tracking to resume() and registerExternalTask()
to prevent premature 'ALL COMPLETE' notifications when mixing
launched and resumed tasks.
* fix: address code review feedback - log messages, model passthrough, sorting, race condition
- Fix misleading log messages: 'promptAsync' -> 'prompt (fire-and-forget)'
- Restore model passthrough in launch() for Sisyphus category configs
- Fix call-omo-agent sorting: use time.created number instead of String(time)
- Fix race condition: check promptError inside polling loop, not just after 100ms
OpenCode uses @agent-name syntax for agent invocation, not /command.
The /plan command does not exist - it should be @plan to invoke
the Prometheus planner agent.
- Add test for starting new loop while previous loop active (different session)
- Add test for restarting loop in same session
- Verifies startLoop properly overwrites state and resets iteration
When parentAgent is undefined, omit the agent field entirely from
session.prompt body instead of passing undefined. This prevents the
OpenCode SDK from falling back to defaultAgent(), which would change
the parent session's agent context.
Changes:
- manager.ts: Build prompt body conditionally, only include agent/model
when defined
- background-task/tools.ts: Use ctx.agent as primary source for
parentAgent (consistent with sisyphus-task)
- registerExternalTask: Add parentAgent parameter support
- Added tests for agent context preservation scenarios
When user has a prerelease version (e.g., 3.0.0-beta.1) installed
without pinning the version in config (just 'oh-my-opencode' without @version),
auto-update was incorrectly downgrading to the latest stable version.
Now checks if currentVersion is a prerelease before auto-updating,
preventing unintended downgrades regardless of pinning status.
Convert static agent exports to factory functions for consistency:
- Metis: add createMetisAgent(model) factory function
- Update agentSources to use createMetisAgent, createMomusAgent
This ensures model overrides work consistently across all agents.
Previously, orchestrator-sisyphus agent had hardcoded model and didn't
accept model parameter, making config overrides ineffective.
- Add model param to OrchestratorContext interface
- Use ctx?.model ?? DEFAULT_MODEL pattern (consistent with Sisyphus)
- Pass model override from config to createOrchestratorSisyphusAgent
* fix: prevent auto-update from downgrading prerelease/dist-tag versions
The auto-update checker was incorrectly updating pinned prerelease versions
(e.g., 3.0.0-beta.1) and dist-tags (e.g., @beta) to the stable latest version
from npm, effectively downgrading users who opted into beta.
Added isPrereleaseOrDistTag() check that skips auto-update when:
- Version contains '-' (prerelease like 3.0.0-beta.1)
- Version is a dist-tag (non-semver like beta, next, canary)
Fixes#613
* refactor: export version helpers and import in tests
Address review feedback: export isPrereleaseVersion, isDistTag, and
isPrereleaseOrDistTag from index.ts and import them in tests instead
of duplicating the logic.
Add missing agent names to Zod schema:
- BuiltinAgentNameSchema
- OverridableAgentNameSchema
- AgentOverridesSchema
This allows orchestrator-sisyphus and Momus (Plan Reviewer) to be
properly validated in oh-my-opencode.json config files.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* feat(background-agent): add ConcurrencyManager for model-based limits
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(background-agent): set default concurrency to 5
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(background-agent): support 0 as unlimited concurrency
Setting concurrency to 0 means unlimited (Infinity).
Works for defaultConcurrency, providerConcurrency, and modelConcurrency.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hooks): use auto flag for session resumption after compaction
- executor.ts: Added `auto: true` to summarize body, removed subsequent prompt_async call
- preemptive-compaction/index.ts: Added `auto: true` to summarize body, removed subsequent promptAsync call
- executor.test.ts: Updated test expectation to include `auto: true`
Instead of sending 'Continue' prompt after compaction, use SessionCompaction's `auto: true` feature which auto-resumes the session.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(agents): update sisyphus orchestrator
Update Sisyphus agent orchestrator with latest changes.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(features): update background agent manager
Update background agent manager with latest configuration changes.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(features): update init-deep template
Update initialization template with latest configuration.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(hooks): update hook constants and configuration
Update hook constants and configuration across agent-usage-reminder, keyword-detector, and claude-code-hooks.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(tools): remove background-task tool
Remove background-task tool module completely:
- src/tools/background-task/constants.ts
- src/tools/background-task/index.ts
- src/tools/background-task/tools.ts
- src/tools/background-task/types.ts
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(tools): update tool exports and main plugin entry
Update tool index exports and main plugin entry point after background-task tool removal.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(auth): update constants to match CLIProxyAPI (50min buffer, 2 endpoints)
- Changed ANTIGRAVITY_TOKEN_REFRESH_BUFFER_MS from 60,000ms (1min) to 3,000,000ms (50min)
- Removed autopush endpoint from ANTIGRAVITY_ENDPOINT_FALLBACKS (now 2 endpoints: daily → prod)
- Added comprehensive test suite with 6 tests covering all updated constants
- Updated comments to reflect CLIProxyAPI parity
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(auth): remove PKCE to match CLIProxyAPI
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* feat(auth): implement port 51121 with OS fallback
Add port fallback logic to OAuth callback server:
- Try port 51121 (ANTIGRAVITY_CALLBACK_PORT) first
- Fallback to OS-assigned port on EADDRINUSE
- Add redirectUri property to CallbackServerHandle
- Return actual bound port in handle.port
Add comprehensive port handling tests (5 new tests):
- Should prefer port 51121
- Should return actual bound port
- Should fallback when port occupied
- Should cleanup and release port on close
- Should provide redirect URI with actual port
All 16 tests passing (11 existing + 5 new).
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* test(auth): add token expiry tests for 50-min buffer
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* feat(agents): add Prometheus system prompt and planner methodology
Add prometheus-prompt.ts with comprehensive planner agent system prompt.
Update plan-prompt.ts with streamlined Prometheus workflow including:
- Context gathering via explore/librarian agents
- Metis integration for AI slop guardrails
- Structured plan output format
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(agents): add Metis plan consultant agent
Add Metis agent for pre-planning analysis that identifies:
- Hidden requirements and implicit constraints
- AI failure points and common mistakes
- Clarifying questions before planning begins
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(agents): add Momus plan reviewer agent
Add Momus agent for rigorous plan review against:
- Clarity and verifiability standards
- Completeness checks
- AI slop detection
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(agents): add Sisyphus-Junior focused executor agent
Add Sisyphus-Junior agent for focused task execution:
- Same discipline as Sisyphus, no delegation capability
- Used for category-based task spawning via sisyphus_task tool
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(agents): add orchestrator-sisyphus agent
Add orchestrator-sisyphus agent for complex workflow orchestration:
- Manages multi-agent workflows
- Coordinates between specialized agents
- Handles start-work command execution
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(skill-loader): add skill-content resolver for agent skills
Add resolveMultipleSkills() for resolving skill content to prepend to agent prompts.
Includes test coverage for resolution logic.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(agents): add category and skills support to buildAgent
Extend buildAgent() to support:
- category: inherit model/temperature from DEFAULT_CATEGORIES
- skills: prepend resolved skill content to agent prompt
Includes comprehensive test coverage for new functionality.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(agents): register new agents in index and types
- Export Metis, Momus, orchestrator-sisyphus in builtinAgents
- Add new agent names to BuiltinAgentName type
- Update AGENTS.md documentation with new agents
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(features): add boulder-state persistence
Add boulder-state feature for persisting workflow state:
- storage.ts: File I/O operations for state persistence
- types.ts: State interfaces
- Includes test coverage
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(skills): add frontend-ui-ux builtin skill
Add frontend-ui-ux skill for designer-turned-developer UI work:
- SKILL.md with comprehensive design principles
- skills.ts updated with skill template
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(tools): add sisyphus_task tool for category-based delegation
Add sisyphus_task tool supporting:
- Category-based task delegation (visual, business-logic, etc.)
- Direct agent targeting
- Background execution with resume capability
- DEFAULT_CATEGORIES configuration
Includes test coverage.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(background-agent): add resume capability and model field
- Add resume() method for continuing existing agent sessions
- Add model field to BackgroundTask and LaunchInput types
- Update launch() to pass model to session.prompt()
- Comprehensive test coverage for resume functionality
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hooks): add task-resume-info hook
Add hook for injecting task resume information into tool outputs.
Enables seamless continuation of background agent sessions.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hooks): add prometheus-md-only write restriction hook
Add hook that restricts Prometheus planner to writing only .md files
in the .sisyphus/ directory. Prevents planners from implementing.
Includes test coverage.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hooks): add start-work hook for Sisyphus workflow
Add hook for detecting /start-work command and triggering
orchestrator-sisyphus agent for plan execution.
Includes test coverage.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hooks): add sisyphus-orchestrator hook
Add hook for orchestrating Sisyphus agent workflows:
- Coordinates task execution between agents
- Manages workflow state persistence
- Handles agent handoffs
Includes comprehensive test coverage.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hooks): export new hooks in index
Export new hooks:
- createPrometheusMdOnlyHook
- createTaskResumeInfoHook
- createStartWorkHook
- createSisyphusOrchestratorHook
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(todo-enforcer): add skipAgents option and improve permission check
- Add skipAgents option to skip continuation for specified agents
- Default skip: Prometheus (Planner)
- Improve tool permission check to handle 'allow'/'deny' string values
- Add agent name detection from session messages
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(config): add categories, new agents and hooks to schema
Update Zod schema with:
- CategoryConfigSchema for task delegation categories
- CategoriesConfigSchema for user category overrides
- New agents: Metis (Plan Consultant)
- New hooks: prometheus-md-only, start-work, sisyphus-orchestrator
- New commands: start-work
- Agent category and skills fields
Includes schema test coverage.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(commands): add start-work command
Add /start-work command for executing Prometheus plans:
- start-work.ts: Command template for orchestrator-sisyphus
- commands.ts: Register command with agent binding
- types.ts: Add command name to type union
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(migration): add backup creation and category migration
- Create timestamped backup before migration writes
- Add migrateAgentConfigToCategory() for model→category migration
- Add shouldDeleteAgentConfig() for cleanup when matching defaults
- Add Prometheus and Metis to agent name map
- Comprehensive test coverage for new functionality
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(config-handler): add Sisyphus-Junior and orchestrator support
- Add Sisyphus-Junior agent creation
- Add orchestrator-sisyphus tool restrictions
- Rename Planner-Sisyphus to Prometheus (Planner)
- Use PROMETHEUS_SYSTEM_PROMPT and PROMETHEUS_PERMISSION
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(cli): add categories config for Antigravity auth
Add category model overrides for Gemini Antigravity authentication:
- visual: gemini-3-pro-high
- artistry: gemini-3-pro-high
- writing: gemini-3-pro-high
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(sisyphus): update to use sisyphus_task and add resume docs
- Update example code from background_task to sisyphus_task
- Add 'Resume Previous Agent' documentation section
- Remove model name from Oracle section heading
- Disable call_omo_agent tool for Sisyphus
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor: update tool references from background_task to sisyphus_task
Update all references across:
- agent-usage-reminder: Update AGENT_TOOLS and REMINDER_MESSAGE
- claude-code-hooks: Update comment
- call-omo-agent: Update constants and tool restrictions
- init-deep template: Update example code
- tools/index.ts: Export sisyphus_task, remove background_task
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hook-message-injector): add ToolPermission type support
Add ToolPermission type union: boolean | 'allow' | 'deny' | 'ask'
Update StoredMessage and related interfaces for new permission format.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(main): wire up new tools, hooks and agents
Wire up in main plugin entry:
- Import and create sisyphus_task tool
- Import and wire taskResumeInfo, startWork, sisyphusOrchestrator hooks
- Update tool restrictions from background_task to sisyphus_task
- Pass userCategories to createSisyphusTask
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* docs: update documentation for Prometheus and new features
Update documentation across all language versions:
- Rename Planner-Sisyphus to Prometheus (Planner)
- Add Metis (Plan Consultant) agent documentation
- Add Categories section with usage examples
- Add sisyphus_task tool documentation
- Update AGENTS.md with new structure and complexity hotspots
- Update src/tools/AGENTS.md with sisyphus_task category
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* build: regenerate schema.json with new types
Update JSON schema with:
- New agents: Prometheus (Planner), Metis (Plan Consultant)
- New hooks: prometheus-md-only, start-work, sisyphus-orchestrator
- New commands: start-work
- New skills: frontend-ui-ux
- CategoryConfigSchema for task delegation
- Agent category and skills fields
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* skill
* feat: add toast notifications for task execution
- Display toast when background task starts in BackgroundManager
- Display toast when sisyphus_task sync task starts
- Wire up prometheus-md-only hook initialization in main plugin
This provides user feedback in OpenCode TUI where task TUI is not visible.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hooks): add read-only warning injection for Prometheus task delegation
When Prometheus (Planner) spawns subagents via task tools (sisyphus_task, task, call_omo_agent), a system directive is injected into the prompt to ensure subagents understand they are in a planning consultation context and must NOT modify files.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(hooks): add mandatory hands-on verification enforcement for orchestrated tasks
- sisyphus-orchestrator: Add verification reminder with tool matrix (playwright/interactive_bash/curl)
- start-work: Inject detailed verification workflow with deliverable-specific guidance
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
* docs(agents): clarify oracle and metis agent descriptions emphasizing read-only consultation roles
- Oracle: high-IQ reasoning specialist for debugging and architecture (read-only)
- Metis: updated description to align with oracle's consultation-only model
- Updated AGENTS.md with clarified agent responsibilities
* docs(orchestrator): emphasize oracle as read-only consultation agent
- Updated orchestrator-sisyphus agent descriptions
- Updated sisyphus-prompt-builder to highlight oracle's read-only consultation role
- Clarified that oracle provides high-IQ reasoning without write operations
* docs(refactor,root): update oracle consultation model in feature templates and root docs
- Updated refactor command template to emphasize oracle's read-only role
- Updated root AGENTS.md with oracle agent description emphasizing high-IQ debugging and architecture consultation
- Clarified oracle as non-write agent for design and debugging support
* feat(features): add TaskToastManager for consolidated task notifications
- Create task-toast-manager feature with singleton pattern
- Show running task list (newest first) when new task starts
- Track queued tasks status from ConcurrencyManager
- Integrate with BackgroundManager and sisyphus-task tool
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
* feat(hooks): add resume session_id to verification reminders for orchestrator subagent work
When subagent work fails verification, show exact sisyphus_task(resume="...")
command with session_id for immediate retry. Consolidates verification workflow
across boulder and standalone modes.
* refactor(hooks): remove duplicate verification enforcement from start-work hook
Verification reminders are now centralized in sisyphus-orchestrator hook,
eliminating redundant code in start-work. The orchestrator hook handles all
verification messaging across both boulder and standalone modes.
* test(hooks): update prometheus-md-only test assertions and formatting
Updated test structure and assertions to match current output format.
Improved test clarity while maintaining complete coverage of markdown
validation and write restriction behavior.
* orchestrator
* feat(skills): add git-master skill for atomic commits and history management
- Add comprehensive git-master skill for commit, rebase, and history operations
- Implements atomic commit strategy with multi-file splitting rules
- Includes style detection, branch analysis, and history search capabilities
- Provides three modes: COMMIT, REBASE, HISTORY_SEARCH
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* docs(agents): add pre-delegation planning section to Sisyphus prompt
- Add SISYPHUS_PRE_DELEGATION_PLANNING section with mandatory declaration rules
- Implements 3-step decision tree: Identify → Select → Declare
- Forces explicit category/agent/skill declaration before every sisyphus_task call
- Includes mandatory 4-part format: Category/Agent, Reason, Skills, Expected Outcome
- Provides examples (CORRECT vs WRONG) and enforcement rules
- Follows prompt engineering best practices: Clear, CoT, Structured, Examples
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(tools): rename agent parameter to subagent_type in sisyphus_task
- Update parameter name from 'agent' to 'subagent_type' for consistency with call_omo_agent
- Update all references and error messages
- Remove deprecated 'agent' field from SisyphusTaskArgs interface
- Update git-master skill documentation to reflect parameter name change
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(agents): change orchestrator-sisyphus default model to claude-sonnet-4-5
- Update orchestrator-sisyphus model from opus-4-5 to sonnet-4-5 for better cost efficiency
- Keep Prometheus using opus-4-5 for planning tasks
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(config): make Prometheus model independent from plan agent config
- Prometheus no longer inherits model from plan agent configuration
- Fallback chain: session default model -> claude-opus-4-5
- Removes coupling between Prometheus and legacy plan agent settings
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(momus): allow system directives in input validation
System directives (XML tags like <system-reminder>) are automatically
injected and should be ignored during input validation. Only reject
when there's actual user text besides the file path.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(prometheus): enhance high accuracy mode with mandatory Momus loop
When user requests high accuracy:
- Momus review loop is now mandatory until 'OKAY'
- No excuses allowed - must fix ALL issues
- No maximum retry limit - keep looping until approved
- Added clear explanation of what 'OKAY' means
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(prometheus): enhance reference section with detailed guidance
References now include:
- Pattern references (existing code to follow)
- API/Type references (contracts to implement)
- Test references (testing patterns)
- Documentation references (specs and requirements)
- External references (libraries and frameworks)
- Explanation of WHY each reference matters
The executor has no interview context - references are their only guide.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(git-master): add configurable commit footer and co-author options
Add git_master config with commit_footer and include_co_authored_by flags.
Users can disable Sisyphus attribution in commits via oh-my-opencode.json.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* feat(hooks): add single-task directive and system-reminder tags to orchestrator
Inject SINGLE_TASK_DIRECTIVE when orchestrator calls sisyphus_task to enforce
atomic task delegation. Wrap verification reminders in <system-reminder> tags
for better LLM attention.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* refactor: use ContextCollector for hook injection and remove unused background tools
Split changes:
- Replace injectHookMessage with ContextCollector.register() pattern for improved hook content injection
- Remove unused background task tools infrastructure (createBackgroundOutput, createBackgroundCancel)
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
* chore(context-injector): add debug logging for context injection tracing
Add DEBUG log statements to trace context injection flow:
- Log message transform hook invocations
- Log sessionID extraction from message info
- Log hasPending checks for context collector
- Log hook content registration to contextCollector
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
* fix(context-injector): prepend to user message instead of separate synthetic message
- Change from creating separate synthetic user message to prepending context
directly to last user message's text part
- Separate synthetic messages were ignored by model (treated as previous turn)
- Prepending to clone ensures: UI shows original, model receives prepended content
- Update tests to reflect new behavior
* feat(prometheus): enforce mandatory todo registration on plan generation trigger
* fix(sisyphus-task): add proper error handling for sync mode and implement BackgroundManager.resume()
- Add try-catch for session.prompt() in sync mode with detailed error messages
- Sort assistant messages by time to get the most recent response
- Add 'No assistant response found' error handling
- Implement BackgroundManager.resume() method for task resumption
- Fix ConcurrencyManager type mismatch (model → concurrencyKey)
* docs(sisyphus-task): clarify resume usage with session_id and add when-to-use guidance
- Fix terminology: 'Task ID' → 'Session ID' in resume parameter docs
- Add clear 'WHEN TO USE resume' section with concrete scenarios
- Add example usage pattern in Sisyphus agent prompt
- Emphasize token savings and context preservation benefits
* fix(agents): block task/sisyphus_task/call_omo_agent from explore and librarian
Exploration agents should not spawn other agents - they are leaf nodes
in the agent hierarchy for codebase search only.
* refactor(oracle): change default model from GPT-5.2 to Claude Opus 4.5
* feat(oracle): change default model to claude-opus-4-5
* fix(sisyphus-orchestrator): check boulder session_ids before filtering sessions
Bug: continuation was not triggered even when boulder.json existed with
session_ids because the session filter ran BEFORE reading boulder state.
Fix: Read boulder state first, then include boulder sessions in the
allowed sessions for continuation.
* feat(task-toast): display skills and concurrency info in toast
- Add skills field to TrackedTask and LaunchInput types
- Show skills in task list message as [skill1, skill2]
- Add concurrency slot info [running/limit] in Running header
- Pass skills from sisyphus_task to toast manager (sync & background)
- Add unit tests for new toast features
* refactor(categories): rename high-iq to ultrabrain
* feat(sisyphus-task): add skillContent support to background agent launching
- Add optional skillContent field to LaunchInput type
- Implement buildSystemContent utility to combine skill and category prompts
- Update BackgroundManager to pass skillContent as system parameter
- Add comprehensive tests for skillContent optionality and buildSystemContent logic
🤖 Generated with assistance of oh-my-opencode
* Revert "refactor(tools): remove background-task tool"
This reverts commit 6dbc4c095badd400e024510554a42a0dc018ae42.
* refactor(sisyphus-task): rename background to run_in_background
* fix(oracle): use gpt-5.2 as default model
* test(sisyphus-task): add resume with background parameter tests
* feat(start-work): auto-select single incomplete plan and use system-reminder format
- Auto-select when only one incomplete plan exists among multiple
- Wrap multiple plans message in <system-reminder> tag
- Change prompt to 'ask user' style for agent guidance
- Add 'All Plans Complete' state handling
* feat(sisyphus-task): make skills parameter required
- Add validation for skills parameter (must be provided, use [] if empty)
- Update schema to remove .optional()
- Update type definition to make skills non-optional
- Fix existing tests to include skills parameter
* fix: prevent session model change when sending notifications
- background-agent: use only parentModel, remove prevMessage fallback
- todo-continuation: don't pass model to preserve session's lastModel
- Remove unused imports (findNearestMessageWithFields, fs, path)
Root cause: session.prompt with model param changes session's lastModel
* fix(sisyphus-orchestrator): register handler in event loop for boulder continuation
* fix(sisyphus_task): use promptAsync for sync mode to preserve main session
- session.prompt() changes the active session, causing UI model switch
- Switch to promptAsync + polling to avoid main session state change
- Matches background-agent pattern for consistency
* fix(sisyphus-orchestrator): only trigger boulder continuation for orchestrator-sisyphus agent
* feat(background-agent): add parentAgent tracking to preserve agent context in background tasks
- Add parentAgent field to BackgroundTask, LaunchInput, and ResumeInput interfaces
- Pass parentAgent through background task manager to preserve agent identity
- Update sisyphus-orchestrator to set orchestrator-sisyphus agent context
- Add session tracking for background agents to prevent context loss
- Propagate agent context in background-task and sisyphus-task tools
This ensures background/subagent spawned tasks maintain proper agent context for notifications and continuity.
🤖 Generated with assistance of oh-my-opencode
* fix(antigravity): sync plugin.ts with PKCE-removed oauth.ts API
Remove decodeState import and update OAuth flow to use simple state
string comparison for CSRF protection instead of PKCE verifier.
Update exchangeCode calls to match new signature (code, redirectUri,
clientId, clientSecret).
* fix(hook-message-injector): preserve agent info with two-pass message lookup
findNearestMessageWithFields now has a fallback pass that returns
messages with ANY useful field (agent OR model) instead of requiring
ALL fields. This prevents parentAgent from being lost when stored
messages don't have complete model info.
* fix(sisyphus-task): use SDK session.messages API for parent agent lookup
Background task notifications were showing 'build' agent instead of the
actual parent agent (e.g., 'Sisyphus'). The hook-injected message storage
only contains limited info; the actual agent name is in the SDK session.
Changes:
- Add getParentAgentFromSdk() to query SDK messages API
- Look up agent from SDK first, fallback to hook-injected messages
- Ensures background tasks correctly preserve parent agent context
* fix(sisyphus-task): use ctx.agent directly for parentAgent
The tool context already provides the agent name via ctx.agent.
The previous SDK session.messages lookup was completely wrong -
SDK messages don't store agent info per message.
Removes useless getParentAgentFromSdk function.
* feat(prometheus-md-only): allow .md files anywhere, only block code files
Prometheus (Planner) can now write .md files anywhere, not just .sisyphus/.
Still blocks non-.md files (code) to enforce read-only planning for code.
This allows planners to write commentary and analysis in markdown format.
* Revert "feat(prometheus-md-only): allow .md files anywhere, only block code files"
This reverts commit c600111597.
* fix(momus): accept bracket-style system directives in input validation
Momus was rejecting inputs with bracket-style directives like [analyze-mode]
and [SYSTEM DIRECTIVE...] because it only recognized XML-style tags.
Now accepts:
- XML tags: <system-reminder>, <context>, etc.
- Bracket blocks: [analyze-mode], [SYSTEM DIRECTIVE...], [SYSTEM REMINDER...], etc.
* fix(sisyphus-orchestrator): inject delegation warning before Write/Edit outside .sisyphus
- Add ORCHESTRATOR_DELEGATION_REQUIRED strong warning in tool.execute.before
- Fix tool.execute.after filePath detection using pendingFilePaths Map
- before stores filePath by callID, after retrieves and deletes it
- Fixes bug where output.metadata.filePath was undefined
* docs: add orchestration, category-skill, and CLI guides
* fix(cli): correct category names in Antigravity migration (visual → visual-engineering)
* fix(sisyphus-task): prevent infinite polling when session removed from status
* fix(tests): update outdated test expectations
- constants.test.ts: Update endpoint count (2→3) and token buffer (50min→60sec)
- token.test.ts: Update expiry tests to use 60-second buffer
- sisyphus-orchestrator: Add fallback to output.metadata.filePath when callID missing
---------
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* feat(auth): add multi-account types and storage layer
Add foundation for multi-account Google Antigravity auth:
- ModelFamily, AccountTier, RateLimitState types for rate limit tracking
- AccountMetadata, AccountStorage, ManagedAccount interfaces
- Cross-platform storage module with XDG_DATA_HOME/APPDATA support
- Comprehensive test coverage for storage operations
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(auth): implement AccountManager for multi-account rotation
Add AccountManager class with automatic account rotation:
- Per-family rate limit tracking (claude, gemini-flash, gemini-pro)
- Paid tier prioritization in rotation logic
- Round-robin account selection within tier pools
- Account add/remove operations with index management
- Storage persistence integration
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(auth): add CLI prompts for multi-account setup
Add @clack/prompts-based CLI utilities:
- promptAddAnotherAccount() for multi-account flow
- promptAccountTier() for free/paid tier selection
- Non-TTY environment handling (graceful skip)
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(auth): integrate multi-account OAuth flow into plugin
Enhance OAuth flow for multi-account support:
- Prompt for additional accounts after first OAuth (up to 10)
- Collect email and tier for each account
- Save accounts to storage via AccountManager
- Load AccountManager in loader() from stored accounts
- Toast notifications for account authentication success
- Backward compatible with single-account flow
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(auth): add rate limit rotation to fetch interceptor
Integrate AccountManager into fetch for automatic rotation:
- Model family detection from URL (claude/gemini-flash/gemini-pro)
- Rate limit detection (429 with retry-after > 5s, 5xx errors)
- Mark rate-limited accounts and rotate to next available
- Recursive retry with new account on rotation
- Lazy load accounts from storage on first request
- Debug logging for account switches
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(cli): add auth account management commands
Add CLI commands for managing Google Antigravity accounts:
- `auth list`: Show all accounts with email, tier, rate limit status
- `auth remove <index|email>`: Remove account by index or email
- Help text with usage examples
- Active account indicator and remaining rate limit display
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(auth): address review feedback - remove duplicate ManagedAccount and reuse fetch function
- Remove unused ManagedAccount interface from types.ts (duplicate of accounts.ts)
- Reuse fetchFn in rate limit retry instead of creating new fetch closure
Preserves cachedTokens, cachedProjectId, fetchInstanceId, accountsLoaded state
* fix(auth): address Cubic review feedback (8 issues)
P1 fixes:
- storage.ts: Use mode 0o600 for OAuth credentials file (security)
- fetch.ts: Return original 5xx status instead of synthesized 429
- accounts.ts: Adjust activeIndex/currentIndex in removeAccount
- plugin.ts: Fix multi-account migration to split on ||| not |
P2 fixes:
- cli.ts: Remove confusing cancel message when returning default
- auth.ts: Use strict parseInt check to prevent partial matches
- storage.test.ts: Use try/finally for env var cleanup
* refactor(test): import ManagedAccount from accounts.ts instead of duplicating
* fix(auth): address Oracle review findings (P1/P2)
P1 fixes:
- Clear cachedProjectId on account change to prevent stale project IDs
- Continue endpoint fallback for single-account users on rate limit
- Restore access/expires tokens from storage for non-active accounts
- Re-throw non-ENOENT filesystem errors (keep returning null for parse errors)
- Use atomic write (temp file + rename) for account storage
P2 fixes:
- Derive RateLimitState type from ModelFamily using mapped type
- Add MODEL_FAMILIES constant and use dynamic iteration in clearExpiredRateLimits
- Add missing else branch in storage.test.ts env cleanup
- Handle open() errors gracefully with user-friendly toast message
Tests updated to reflect correct behavior for token restoration.
* fix(auth): address Cubic review round 2 (5 issues)
P1: Return original 429/5xx response on last endpoint instead of generic 503
P2: Use unique temp filename (pid+timestamp) and cleanup on rename failure
P2: Clear cachedProjectId when first account introduced (lastAccountIndex null)
P3: Add console.error logging to open() catch block
* test(auth): add AccountManager removeAccount index tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* test(auth): add storage layer security and atomicity tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* fix(auth): address Cubic review round 3 (4 issues)
P1 Fixes:
- plugin.ts: Validate refresh_token before constructing first account
- plugin.ts: Validate additionalTokens.refresh_token before pushing accounts
- fetch.ts: Reset cachedTokens when switching accounts during rotation
P2 Fixes:
- fetch.ts: Improve model-family detection (parse model from body, fallback to URL)
* fix(auth): address Cubic review round 4 (3 issues)
P1 Fixes:
- plugin.ts: Close serverHandle before early return on missing refresh_token
- plugin.ts: Close additionalServerHandle before continue on missing refresh_token
P2 Fixes:
- fetch.ts: Remove overly broad 'pro' matching in getModelFamilyFromModelName
* fix(auth): address Cubic review round 5 (9 issues)
P1 Fixes:
- plugin.ts: Close additionalServerHandle after successful account auth
- fetch.ts: Cancel response body on 429/5xx to prevent connection leaks
P2 Fixes:
- plugin.ts: Close additionalServerHandle on OAuth error/missing code
- plugin.ts: Close additionalServerHandle on verifier mismatch
- auth.ts: Set activeIndex to -1 when all accounts removed
- storage.ts: Use shared getDataDir utility for consistent paths
- fetch.ts: Catch loadAccounts IO errors with graceful fallback
- storage.test.ts: Improve test assertions with proper error tracking
* feat(antigravity): add system prompt and thinking config constants
* feat(antigravity): add reasoning_effort and Gemini 3 thinkingLevel support
* feat(antigravity): inject system prompt into all requests
* feat(antigravity): integrate thinking config and system prompt in fetch layer
* feat(auth): auto-open browser for OAuth login on all platforms
* fix(auth): add alias2ModelName for Antigravity Claude models
Root cause: Antigravity API expects 'claude-sonnet-4-5-thinking' but we were
sending 'gemini-claude-sonnet-4-5-thinking'. Ported alias mapping from
CLIProxyAPI antigravity_executor.go:1328-1347.
Transforms:
- gemini-claude-sonnet-4-5-thinking → claude-sonnet-4-5-thinking
- gemini-claude-opus-4-5-thinking → claude-opus-4-5-thinking
- gemini-3-pro-preview → gemini-3-pro-high
- gemini-3-flash-preview → gemini-3-flash
* fix(auth): add requestType and toolConfig for Antigravity API
Missing required fields from CLIProxyAPI implementation:
- requestType: 'agent'
- request.toolConfig.functionCallingConfig.mode: 'VALIDATED'
- Delete request.safetySettings
Also strip 'antigravity-' prefix before alias transformation.
* fix(auth): remove broken alias2ModelName transformations for Gemini 3
CLIProxyAPI's alias mappings don't work with public Antigravity API:
- gemini-3-pro-preview → gemini-3-pro-high (404!)
- gemini-3-flash-preview → gemini-3-flash (404!)
Tested: -preview suffix names work, transformed names return 404.
Keep only gemini-claude-* prefix stripping for future Claude support.
* fix(auth): implement correct alias2ModelName transformations for Antigravity API
Implements explicit switch-based model name mappings for Antigravity API.
Updates SANDBOX endpoint constants to clarify quota/availability behavior.
Fixes test expectations to match new transformation logic.
🤖 Generated with assistance of OhMyOpenCode
---------
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* docs: update opencode-antigravity-auth version to 1.2.8
* docs: update opencode-antigravity-auth to 1.2.8 in localized READMEs
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
* fix: respect disabled_hooks for keyword-detector in claude-code-hooks
The keyword detection in claude-code-hooks was running regardless of
whether keyword-detector was in disabled_hooks. This caused analyze
and search modes to trigger even when explicitly disabled.
Pass keywordDetectorDisabled flag to createClaudeCodeHooksHook and
skip keyword detection when the hook is disabled.
Fixes#530
* refactor: restore keyword types in log output
Add types array back to keyword detection log for better observability
* revert: undo PR #543 changes (bun shell GC crash was misdiagnosed)
This reverts commit 4a38e70 (PR #543) and 2064568 (follow-up fix).
## Why This Revert
The original diagnosis was incorrect. PR #543 assumed Bun's
ShellInterpreter GC bug was causing Windows crashes, but further
investigation revealed the actual root cause:
**The crash occurs when oh-my-opencode's session-notification runs
alongside external notification plugins (e.g., @mohak34/opencode-notifier).**
Evidence:
- User removed opencode-notifier plugin → crashes stopped
- Release version (with original ctx.$ code) works fine when used alone
- No widespread crash reports from users without external notifiers
- Both plugins listen to session.idle and send concurrent notifications
The real issue is a conflict between two notification systems:
1. oh-my-opencode: ctx.$ → PowerShell → Windows.UI.Notifications
2. opencode-notifier: node-notifier → SnoreToast.exe
A proper fix will detect and handle this conflict gracefully.
Refs: #543, oven-sh/bun#23177, oven-sh/bun#24368
See: docs/CRASH_INVESTIGATION_TIMELINE.md (in follow-up commit)
* fix(session-notification): detect and avoid conflict with external notification plugins
When oh-my-opencode's session-notification runs alongside external
notification plugins like opencode-notifier, both listen to session.idle
and send concurrent notifications. This can cause crashes on Windows
due to resource contention between different notification mechanisms:
- oh-my-opencode: ctx.$ → PowerShell → Windows.UI.Notifications
- opencode-notifier: node-notifier → SnoreToast.exe
This commit adds:
1. External plugin detection (checks opencode.json for known notifiers)
2. Auto-disable of session-notification when conflict detected
3. Console warning explaining the situation
4. Config option 'notification.force_enable' to override
Known notification plugins detected:
- opencode-notifier
- @mohak34/opencode-notifier
- mohak34/opencode-notifier
This is the actual fix for the Windows crash issue previously
misdiagnosed as a Bun.spawn GC bug (PR #543).
Refs: #543
* docs: add crash investigation timeline explaining the real root cause
Documents the investigation journey from initial misdiagnosis (Bun GC bug)
to discovering the actual root cause (notification plugin conflict).
Key findings:
- PR #543 was based on incorrect assumption
- The real issue is concurrent notification plugins
- oh-my-opencode + opencode-notifier = crash on Windows
- Either plugin alone works fine
* fix: address review feedback - add PowerShell escaping and use existing JSONC parser
- Add back single-quote escaping for PowerShell soundPath to prevent command failures
- Replace custom stripJsonComments with existing parseJsoncSafe from jsonc-parser
- All 655 tests pass
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Previously, the install command would delete the entire 'agents' object
from the user's oh-my-opencode config before merging new install settings.
This caused all user customizations to be lost on reinstall.
Fixed by removing the 'delete existing.agents' line and relying on the
existing deepMerge function to properly merge configs, preserving user
customizations while updating only the fields specified by the installer.
Fixes#556
- Add Arthur Guiot quote to zh-cn and ja
- Add 苔硯:こけすずり quote with localized translations
- Remove quotes not present in English (z80.eth, RyanOnThePath, Sigrid)
The remote MCP endpoint https://mcp.exa.ai/mcp requires API key authentication
via x-api-key header. Without this, the connection times out waiting for auth.
This change:
- Reads EXA_API_KEY from environment variable
- Passes it as x-api-key header when available
- Updates RemoteMcpConfig type to support optional headers
Co-authored-by: Junho Yeo <i@junho.io>
Add documentation for the 'plugins' and 'plugins_override' options
in the claude_code configuration section. This allows users to:
- Disable all Claude Code marketplace plugins with 'plugins: false'
- Selectively disable specific plugins using 'plugins_override'
These options were missing from the documentation but are supported
by the codebase.
- Add assessment phase before searching to reduce unnecessary tool calls
- Change mandatory minimum parallel calls to suggested ranges
- Allow direct answers from training knowledge for well-known APIs
Previously, concurrency was released in finally block AFTER prompt completion.
This caused queued tasks to remain blocked while prompt hangs.
Now release happens BEFORE prompt, allowing next queued task to start immediately
when current task completes, regardless of prompt success/failure.
Also added early release on session creation error for proper cleanup.
The keyword-detector was using ctx.client.session.get() to check parentID for
determining subagent sessions, but this API didn't reliably return parentID.
This caused non-ultrawork keywords (search, analyze) to be injected in subagent
sessions when they should only work in main sessions.
Changed to use getMainSessionID() comparison, consistent with other hooks like
session-notification and todo-continuation-enforcer.
- Replace unreliable parentID API check with mainSessionID comparison
- Add comprehensive test coverage for session filtering behavior
- Remove unnecessary session.get API call
- Fix#542: slashcommand tool returns empty content for skills
- Add lazyContentLoader to CommandInfo type
- Load skill content in formatLoadedCommand when content is empty
- Filter non-ultrawork keywords in subagent sessions
The `forceZsh` option on Linux/macOS would use a hardcoded zshPath
without checking if zsh actually exists on the system. This caused
hook commands to fail silently with exit code 127 on systems without
zsh installed.
Changes:
- Always verify zsh exists via findZshPath() before using it
- Fall back to bash -lc if zsh not found (preserves login shell PATH)
- Fall through to spawn with shell:true if neither found
The bash fallback ensures user PATH from .profile/.bashrc is available,
which is important for hooks that depend on custom tool locations.
Tested with opencode v1.1.3 - PreToolUse hooks now execute correctly
on systems without zsh.
Co-authored-by: Anas Viber <ananas-viber@users.noreply.github.com>
Replace Bun shell template literals (ctx.$) with node:child_process.spawn
to work around Bun's ShellInterpreter garbage collection bug on Windows.
This bug causes segmentation faults in deinitFromFinalizer during heap
sweeping when shell operations are used repeatedly over time.
Bug references:
- oven-sh/bun#23177 (closed incomplete)
- oven-sh/bun#24368 (still open)
- Pending fix: oven-sh/bun#24093
The fix applies to all platforms for consistency and safety.
* refactor(agents): remove unused model references
Consistent cleanup of agent model references across all agent files.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(agents): use glm-4.7-free as default librarian model
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* make playwright skill to be called more
Claude Code uses whitelist-based tools format which is semantically
different from OpenCode's denylist-based permission system. Apply
migration only to plugin agents for compatibility.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
Ports the refactor command from ~/.config/opencode/command/refactor.md to the project as a builtin command.
The /refactor command provides deterministic, LSP/AST-aware refactoring with:
- Automatic intent analysis and codebase mapping
- Risk assessment with test coverage verification
- Detailed planning via Plan agent
- Step-by-step execution with continuous verification
- Zero-regression guarantees via comprehensive testing
Supports multiple refactoring scopes (file/module/project) and strategies (safe/aggressive).
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Extract createSlashcommandTool factory with SlashcommandToolOptions
- Export discoverCommandsSync for external use
- Move description building to lazy evaluation with caching
- Support pre-warming cache with provided commands and skills
- Simplify tool initialization in plugin with new factory approach
This allows the slashcommand tool to be instantiated with custom options
while maintaining backward compatibility through lazy loading.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
All Gemini model references now use the `antigravity-` prefix to ensure explicit
routing to Antigravity quota pools instead of relying on legacy `-preview` suffix
disambiguation. This approach prevents potential breakage if Google removes the
`-preview` suffix in future versions.
Updates include:
- config-manager: Updated Gemini model assignments with antigravity- prefix
- config-manager.test.ts: Updated test assertions to match new naming convention
- install.ts: Updated config summary display to show antigravity-prefixed model name
Migration follows opencode-antigravity-auth plugin v1.2.7+ guidance for explicit
quota routing configuration.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Added comprehensive VERIFICATION GUARANTEE section to ultrawork prompt to enforce proof-based task completion. Includes:
- Pre-implementation success criteria definition (Functional, Observable, Pass/Fail)
- Mandatory Test Plan template for non-trivial tasks
- Execution & Evidence requirements table (Build, Test, Manual Verify, Regression)
- TDD workflow with evidence requirements
- Verification anti-patterns and blocking violations
This enhancement ensures agents must provide PROOF that something works before claiming completion - eliminating vague "it should work now" claims without evidence.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Update to antigravity v1.2.7 model naming conventions
- Update Codex auth version from 4.2.0 to 4.3.0
- Remove hotfix documentation (resolved in v4.3.0)
- Document available models and variants
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Remove gemini-3-pro-medium and gemini-3-flash-lite (deprecated in antigravity v1.2.7)
- Remove CHATGPT_HOTFIX_REPO variable and setupChatGPTHotfix() function
- Update CODEX_PROVIDER_CONFIG to modern variants system
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Restore [CODE RED] maximum precision requirement
- Restore YOU MUST LEVERAGE ALL AVAILABLE AGENTS directive
- Restore TELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW
- Restore explicit parallel exploration/librarian spawn workflow
- Keep mandatory ULTRAWORK MODE ENABLED! message
- Simplify constants structure for better maintainability
This addresses the issue where explore/librarian agents were being called less frequently after recent prompt changes.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Wire agent information through keyword detector hooks:
- Pass input.agent to detectKeywordsWithType in keyword-detector hook
- Pass input.agent to detectKeywordsWithType in claude-code-hooks
- Enables agent-aware ultrawork message generation
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Restructure ultrawork message generation to support agent-specific instructions.
- Extract ultrawork message components into modular constants
- Add getUltraworkMessage(agentName) function that adapts instructions based on agent type
- Support planner-specific vs default agent execution patterns
- Pass agentName parameter through detector.ts for message resolution
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Remove all sync functions from command loader (async now default)
- Remove sync load functions from skill loader (async now default)
- Add resolveSymlinkAsync to file-utils.ts
- Update all callers to use async versions:
- config-handler.ts
- index.ts
- tools/slashcommand/tools.ts
- tools/skill/tools.ts
- hooks/auto-slash-command/executor.ts
- loader.test.ts
- All 607 tests pass, build succeeds
Generated with assistance of 🤖 [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add async versions of skill loader functions (loadUserSkillsAsync, loadProjectSkillsAsync, loadOpencodeGlobalSkillsAsync, loadOpencodeProjectSkillsAsync)
- Use Promise.all to load 8 loaders concurrently instead of sequentially
- Improves startup performance by eliminating serial I/O bottlenecks
Generated with assistance of OhMyOpenCode
- Change Planner-Sisyphus mode from "all" to "primary" for proper Tab selector visibility
- Fixes agent visibility breaking changes introduced in OpenCode 1.1.1
- 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
🤖 Generated with assistance of OhMyOpenCode
- Fix Planner-Sisyphus agent config: use `mode: 'all'` instead of `mode: 'primary'` to show in Tab selector
- Use model fallback to default config model when plan agent model not specified
- Demote original plan agent to `subagent` mode with `hidden: true` instead of `disable: true`
- Destructure `mode` from plan config to avoid passing it to migratedPlanConfig
- Add mode: primary to Planner-Sisyphus for Tab selector visibility
- Skip skills with invalid YAML frontmatter
- Add parseError/hadFrontmatter to FrontmatterResult
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Skip skills with invalid YAML frontmatter using new parseError flag
- Add mode: "primary" to Planner-Sisyphus agent config for visibility
- Prevents silent failures when loading skills with malformed YAML
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add hadFrontmatter and parseError flags to FrontmatterResult interface to enable error handling in skill loading.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix: implement proper version-aware permission format for OpenCode v1.1.1
- Rewrite permission-compat.ts with runtime version detection
- createAgentToolRestrictions() returns correct format per version
- v1.1.1+ uses permission format, older uses tools format
- Add migrateToolsToPermission/migratePermissionToTools helpers
- Update test suite for new API
🤖 Generated with assistance of OhMyOpenCode
https://github.com/code-yeongyu/oh-my-opencode
* fix: update all agents to use createAgentToolRestrictions()
- Replace hardcoded tools: { X: false } format with version-aware utility
- All agents now use createAgentToolRestrictions([...])
- Ensures compatibility with both old and new OpenCode versions
🤖 Generated with assistance of OhMyOpenCode
https://github.com/code-yeongyu/oh-my-opencode
* fix: add runtime migration for user agent configs in config-handler
Migrate tools/permission format in user/project/plugin agent configs
based on detected OpenCode version at load time.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Migrate tools/permission format in user/project/plugin agent configs
based on detected OpenCode version at load time.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Replace hardcoded tools: { X: false } format with version-aware utility
- All agents now use createAgentToolRestrictions([...])
- Ensures compatibility with both old and new OpenCode versions
🤖 Generated with assistance of OhMyOpenCode
https://github.com/code-yeongyu/oh-my-opencode
- Rewrite permission-compat.ts with runtime version detection
- createAgentToolRestrictions() returns correct format per version
- v1.1.1+ uses permission format, older uses tools format
- Add migrateToolsToPermission/migratePermissionToTools helpers
- Update test suite for new API
🤖 Generated with assistance of OhMyOpenCode
https://github.com/code-yeongyu/oh-my-opencode
Keyword detection is now handled by claude-code-hooks, not by context-injector
messages.transform hook. Remove tests for keyword injection that are no longer
applicable.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Move keyword detection from experimental.chat.messages.transform to claude-code-hooks
chat.message handler. Uses proven injectHookMessage file system approach for reliable
context injection.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Fixes race condition where chat.message runs after experimental.chat.messages.transform,
preventing keyword-detected context from being injected. Moves detection logic inline
into the transform hook for atomic detection and injection.
Changes:
- Add detectKeywordsWithType and extractPromptText utilities to injector
- Detect keywords inline within messages transform hook
- Create synthetic message with merged context before last user message
- Add 4 comprehensive test cases for keyword detection scenarios
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Implement `createContextInjectorMessagesTransformHook` for messages transform hook
- Refactor existing `chat.message` handler to be a no-op (context injection moved to transform)
- Add comprehensive test suite for the new hook (4 test cases)
- Update exports to expose new hook function
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Implement synchronous skill discovery using Node.js Worker Threads and Atomics.wait for blocking operations. Allows synchronous API access while leveraging async operations internally via dedicated worker thread.
Changes:
- blocking.ts: Main blocking discovery function using SharedArrayBuffer and MessagePort
- discover-worker.ts: Worker thread implementation for async skill discovery
- blocking.test.ts: Comprehensive test suite with BDD comments
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add LazyContentLoader interface to LoadedSkill type
- Defer skill body loading until first use
- Cache loaded content for subsequent calls
- Reduce startup time by not reading full file contents
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Replace synchronous skill discovery calls in src/index.ts with async versions
- Use Promise.all to parallelize 4 skill directory scans
- Wrap conditional calls in Promise.resolve for consistent Promise types
- Imports: discoverUserClaudeSkillsAsync, discoverProjectClaudeSkillsAsync, discoverOpencodeGlobalSkillsAsync, discoverOpencodeProjectSkillsAsync
- Verification: bun test passes (571 pass, 1 pre-existing failure), bun run typecheck passes
- Add async versions of skill discovery functions
- Create discoverAllSkillsAsync() with Promise.all parallelization
- Use fs.promises for async file operations
- Keep sync versions for backward compatibility
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add async loadCommandsFromDirAsync using fs.promises API
- Add 4 async load functions for user/project/global/project-opencode commands
- Add loadAllCommandsAsync with Promise.all parallelization
- Sync versions preserved for backward compatibility
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add MockMessage interface to match new message structure
- Update client mock to include messages() method
- Remove abort error detection tests that were unreliable
- Simplify error handling logic for better testability
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Add ContextCollector class for managing and merging context entries across sessions
- Add types and interfaces for context management (ContextEntry, ContextPriority, PendingContext)
- Create context-injector hook for injection coordination
- Refactor keyword-detector to use context-injector instead of hook-message-injector
- Update src/index.ts to initialize context-injector infrastructure
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
When running in pnpm projects, the .npmrc configuration propagates as
NPM_CONFIG_* environment variables to child processes. This can cause
MCP servers to fail due to registry/proxy conflicts or case sensitivity
issues between uppercase and lowercase variants.
This fix adds a createCleanMcpEnvironment function that filters out:
- NPM_CONFIG_* and npm_config_* (npm/pnpm config)
- YARN_* (yarn config)
- PNPM_* (pnpm config)
- NO_UPDATE_NOTIFIER
Fixes#456
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Add new language servers from OpenCode's server.ts:
- prisma: Prisma schema support (.prisma)
- ocaml-lsp: OCaml language support (.ml, .mli)
- texlab: LaTeX support (.tex, .bib)
- dockerfile: Dockerfile support (.dockerfile)
- gleam: Gleam language support (.gleam)
- clojure-lsp: Clojure support (.clj, .cljs, .cljc, .edn)
- nixd: Nix language support (.nix)
- tinymist: Typst support (.typ, .typc)
- haskell-language-server: Haskell support (.hs, .lhs)
Add new language extensions from OpenCode's language.ts:
- .ets -> typescript
- .lhs -> haskell
- .kt, .kts -> kotlin
- .nix -> nix
- .typ, .typc -> typst
- .prisma -> prisma
Update server IDs to match OpenCode convention:
- Add 'bash' as primary ID (keep bash-ls as legacy alias)
- Add 'terraform' as primary ID (keep terraform-ls as legacy alias)
Closes#454
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Update README.ko.md ToC with Korean step links
- Update README.ja.md ToC with Japanese step links
- Update README.zh-cn.md ToC with Chinese step links
These ToC links were present in README.md (English) but missing
from the translated versions, making navigation inconsistent.
Fixes#457
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
When using custom providers with model ID prefixes (e.g., vertex_ai/claude-sonnet-4-5),
the think mode switcher was stripping the prefix when mapping to high variants,
causing routing failures in custom LLM proxies.
Changes:
- Add extractModelPrefix() to parse and preserve prefixes like vertex_ai/, openai/, etc.
- Update getHighVariant() to preserve prefix when mapping to -high variants
- Update isAlreadyHighVariant() to check base model name (without prefix)
- Update getThinkingConfig() to check capability using base model name
- Add comprehensive tests for custom provider prefix scenarios
This fix ensures backward compatibility while supporting custom providers
that use prefixed model IDs for routing.
Fixes issue where think mode would break custom providers with prefixed models
by stripping the routing prefix during model variant switching.
* fix(skill-mcp-manager): prevent memory leaks from orphaned MCP processes
- Close transport on connection failure to prevent zombie processes
- Add process exit handlers (SIGINT/SIGTERM) for graceful cleanup
- Use pendingConnections Map to prevent duplicate client spawns
Fixes#361🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(ci): replace deprecated rhysd/actionlint-action with direct installation
rhysd/actionlint-action repository was removed/archived.
Use official actionlint download script instead.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(skill-mcp-manager): add transport.close() and idle timeout to fix memory leaks
Previously, disconnectSession() and disconnectAll() only called client.close() but NOT transport.close().
StdioClientTransport spawns child processes for MCP servers, and without transport.close(), these
processes remained orphaned and accumulated memory (6GB leak reported).
Changes:
- Added missing transport.close() calls in disconnectSession() and disconnectAll()
- Added idle timeout mechanism (5-minute timeout) with lastUsedAt tracking
- Added cleanup timer that runs every 60 seconds to remove idle clients
- Made signal handlers (SIGINT, SIGTERM, SIGBREAK) async to properly await cleanup
- Ensure proper cleanup order: clear from map first, then close client, then close transport
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(ci): pin actionlint download script to v1.7.10 for supply chain security
- Pin to specific release tag instead of 'main' branch
- Prevents potential supply chain attacks from upstream compromises
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Update Discord invite from discord.gg/aSfGzWtYxM to discord.gg/PUwSMR9XNk
- Synchronized across all language variants:
- README.md (English)
- README.ko.md (Korean)
- README.ja.md (Japanese)
- README.zh-cn.md (Simplified Chinese)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add Sigrid's Sisyphus quote to English README
- Add orchestrator coming banner to Korean, Japanese, and Chinese READMEs
- Synchronize content across all language versions
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Update preemptive-compaction hook to use 1M limit when env vars set
- Update dynamic-truncator to use 1M limit for output truncation
- Update context-window-monitor to use 1M limit for usage tracking
Previously hardcoded 200k limits caused compaction at 140k tokens even
with 1M context enabled. Now respects env vars consistently with base
opencode implementation.
Fixes compaction triggering too early with Claude Sonnet 4.5 1M context.
Related to anomalyco/opencode#6660
Previous `VAR=val cmd` format only applied to first command in chains.
New `export VAR=val; cmd` format ensures variables persist for all commands.
Also increased test timeouts for todo-continuation-enforcer stability.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(ralph-loop): clear orphaned state when original session no longer exists
When a session with an active ralph-loop terminates abnormally (abort, window close),
the state file remains with active: true. Previously, when a new session started,
the hook would skip the orphaned state without cleaning it up.
This fix adds session existence validation:
- Before skipping a loop owned by a different session, check if that session still exists
- If the original session no longer exists, clear the orphan state and log
- If the original session still exists, skip as before (it's another active session's loop)
Changes:
- Add checkSessionExists option to RalphLoopOptions for dependency injection
- Wire up sessionExists from session-manager as the default implementation
- Add tests for orphan state cleanup and active session preservation
* fix(ralph-loop): add error handling around checkSessionExists call
Wraps the async checkSessionExists call in try/catch for consistency
with other async operations in this file. If the check throws, logs
the error and falls back to the original behavior (not clearing state).
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
The installer now dynamically detects and uses the appropriate config
directory based on whether opencode CLI or opencode-desktop (Tauri) is
being used:
- opencode CLI: ~/.config/opencode/ (all platforms)
- opencode-desktop on Linux: ~/.config/ai.opencode.desktop/
- opencode-desktop on macOS: ~/Library/Application Support/ai.opencode.desktop/
- opencode-desktop on Windows: %APPDATA%/ai.opencode.desktop/
Key changes:
- Add new opencode-config-dir.ts module with platform-specific path resolution
- Support dev builds with ai.opencode.desktop.dev identifier
- Backward compatibility: checks legacy ~/.config/opencode/ first
- Refactor config-manager.ts to use dynamic paths via config context
- Update doctor plugin check to use shared path utilities
Fixes#440
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
The README files documented 'Builder-Sisyphus' as the agent name, but
the actual implementation uses 'OpenCode-Builder' as defined in:
- src/config/schema.ts (OverridableAgentNameSchema)
- src/plugin-handlers/config-handler.ts (agentConfig creation)
Updated all 4 README files (EN, KO, JA, ZH-CN) to use the correct agent
name that matches the codebase.
Fixes#436
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Extract issue/PR title in Collect Context step
- Add CONTEXT_TITLE environment variable for Sisyphus prompt
- Include TITLE_PLACEHOLDER in dynamic prompt injection
- Enhance 'Read Full Conversation' section with ultrawork-style strict guidance:
* [CODE RED] MANDATORY CONTEXT READING header with zero tolerance policy
* Explicit list of what to extract from conversation (original description, attempts, decisions, feedback, references)
* 'FAILURE TO READ EVERYTHING = GUARANTEED FAILURE' warning to emphasize importance
* Clearer TODO creation instructions with requirement to summarize context first
This ensures Sisyphus agent has complete contextual information and explicitly emphasizes the critical importance of full conversation reading before any action.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Restructure ultrawork mode message with clearer priorities
- Add TODO IS YOUR LIFELINE section emphasizing TodoWrite usage
- Enhance agent utilization principles and execution rules
- Improve clarity of zero tolerance failure policies
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Rename function to better reflect output format (bullet points, not table)
- Change output from markdown table to bullet point list
- Update sorting logic while maintaining agent priority
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Root cause: DEFAULT_TARGET_MAX_TOKENS (50k tokens ~200k chars) was too high
for webfetch outputs. Web pages can be large but most content doesn't exceed
this limit, so truncation rarely triggered.
Changes:
- Add WEBFETCH_MAX_TOKENS = 10k tokens (~40k chars) for web content
- Introduce TOOL_SPECIFIC_MAX_TOKENS map for per-tool limits
- webfetch/WebFetch now use aggressive 10k token limit
- Other tools continue using default 50k token limit
- Add comprehensive tests for truncation behavior
Fixes#195
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
PR #439 added ultrawork-mode content without proper YAML indentation.
In GitHub Actions run: | blocks, all lines must be indented at least
as much as the first content line. The unindented heredoc content
broke YAML parsing, causing 'workflow file issue' failures.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- New workflow that runs actionlint on GitHub workflow file changes
- Runs on push and pull_request events to .github/workflows/**
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Improves readability by placing the git command on its own line instead of concatenating it directly after environment variables. The VAR=value prefix now continues to the next line with proper shell escaping.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Re-implements the workflow enhancements that were reverted in #437.
Changes:
- Add ultrawork-mode section with agent utilization principles, execution rules,
TDD workflow, and zero-tolerance failure guidelines
- Add analyze-mode section for context gathering before execution
- Add CRITICAL: First Steps section requiring full conversation reading and
immediate todo creation
- Includes PR inline review comments and review bodies in context gathering
This restores the functionality from #430 to ensure the agent:
- Reads full issue/PR context before taking action
- Creates todos immediately after reading context
- Follows structured parallel execution patterns
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Move clearNotificationsForTask() to finally block to ensure cleanup even on success
- Add TASK_TTL_MS (30 min) constant for stale task detection
- Implement pruneStaleTasksAndNotifications() to remove expired tasks and notifications
- Add comprehensive tests for pruning functionality (fresh tasks, stale tasks, notifications)
- Prevents indefinite Map growth when tasks complete without errors
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
OpenCode's bash tool ignores args.env and uses hardcoded process.env in spawn().
Work around this by prepending GIT_EDITOR, EDITOR, VISUAL, and PAGER env vars
directly to the command string. Only applies to git commands to avoid bloating
non-git commands.
Added shellEscape() and buildEnvPrefix() helper functions to properly escape
env var values and construct the prefix string.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
The prompt_async method expects path parameter named 'id' (not 'sessionID').
This bug prevented the 'Continue' message from being sent after compaction,
causing the recovery process to fail silently due to silent error swallowing
in the empty catch block.
Fixes:
- Type definition: changed path: { sessionID: string } to path: { id: string }
- Implementation: changed path: { sessionID } to path: { id: sessionID } at 2 locations (lines 411, 509)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Detects Edit tool errors (oldString/newString mismatches)
- Injects system reminder forcing AI to read file, verify state, apologize
- Includes comprehensive test suite (8 tests)
- Integrates with hook system and configuration schema
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Allow UserPromptSubmit hooks to run on first message (used for title generation)
- For first message: prepend hook content directly to message parts
- For subsequent messages: use file system injection as before
- Preserves hook injection integrity while enabling title generation hooks
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Removed 'invalid_request_error' from TOKEN_LIMIT_KEYWORDS (too broad)
- Added THINKING_BLOCK_ERROR_PATTERNS to explicitly detect thinking block structure errors
- Added isThinkingBlockError() function to filter these out before token limit checks
- Prevents 'thinking block order' errors from triggering compaction instead of session-recovery
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
When injecting continuation prompts, extract and pass the model field
(providerID + modelID) from the nearest stored message, matching the
pattern used in background-agent/manager.ts and session-recovery.
Also updated tests to capture the model field for verification.
* fix(ralph-loop): detect completion promise from session messages API
The completion promise (e.g., <promise>DONE</promise>) was not being detected
because assistant text messages were never recorded to the transcript file.
Only user messages, tool uses, and tool results were recorded.
This fix adds a new detection method that fetches session messages via the
OpenCode API and checks assistant text messages for the completion promise.
The transcript file check is kept as a fallback.
Fixes#412
* refactor(ralph-loop): address review feedback
- Simplify response parsing to use response.data consistently (greptile)
- Add session ID tracking to messages mock for better test coverage (cubic)
- Add assertion to verify correct session ID is passed to API
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Always merge parent process.env when spawning MCP child processes
- Overlay config.env on top if present (for skill-specific overrides)
- Fixes issue where skills without explicit env: block started with zero environment variables
- Adds 2 tests for env inheritance behavior
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Previously, the hook only set NON_INTERACTIVE_ENV without inheriting the parent process environment, causing subprocess to run without proper PATH and other env vars. Now it properly inherits process.env first, then applies GIT_EDITOR=":" and EDITOR=":" to prevent interactive editors from spawning.
🤖 Generated with assistance of OhMyOpenCode
https://github.com/code-yeongyu/oh-my-opencode
Pass available agent metadata to createSisyphusAgent so the delegation table
and other dynamic prompt sections are populated instead of being empty.
Root cause: buildAgent() only passed `model` to createSisyphusAgent, but not
`availableAgents`. This caused the delegation table, tool selection table, and
other dynamic sections to be built with empty arrays.
Fix:
1. Import all agent metadata exports (*_PROMPT_METADATA)
2. Create agentMetadata map
3. Build non-Sisyphus agents first, collecting AvailableAgent[]
4. Pass availableAgents to createSisyphusAgent
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
* feat(commands): add handoffs support for speckit compatibility
- Upgrade frontmatter parser to use js-yaml for complex YAML support
- Add HandoffDefinition interface for speckit-style workflow transitions
- Update CommandFrontmatter and CommandDefinition to include handoffs
- Add comprehensive tests for backward compatibility and complex YAML
- Fix type parameters in auto-slash-command and slashcommand tools
Closes#407
* fix(frontmatter): use JSON_SCHEMA for security and add extra fields tolerance tests
- Use JSON_SCHEMA in yaml.load() to prevent code execution via YAML tags
- Add tests to verify extra fields in frontmatter don't cause failures
- Address Greptile security review comment
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
* fix: Windows auto-update path detection and add install function support
- Fix Windows path inconsistency: check ~/.config first, then %APPDATA%
- Add actual update installation via runBunInstall when autoUpdate=true
- Check both Windows config locations for comprehensive detection
Closes#402
* fix: address review feedback on error logging and message clarity
- Update misleading log message to clarify fallback behavior
- Serialize error object before logging to prevent {} serialization
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Replace the time-based ERROR_COOLDOWN_MS mechanism with an event-order based
lastEventWasAbortError flag. This fixes the bug where abort errors permanently
block todo continuation since session.idle only fires once during the cooldown.
Now abort errors only skip continuation when they occur IMMEDIATELY before
session.idle event. Any intervening event (message, tool execution) clears the
abort state, allowing normal continuation flow on the next idle.
Comprehensive tests added to verify:
- Abort detection correctly blocks continuation when immediately before idle
- Intervening events (assistant message, tool execution) clear abort state
- Non-abort errors don't block continuation
- Multiple abort events (only last one matters)
- No time-based throttle preventing consecutive injections
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Changed GIT_EDITOR, EDITOR, GIT_SEQUENCE_EDITOR from 'true' to ':' (shell no-op builtin)
- Changed VISUAL from 'true' to '' (empty string to prevent fallback issues)
- Added GIT_MERGE_AUTOEDIT: 'no' to prevent merge editor prompts
Fixes SIGTERM issues when git tries to open editors in non-interactive environments.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Reduce index.ts from 724 to 458 lines (37% reduction):
- Extract config loading to plugin-config.ts
- Extract ModelCacheState to plugin-state.ts
- Extract config handler to plugin-handlers/config-handler.ts
All 408 tests pass, TypeScript typecheck clean.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Fixes critical v2.10.0 compaction regression where truncation ALWAYS returned early
without checking if it was sufficient, causing PHASE 3 (Summarize) to be skipped.
This led to "history disappears" symptom where all context was lost after compaction.
Changes:
- Restored aggressiveResult.sufficient check before early return in executor
- Only return from Truncate phase if truncation successfully reduced tokens below limit
- Otherwise fall through to Summarize phase when truncation is insufficient
- Restored conservative charsPerToken=4 (was changed to 2, too aggressive)
- Added 2 regression tests:
* Test 1: Verify Summarize is called when truncation is insufficient
* Test 2: Verify Summarize is skipped when truncation is sufficient
Regression details:
- v2.10.0 changed charsPerToken from 4 to 2, making truncation too aggressive
- Early return removed sufficient check, skipping fallback to Summarize
- Users reported complete loss of conversation history after compaction
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Add getSystemMcpServerNames() sync function to detect system-configured MCP
servers from .mcp.json files (user, project, and local scopes). Builtin skills
like playwright are now automatically excluded when their MCP server is already
configured in system config, preventing duplicate MCP server registration.
Also adds comprehensive test suite with 5 BDD-style tests covering empty config,
project/local scopes, disabled servers, and merged configurations.
Changes:
- loader.ts: Add getSystemMcpServerNames() function + readFileSync import
- loader.test.ts: Add 5 tests for getSystemMcpServerNames() edge cases
- index.ts: Filter builtin skills to exclude those with overlapping MCP names
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Regenerated root AGENTS.md with overview, structure, and complexity hotspots
- Regenerated all 7 subdirectory AGENTS.md files: hooks, tools, features, agents, cli, auth, shared
- Used 11 background explore agents for comprehensive feature and architecture analysis
- All files within size limits (root: 112 lines, subdirs: 57-68 lines)
- Includes where-to-look guide, conventions, anti-patterns, and agent model information
🤖 Generated with assistance of oh-my-opencode
* feat(rules-injector): add GitHub Copilot instructions format support
- Add .github/instructions/ directory to rule discovery paths
- Add applyTo as alias for globs field in frontmatter parser
- Support .github/copilot-instructions.md single-file format (always-apply)
- Filter .github/instructions/ to only accept *.instructions.md files
- Add comprehensive tests for parser and finder
Closes#397
* fix(rules-injector): use cross-platform path separator in calculateDistance
path.relative() returns OS-native separators (backslashes on Windows),
but the code was splitting by forward slash only, causing incorrect
distance calculations on Windows.
Use regex /[/\]/ to handle both separator types.
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Added 'MCP LOADER (claude-code-mcp-loader)' section to src/features/AGENTS.md
- Documented .mcp.json file locations with priority order (user, project, local)
- Specified .mcp.json format with complete structure and examples
- Documented server types (stdio, http, sse) with required fields
- Added environment variable expansion syntax documentation
- Provided practical examples for stdio, http, and disabled servers
- Added transformation reference table for Claude Code → OpenCode format
- Improved discoverability for users setting up MCP servers via Claude Code configuration
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add "🪄 The Magic Word: ultrawork" section to all READMEs (EN, KO, JA, ZH-CN)
- Add Skill-Embedded MCP Support feature documentation
- Update installer to show ultrawork tip and star request after completion
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Closes#389
- Add npx as alternative when bunx doesn't work
- Add warning about Snap-installed Bun not working with bunx
- Update all localized READMEs (ko, ja, zh-cn) with same changes
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
The JSDoc comment incorrectly stated 'default: false' but since v2.9.0
preemptive compaction is enabled by default.
Fixes#398
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
The node:fs mock in skill/tools.test.ts was replacing the entire module,
causing fs functions to be undefined for tests running afterwards.
Fixed by preserving original fs functions and only intercepting skill paths.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Update timestamp to 2026-01-02T00:10:00+09:00 and commit hash b0c39e2
- Add 'Add skill' and 'Skill MCP' sections to WHERE TO LOOK table
- Add 'Self-planning for complex tasks' anti-pattern to ANTI-PATTERNS
- Update complexity hotspots with current accurate line counts (src/index.ts 723, src/cli/config-manager.ts 669, etc.)
- Add SKILL MCP MANAGER and BUILTIN SKILLS sections to src/features/AGENTS.md
- Document skill-mcp-manager lifecycle and builtin-skills location
- Update src/tools/AGENTS.md to include skill and skill-mcp tool categories
- Update testing note to reference 360+ tests passing
- Add Skill MCP note to NOTES section describing YAML frontmatter MCP config
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add playwright as builtin skill with MCP server configuration
- Add disabled_skills config option to disable specific builtin skills
- Update BuiltinSkill type to include mcpConfig field
- Update skill merger to handle mcpConfig from builtin to loaded skills
- Merge disabled_skills config and filter unavailable builtin skills at plugin init
- Update README with Built-in Skills documentation
- Regenerate JSON schema
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Add skill_mcp and webfetch to TRUNCATABLE_TOOLS list
- Add grep parameter for regex filtering of output lines
- Prevents token overflow from large MCP responses
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Previously only tool names were shown. Now each tool displays its full
inputSchema JSON so LLM can construct correct skill_mcp calls.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Added loadMcpJsonFromDir() to load MCP config from skill directory's mcp.json
- Supports AmpCode format (mcpServers wrapper) and direct format
- mcp.json takes priority over YAML frontmatter when both exist
- Added 3 tests covering mcpServers format, priority, and direct format
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(mcp): restrict grep_app tools to librarian agent only
Reduces token usage by disabling grep_app MCP tools globally and enabling them only for the librarian agent, which uses them for GitHub code search during documentation lookups.
Changes:
- Add grep_app_* tool disable globally in config.tools
- Add grep_app_* tool enable for librarian agent
- Remove grep_app references from explore agent prompt (no access)
Closes#394
* chore: changes by sisyphus-dev-ai
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Replace mock.module() with spyOn() in auto-slash-command test to prevent shared module mocking from leaking to other test files. Remove unused mock.module() from think-mode test. This ensures test isolation so ralph-loop tests pass in both isolation and full suite runs.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This hook intercepts user messages starting with '/' and REPLACES them with the actual command template output instead of injecting instructions. The implementation includes:
- Slash command detection (detector.ts) - identifies messages starting with '/'
- Command discovery and execution (executor.ts) - loads templates from ~/.claude/commands/ or similar
- Hook integration (index.ts) - registers with chat.message event to replace output.parts
- Comprehensive test coverage - 37 tests covering detection, replacement, error handling, and command exclusions
- Configuration support in HookNameSchema
Key features:
- Supports excluded commands to skip processing
- Loads command templates from user's command directory
- Replaces user input before reaching the LLM
- Tests all edge cases including missing files, malformed templates, and special commands
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Change charsPerToken from 4 to 2 for more aggressive truncation calculation
- Remove revert fallback (PHASE 2.5)
- Always try Continue after truncation if anything was truncated
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
When over token limit after truncation, use session.revert to remove last message instead of attempting summarize (which would also fail). Skip summarize entirely when still over limit to prevent infinite loop.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
When session hits token limit (e.g. 207k > 200k), the summarize API also fails
because it needs to process the full 207k tokens. By truncating FIRST, we reduce
token count before attempting summarize.
Changes:
- PHASE 1: DCP (Dynamic Context Pruning) - prune duplicate tool calls first
- PHASE 2: Aggressive Truncation - always try when over limit
- PHASE 3: Summarize - last resort after DCP and truncation
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(keyword-detector): show toast notification when ultrawork mode is activated
When users trigger ultrawork mode (via 'ultrawork' or 'ulw' keywords), a toast
notification now appears to confirm the mode is active. The notification is
shown once per session to avoid spamming.
Changes:
- Add detectKeywordsWithType() to identify which keyword type triggered
- Show 'Ultrawork Mode Activated' toast with success variant
- Track notified sessions to prevent duplicate toasts
Closes#392
* fix(keyword-detector): fix index bug in detectKeywordsWithType and add error logging
- Fix P1: detectKeywordsWithType now maps before filtering to preserve
original KEYWORD_DETECTORS indices. Previously, the index used was from
the filtered array, causing incorrect type assignment (e.g., 'search'
match would incorrectly return 'ultrawork' type).
- Fix P2: Replace silent .catch(() => {}) with proper error logging using
the log function for easier debugging when toast notifications fail.
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Support organizing commands in subdirectories with colon-separated naming
(e.g., myproject/deploy.md becomes myproject:deploy).
- Recursively traverse subdirectories and load all .md command files
- Prefix nested command names with directory path (colon-separated)
- Protect against circular symlinks via visited path tracking
- Skip hidden directories (consistent with other loaders)
- Graceful error handling with logging for debugging
Add doctor check for GitHub CLI (gh) that verifies:
- Binary installation status
- Authentication status with GitHub
- Account details and token scopes when authenticated
Closes#374
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Add LSP IN MAIN SESSION execution rule for parallel codemap building
- Restructure WORKFLOW step 2 as PARALLEL PHASE with two concurrent tracks:
- Background agents spawned via background_task for exploration/research
- Main session using LSP tools (lsp_document_symbols, lsp_workspace_symbols, lsp_goto_definition, lsp_find_references, lsp_hover) for codebase understanding
- Enables agent to build comprehensive codebase context while background agents explore in parallel
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Add SESSION_STORAGE constant for session metadata directory
- Add getMainSessions() function to retrieve main sessions with filtering:
- Sorts sessions by updated time (newest first)
- Filters out child sessions (with parentID)
- Filters sessions by directory path
- Update session_list tool to use new getMainSessions():
- Add project_path parameter (default: current working directory)
- Maintains existing date range filtering and limit behavior
🤖 Generated with assistance of OhMyOpenCode
Removes inline migration logic from index.ts and imports from shared/migration module.
This completes the refactoring to extract testable migration logic into a dedicated module.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Extract AGENT_NAME_MAP, HOOK_NAME_MAP, and migration functions to src/shared/migration.ts
- Add comprehensive BDD-style test suite in src/shared/migration.test.ts with 15 test cases
- Export migration functions from src/shared/index.ts
- Improves testability and maintainability of config migration logic
Tests cover:
- Agent name migrations (omo → Sisyphus, OmO-Plan → Planner-Sisyphus)
- Hook name migrations (anthropic-auto-compact → anthropic-context-window-limit-recovery)
- Config key migrations (omo_agent → sisyphus_agent)
- Case-insensitive lookups and edge cases
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Remove the FallbackState interface and related fallback recovery mechanism that deleted message pairs when all other compaction attempts failed. This simplifies the recovery strategy by eliminating the last-resort fallback approach.
Changes:
- Removed FallbackState interface and FALLBACK_CONFIG from types.ts
- Removed fallbackStateBySession from AutoCompactState
- Removed getOrCreateFallbackState and getLastMessagePair functions
- Removed emergency revert block that deleted user+assistant message pairs
- Updated clearSessionState and timeout reset logic
- Removed related test cases
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Slash commands with arguments were silently failing in OpenCode TUI because
command definitions included 'name' and 'argumentHint' fields that don't exist
in OpenCode's Command schema. Strip these fields before registration across
all command/skill loaders to ensure compatibility.
Affected loaders:
- builtin commands
- claude-code command loader
- opencode skill loader
- claude-code plugin loader
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Introduce a new dynamic prompt generation system for Sisyphus orchestrator
that leverages agent metadata for intelligent delegation. This revives the
dynamic-sisyphus-agent-prompt branch with comprehensive refactoring.
Changes:
- Add AgentPromptMetadata, AgentCategory, AgentCost, DelegationTrigger types
- Create sisyphus-prompt-builder with dynamic prompt generation logic
- Add AGENT_PROMPT_METADATA exports to all agent modules (oracle, librarian,
explore, frontend-ui-ux-engineer, document-writer, multimodal-looker)
- Refactor sisyphus.ts to use buildDynamicSisyphusPrompt()
- Add AvailableAgent type export for type safety
This enables Sisyphus to make intelligent agent selection decisions based on
agent capabilities, costs, and delegation triggers, improving orchestration
efficiency.
🤖 Generated with assistance of OhMyOpenCode
(https://github.com/code-yeongyu/oh-my-opencode)
- Step 1: Fire ALL background explore agents immediately (non-blocking)
- Step 2: Main session builds codemap understanding using LSP tools while background runs
- Step 3: Collect background results after main session analysis
This maximizes throughput by having agents discover patterns while the main session
analyzes code structure semantically via LSP.
OpenCode doesn't pass transcriptPath in the session.idle event properties,
which caused detectCompletionPromise to always return false (the first check
returns early if transcriptPath is undefined).
This fix:
- Imports getTranscriptPath from claude-code-hooks/transcript
- Generates the transcript path from sessionID instead of reading from event
- Adds optional getTranscriptPath callback to RalphLoopOptions for testability
Fixes#354
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Enable tool-output-truncator hook by default instead of requiring experimental config opt-in. Users can disable it via disabled_hooks if needed.
Changes:
- Add tool-output-truncator to HookNameSchema
- Remove tool_output_truncator from ExperimentalConfigSchema
- Update all README files (EN, KO, JA, ZH-CN)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Fix comment-checker/downloader.ts to use Windows-appropriate cache paths (%LOCALAPPDATA% or %APPDATA%) instead of Unix-style ~/.cache
- Guard against undefined import.meta.url in cli.ts which can occur during Windows plugin loading
- Reorder cache check before module resolution for safer fallback behavior
Fixes#347
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Add error classification helpers for permission, file-not-found, and filesystem errors
- Handle empty/corrupt config files gracefully with recovery suggestions
- Add 60-second timeout to runBunInstall() to prevent hanging forever
- Improve error messages with specific recovery suggestions for each error type
- Export BunInstallResult type with detailed error info (success, timedOut, error)
- Handle SyntaxError in JSON parsing with user-friendly suggestions
- Add validation for config file contents (empty, whitespace-only, non-object)
Fixes#338
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
The CLI build was missing --external @ast-grep/napi flag, causing the bundler
to inline absolute paths from the CI environment (/home/runner/work/...).
This made the doctor check for @ast-grep/napi always fail on user machines.
Fixes#344
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Add 'dcp-for-compaction' to HookNameSchema
- Remove dcp_for_compaction from ExperimentalConfigSchema
- Update executor.ts to use dcpForCompaction parameter
- Enable DCP by default (can be disabled via disabled_hooks)
- Update all 4 README files (EN, KO, JA, ZH-CN)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(think-mode): support GitHub Copilot proxy provider
### Summary
- Adds `github-copilot` support to think-mode by resolving the underlying provider from the model name (Claude → Anthropic, Gemini → Google, GPT/o* → OpenAI).
- Normalizes model IDs to handle dotted versions defensively (e.g. `claude-opus-4.5` → `claude-opus-4-5`, `gpt-5.2` → `gpt-5-2`) so high-variant upgrades and capability checks work reliably.
- Expands high-variant mappings to cover Gemini preview/flash variants and aligns GPT-5.1/5.2 mappings with normalized IDs.
- Adds OpenAI “thinking mode” config (`reasoning_effort: "high"`) alongside existing provider configs.
### Tests
- Adds unit coverage for the switcher (`switcher.test.ts`) and integration coverage for the hook (`index.test.ts`), including:
- GitHub Copilot model routing + thinking config injection
- Dots vs hyphens normalization
- Already-`-high` variants not being re-upgraded
- Unknown models/providers handled gracefully
* fix: support multiple digits in model minor
* feat(config): add RalphLoopConfigSchema and hook name
- Add ralph-loop to HookNameSchema enum
- Add RalphLoopConfigSchema with enabled, default_max_iterations, state_dir
- Add ralph_loop field to OhMyOpenCodeConfigSchema
- Export RalphLoopConfig type
* feat(ralph-loop): add hook directory structure with constants and types
- Add constants.ts with HOOK_NAME, DEFAULT_STATE_FILE, COMPLETION_TAG_PATTERN
- Add types.ts with RalphLoopState and RalphLoopOptions interfaces
- Export RalphLoopConfig from config/index.ts
* feat(ralph-loop): add storage module for markdown state file management
- Implement readState/writeState/clearState/incrementIteration
- Use YAML frontmatter format for state persistence
- Support custom state file paths via config
* feat(ralph-loop): implement main hook with session.idle handler
- Add createRalphLoopHook factory with event handler
- Implement startLoop, cancelLoop, getState API
- Detect completion promise in transcript
- Auto-continue with iteration tracking
- Handle max iterations limit
- Show toast notifications for status updates
- Support session recovery and cleanup
* test(ralph-loop): add comprehensive BDD-style tests
- Add 17 test cases covering storage, hook lifecycle, iteration
- Test completion detection, cancellation, recovery, session cleanup
- Fix storage.ts to handle YAML value parsing correctly
- Use BDD #given/#when/#then comments per project convention
* feat(builtin-commands): add ralph-loop and cancel-ralph commands
* feat(ralph-loop): register hook in main plugin
* docs: add Ralph Loop feature to all README files
* chore: regenerate JSON schema with ralph-loop config
* feat(ralph-loop): change state file path from .opencode to .sisyphus
🤖 Generated with assistance of https://github.com/code-yeongyu/oh-my-opencode
* feat(ralph-loop): integrate ralph-loop and cancel-ralph command handlers into plugin hooks
- Add chat.message hook to detect and start ralph-loop or cancel-ralph templates
- Add slashcommand hook to handle /ralph-loop and /cancel-ralph commands
- Support custom --max-iterations and --completion-promise options
🤖 Generated with assistance of https://github.com/code-yeongyu/oh-my-opencode
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
* feat(skill): add builtin skill types and schemas with priority-based merging support
- Add BuiltinSkill interface for programmatic skill definitions
- Create builtin-skills module with createBuiltinSkills factory function
- Add SkillScope expansion to include 'builtin' and 'config' scopes
- Create SkillsConfig and SkillDefinition Zod schemas for config validation
- Add merger.ts utility with mergeSkills function for priority-based skill merging
- Update skill and command types to support optional paths for builtin/config skills
- Priority order: builtin < config < user < opencode < project < opencode-project
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(skill): integrate programmatic skill discovery and merged skill support
- Add discovery functions for Claude and OpenCode skill directories
- Add discoverUserClaudeSkills, discoverProjectClaudeSkills functions
- Add discoverOpencodeGlobalSkills, discoverOpencodeProjectSkills functions
- Update createSkillTool to support pre-merged skills via options
- Add extractSkillBody utility to handle both file and programmatic skills
- Integrate mergeSkills in plugin initialization to apply priority-based merging
- Support optional path/resolvedPath for builtin and config-sourced skills
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* chore(slashcommand): support optional path for builtin and config command scopes
- Update CommandInfo type to make path and content optional properties
- Prepare command tool for builtin and config sourced commands
- Maintain backward compatibility with file-based command loading
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* docs(tools): improve tool descriptions for interactive-bash and slashcommand
- Added use case clarification to interactive-bash tool description (server processes, long-running tasks, background jobs, interactive CLI tools)
- Simplified slashcommand description to emphasize 'loading' skills concept and removed verbose documentation
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor(skill-loader): simplify redundant condition in skill merging logic
Remove redundant 'else if (loaded)' condition that was always true since we're already inside the 'if (loaded)' block. Simplify to 'else' for clarity.
Addresses code review feedback on PR #340 for the skill infrastructure feature.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Implements a comprehensive 'doctor' command that diagnoses oh-my-opencode
installation health with a beautiful TUI output.
Checks performed:
- OpenCode installation (version, path, binary)
- Plugin registration in opencode.json
- Configuration file validity (oh-my-opencode.json)
- Auth providers (Anthropic, OpenAI, Google)
- Dependencies (ast-grep CLI/NAPI, comment-checker)
- LSP servers availability
- MCP servers (builtin and user)
- Version status and updates
Features:
- Beautiful TUI with symbols and colors
- --verbose flag for detailed output
- --json flag for machine-readable output
- --category flag for running specific checks
- Exit code 1 on failures for CI integration
Closes#333
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
The old name 'auto-compact' was misleading - the hook does much more than
just compaction. It's a full recovery pipeline for context window limit
errors including:
- DCP (Dynamic Context Pruning)
- Aggressive/single truncation
- Summarize with retry
- Emergency message revert
The new name accurately describes its purpose: recovering from Anthropic
context window limit exceeded errors.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Only log tool invocation state changes, not text streaming
- Remove redundant preview logging for message.part text events
- Reduce verbose output noise by filtering partial message updates
🤖 Generated with assistance of OhMyOpenCode
- Remove 'I'm on it...' acknowledgment comment requirement
- Add instruction to report results to issue/PR when task completes
- Simplify prompt to focus on todo tools and planning
🤖 Generated with assistance of OhMyOpenCode
- Export createSkillTool from src/tools/index.ts for public use
- Import and instantiate skill tool in OhMyOpenCodePlugin with configuration
- Use claude_code?.skills toggle to control inclusion of Claude Code paths
- When skills toggle is false, only OpenCode-specific paths are included
- Add skill to tools object and register with plugin for Claude Code compatibility
- Respects existing plugin configuration patterns and integration style
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add skill tool types: SkillArgs, SkillInfo, SkillLoadOptions interfaces
- Implement createSkillTool() factory function with configurable discovery options
- Add parseSkillInfo() helper to convert LoadedSkill to user-facing SkillInfo format
- Add formatSkillsXml() helper to generate available skills XML for tool description
- Support opencodeOnly option to filter Claude Code paths from discovery
- Tool loads and parses skill frontmatter, returns skill content with base directory
- Export skill tool singleton instance for default usage
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add license, compatibility, metadata, and allowed-tools fields to SkillMetadata interface
- Add corresponding fields to LoadedSkill interface with proper type transformations
- Implement parseAllowedTools() helper for parsing comma/space-separated allowed tools
- Add discoverSkills() function with includeClaudeCodePaths option for flexible skill discovery
- Add getSkillByName() function for efficient skill lookup by name
- Support both OpenCode and Claude Code skill paths based on configuration
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat: add opencode-skill-loader with 4-source priority system
- Create new opencode-skill-loader feature module independent from Claude Code
- Support 4 source paths with priority: opencode-project > project > opencode > user
- .opencode/skill/ (opencode-project)
- .claude/skills/ (project)
- ~/.config/opencode/skill/ (opencode)
- ~/.claude/skills/ (user)
- Support both SKILL.md and {SKILLNAME}.md file patterns
- Maintain path awareness for file references (@path syntax)
* feat: integrate opencode-skill-loader into main plugin
- Import and use new skill loader functions
- Load skills from all 4 sources and merge into config.command
- Also merge pluginComponents.skills (previously loaded but never used)
* feat: add skill discovery to slashcommand tool
- Import and use discoverAllSkills from opencode-skill-loader
- Display skills alongside commands in tool description and execution
- Update formatCommandList to handle combined commands and skills
* refactor: remove old claude-code-skill-loader
- Delete src/features/claude-code-skill-loader/ directory (was never integrated into main plugin)
- Update plugin loader import to use new opencode-skill-loader types
* docs: update AGENTS.md for new skill loader
- Update structure to show opencode-skill-loader instead of claude-code-skill-loader
- Update Skills priority order to include all 4 sources
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Fix dcp_on_compaction_failure → dcp_for_compaction in JSON examples
to match actual schema and code implementation.
Cherry-picked from #325 (merged to master instead of dev)
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ahoy! The old code be walkin' the plank on Windows, ARRRR! 🏴☠️
The Problem (a cursed treasure map):
- LSP returns URIs like file:///C:/path/to/file.ts
- Old code: uri.replace("file://", "") produces /C:/path (INVALID on Windows!)
- Windows needs the leadin' slash removed after file:///
The Fix (proper pirate navigation):
- Import fileURLToPath from node:url (the sacred scroll)
- Add uriToPath() helper function (our trusty compass)
- Replace all 10 occurrences of .replace("file://", "")
This matches how the OpenCode mothership handles it in packages/opencode/src/lsp/client.ts
Now Windows users can sail the LSP seas without crashin' on the rocks! 🦜
Background task sessions registered in subagentSessions were not receiving
todo-continuation prompts, causing a deadlock: background tasks waited for
continuation that never came.
Changes:
- Allow both main session and background task sessions to receive continuation
- Add test for background task session continuation behavior
- Cleanup subagentSessions in test setup/teardown
This fixes the deadlock introduced in commit 116a90d which added todo waiting
logic to background-agent/manager.ts.
🤖 Generated with assistance of OhMyOpenCode
Removes the complex state machine and 10-second throttle (MIN_INJECTION_INTERVAL_MS)
that was causing background task completion to hang. The hook now:
- Uses straightforward error cooldown logic instead of complex injection throttling
- Removes unnecessary state tracking that was delaying continuation injection
- Maintains all safety checks (recovery mode, running tasks, error state)
- Keeps countdown behavior with toast notifications
Fixes#312 - Resolves v2.7.0 issue where background task completion would freeze
the agent due to injection delays.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Replace retry loop with intelligent fallback strategy:
- Try default installer first (better for version discovery)
- On failure, fallback to pinned version 1.0.204
- Handle corrupted downloads with direct fallback install
This addresses the sisyphus-agent workflow failure where OpenCode's installer failed
with 'Failed to fetch version information' error.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- New src/features/builtin-commands/ module with CommandDefinition loader
- Implements init-deep command for hierarchical AGENTS.md knowledge base generation
- Adds BuiltinCommandName and BuiltinCommandNameSchema to config
- Integrates builtin commands loader into main plugin with proper config merging
- Supports disabling specific builtin commands via disabled_commands config array
🤖 Generated with assistance of https://github.com/code-yeongyu/oh-my-opencode
Add metadata() calls to background_task and call_omo_agent tools so that OpenCode UI displays session navigation hints (ctrl+x + arrow keys) like the original Task tool does. This enhances UX by providing consistent session navigation UI for background and subagent tasks.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Previously, errorBypass mode was cleared on session.idle, causing continuation
to fire again on next idle event. This led to unwanted task resumption after
user abort.
Changes:
- Don't clear errorBypass on session.idle - stay in errorBypass mode
- Clear errorBypass to idle only when user sends a new message
This ensures that once user aborts, the enforcer respects that decision until
the user explicitly sends a message to resume.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Fixes race conditions, enables continuous enforcement, and eliminates false positives/negatives.
- Complete redesign using version-token state machine for race condition prevention
- Replaced 5 separate Sets with single Map<sessionID, SessionState>
- Changed cancelCountdown() to invalidate() that ALWAYS bumps version regardless of mode
- Added background task check BEFORE starting countdown (prevents toast spam when bg tasks running)
- Added lastAttemptedAt throttling (10s minimum between attempts, set BEFORE API call)
- Removed non-interactive preemptive injection (all paths now use countdown)
- Added 3 version checks in executeInjection (start, after todo fetch, before API call)
- Removed remindedSessions flag for continuous enforcement
Fixes:
1. Race condition where session.idle fired before message.updated cleared reminded state
2. Single-shot behavior that prevented multiple reminders
3. Phantom reminders sent even after agent started working
4. Toast spam when background tasks are running
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Previously, when an LSP server was configured but not installed, the error
message said "No LSP server configured" which was misleading. Now the
error message distinguishes between:
1. Server not configured at all
2. Server configured but not installed (with installation hints)
The new error messages include:
- Clear indication of whether server is configured vs installed
- Installation commands for each built-in server
- Supported file extensions
- Configuration examples for custom servers
Fixes#304
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
DCP was failing to find session messages because it was looking in
~/.config/opencode/sessions instead of ~/.local/share/opencode/storage.
Unified all hooks to use getOpenCodeStorageDir() for cross-platform consistency.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix: disable todo-continuation for plan mode agents
Plan mode agents (e.g., 'plan', 'Planner-Sisyphus') only analyze and plan,
they don't implement. The todo-continuation hook was incorrectly triggering
for these agents because the existing write permission check only looked at
the stored message's tools field, not the agent's permission configuration.
This fix adds an explicit check for plan mode agents by name to skip the
todo continuation prompt injection.
Fixes#293
* chore: changes by sisyphus-dev-ai
* fix: address review comments for plan mode agent check
- Use exact match for plan mode agents instead of substring match to
prevent false positives on agents like 'deployment-planner'
- Add plan mode agent check to preemptive injection path (non-interactive
mode) which was missing from the initial fix
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Remove eager SG_CLI_PATH constant; use getSgCliPath() lazily in checkEnvironment()
- Move setInterval to inside createCommentCheckerHooks() with guard flag
These changes eliminate module-level side effects that could trigger segfaults
during plugin initialization on Bun 1.3.5 + macOS 15 due to createRequire()
being called during module evaluation.
Fixes#292
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Refactored state management to use a single source of truth per-session using
a state machine pattern with versioning. Key improvements:
- Replace multiple Sets with unified SessionState map for cleaner logic
- Add version tokens to invalidate pending callbacks on state changes
- Improve countdown timer management with proper cleanup
- Add throttle check to prevent rapid injection spam (10s minimum interval)
- Enhance injection checks: re-verify todos before injection, check bg tasks
- Handle message.part.updated events for streaming activity detection
- Add isMainSession() helper for consistent session filtering
- Clearer event handler logic with inline comments explaining state transitions
- Better logging for debugging state changes and decision points
State modes: idle → countingDown → injecting → idle (with recovery/errorBypass)
Prevents race conditions from async operations and UI state changes during countdown.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
The DCP pruning modules were using a hardcoded path (~/.config/opencode/sessions) that doesn't exist.
Sessions are actually stored at ~/.local/share/opencode/storage/message.
All pruning modules now import MESSAGE_STORAGE from hook-message-injector, which uses the correct path via getOpenCodeStorageDir().
This fixes the issue where DCP would fail with 'message dir not found' when trying to recover from token limit errors.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Add customPrompt parameter to runCommentChecker function
- Pass --prompt flag to comment-checker CLI when custom_prompt is configured
- Wire up config from plugin initialization
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add finally block in notifyParentSession() to ensure task cleanup
- Call tasks.delete(taskId) after notification sent or on error
- Prevents memory accumulation when tasks complete or fail
- taskId captured before setTimeout to ensure proper cleanup in async context
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Previously, the validator only checked for tool_use parts, causing 'Expected thinking but found text' errors when messages had text content. Renamed hasToolParts to hasContentParts to include both tool_use and text types.
Also added CommentCheckerConfigSchema support for custom prompt configuration.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Expand the search range when finding empty messages by index to better handle API index vs storage index mismatches. This increases robustness when searching for messages to sanitize with more fallback indices.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Convert session-manager storage layer from synchronous blocking I/O (readdirSync, readFileSync) to non-blocking async I/O (readdir, readFile from fs/promises). This fixes hanging issues in session_search and other tools caused by blocking filesystem operations.
Changes:
- storage.ts: getAllSessions, readSessionMessages, getSessionInfo now async
- utils.ts: Updated utility functions to be async-compatible
- tools.ts: Added await calls for async storage functions
- storage.test.ts, utils.test.ts: Updated tests with async/await patterns
This resolves the session_search tool hang issue and improves overall responsiveness.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Pre-emptively fix empty messages in sessions before running document compression to prevent summarization failures. This prevents accumulation of empty message placeholders that can interfere with context management.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
* feat(cli): librarian uses gemini-3-flash when hasGemini (antigravity auth)
Closes#294
* feat(cli): add explore to gemini-3-flash when hasGemini + update docs
* feat(cli): fix explore agent fallback logic to use haiku for max20 Claude users
- Use gemini-3-flash for both librarian and explore when hasGemini
- Use haiku for explore when Claude max20 is available (hasClaude && isMax20)
- Fall back to big-pickle for both when other models unavailable
- Updated all README files to document the fallback precedence
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Refactored DCP (Dynamic Context Pruning) to execute FIRST when token limit errors occur
- Previously, DCP only ran as a fallback after compaction failed
- Now DCP runs first to prune redundant context, then compaction executes immediately
- Simplified config flag: dcp_on_compaction_failure → dcp_for_compaction
- Updated documentation in all 4 README files (EN, KO, JA, ZH-CN)
- Updated schema.ts with new config field name and documentation
- Updated executor.ts with new DCP-first logic flow
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add AntigravityTokenRefreshError custom error class with code, description, and status fields
- Implement parseOAuthErrorPayload() for parsing Google's various OAuth error response formats
- Add retry logic with exponential backoff (3 retries, 1s→2s→4s delay) for transient failures
- Add special handling for invalid_grant error - immediately throws without retry and clears caches
- Add invalidateProjectContextByRefreshToken() for selective cache invalidation
- Update fetch.ts error handling to work with new error class and cache invalidation
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
The installed_plugins.json file has two versions:
- v1: plugins stored as direct objects
- v2: plugins stored as arrays
Use discriminated union types (InstalledPluginsDatabaseV1/V2) for proper
type narrowing based on version field.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix: defer config error toast to session.created for TUI readiness
Removed showToast calls from loadConfigFromPath() function. Error notifications were not visible during plugin initialization because the TUI was not ready yet.
Changes:
- Removed immediate showToast calls from validation error handler
- Removed immediate showToast calls from file load error handler
- Errors are still captured via addConfigLoadError() for later display
- auto-update-checker hook will display errors via showConfigErrorsIfAny() after session.created event
This ensures error messages are displayed when the TUI is fully ready and able to render them properly.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix: await config error toast before showing startup toast
Ensure config errors are awaited and displayed before the startup spinner toast is shown. Changed showConfigErrorsIfAny(ctx).catch(() => {}) to await showConfigErrorsIfAny(ctx) to guarantee proper error handling order.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Make DCP behavior opt-in via new 'dcp_on_compaction_failure' experimental flag (disabled by default).
When enabled, Dynamic Context Pruning only executes after summarization fails, then retries compaction. By default, DCP runs before truncation as before.
Changes:
- Add 'dcp_on_compaction_failure' boolean flag to experimental config (default: false)
- Update executor.ts to check flag before running DCP behavior
- Add corresponding documentation to all 4 README files (EN, KO, JA, ZH-CN)
- Update JSON schema
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add Aaron Iker (@aaroniker) with GitHub and X links to the sponsors
section in all language README files (EN, KO, JA, ZH-CN).
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
When getContextWindowUsage returns null (no assistant messages yet, API
failure, or first request in session), the truncator was returning
untruncated output. This caused context overflow crashes on early
requests or when usage lookup failed.
Now applies conservative truncation (50k tokens) as fallback, preventing
prompt-too-long errors that crash sessions.
Fixes#276 - The look_at tool was constructing invalid file:// URLs on Windows
by using template literals. Now uses Node.js pathToFileURL() which correctly
handles backslashes, spaces, and the triple-slash prefix required on Windows.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
The test mock for ctx.$ was not handling tagged template literals correctly,
causing it to ignore interpolated values. Additionally, utility functions that
check for command availability (osascript, notify-send, etc.) were returning
null in test environments, causing sendNotification to exit early.
Changes:
- Fixed template literal reconstruction in mock $ function
- Added spyOn mocks for all utility path functions
- All session-notification tests now passing (11/11)
Fixes#273
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Add process.exit(0) in runner.ts for immediate termination
- Fix Timer type to ReturnType<typeof setInterval> in manager.ts
- Add .unref() to BackgroundManager polling interval
- Add cleanup() method to BackgroundManager
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add new CLI command 'get-local-version' to display current version and check for updates
- Reuses existing version checking infrastructure from auto-update-checker
- Supports both human-readable and JSON output formats
- Handles edge cases: local dev mode, pinned versions, network errors
- Provides colored terminal output with picocolors
- Closes#260
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Fixes#255
- Add getClaudeConfigDir() utility function that respects CLAUDE_CONFIG_DIR env var
- Update all hardcoded ~/.claude paths to use the new utility
- Add comprehensive tests for getClaudeConfigDir()
- Maintain backward compatibility with default ~/.claude when env var is not set
Files updated:
- src/shared/claude-config-dir.ts (new utility)
- src/shared/claude-config-dir.test.ts (tests)
- src/hooks/claude-code-hooks/config.ts
- src/hooks/claude-code-hooks/todo.ts
- src/hooks/claude-code-hooks/transcript.ts
- src/features/claude-code-command-loader/loader.ts
- src/features/claude-code-agent-loader/loader.ts
- src/features/claude-code-skill-loader/loader.ts
- src/features/claude-code-mcp-loader/loader.ts
- src/tools/session-manager/constants.ts
- src/tools/slashcommand/tools.ts
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Add thinking-block-validator hook for proactive prevention before API calls
- Enhance session-recovery to include previous thinking content
- Fix hook registration to actually invoke the validator
Addresses extended thinking errors with Claude Opus/Sonnet 4.5 using tool calls.
Related: https://github.com/vercel/ai/issues/7729
Related: https://github.com/sst/opencode/issues/2599
- Add Sponsors section to README.ko.md, README.ja.md, README.zh-cn.md, README.md
- List Numman Ali as the first sponsor
- Move thanks message to end of file to match structure
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Include output tokens from last response in getContextWindowUsage calculation.
Output tokens become part of next request's input (conversation history), so
they must be counted to avoid overestimating remainingTokens. This aligns with
preemptive-compaction's calculation which already includes output tokens correctly.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Apply dynamic truncation to rules-injector, directory-readme-injector, and directory-agents-injector
- Add truncation notice encouraging users to read full content
- Save context window space while maintaining awareness of complete documentation
- Resolves#221 (part 1)
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Renamed sisyphus_agent.builder_enabled to default_builder_enabled for clarity
- Removed sisyphus_agent.replace_build option entirely
- Default build agent is now always demoted to subagent mode when Sisyphus is enabled
- Updated schema and regenerated JSON schema
- Updated all documentation (EN, KO, JA, ZH-CN)
BREAKING CHANGE: Configuration migration required for users using builder_enabled or replace_build options.
Closes#250
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
* fix: show error messages when oh-my-opencode.json config fails to load
- Add console.error output for config parse errors (syntax errors)
- Add console.error output for config validation errors (schema violations)
- Display helpful hints for JSON syntax errors
- List all validation errors clearly with proper formatting
- Errors now shown immediately regardless of hook configuration
Fixes#241
* refactor: replace console.error with toast notifications for config errors
- Replace console.error with ctx.client.tui.showToast() for better UX
- Show toast notifications for both syntax errors and validation errors
- Toast notifications persist for 10 seconds for visibility
- Display error details with bullet points for validation errors
- Include helpful hints for JSON syntax errors
This provides a more user-friendly notification system that integrates
with OpenCode's UI instead of just logging to console.
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Fixes#191
This commit ensures that the user's selected model is preserved when
background tasks complete and notify their parent sessions.
Changes:
- Add parentModel field to BackgroundTask and LaunchInput interfaces
- Capture model context when launching background tasks
- Pass model context when notifying parent sessions after task completion
Impact:
- Users with OAuth providers (Google, Anthropic) will now have their
model selection preserved across background task continuations
- Background agents no longer revert to hardcoded defaults
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
When session.error occurs with incomplete todos, the run command now:
- Captures the error via handleSessionError()
- Exits with code 1 instead of waiting indefinitely
- Shows clear error message to user
Previously, run command ignored session.error events, causing infinite
'Waiting: N todos remaining' loop when agent errors occurred.
🤖 Generated with assistance of OhMyOpenCode
https://github.com/code-yeongyu/oh-my-opencode
Fixes the race condition where the todo continuation hook would inject a
continuation prompt even when all todos had been completed during the
countdown period.
The root cause was that executeAfterCountdown() used stale todo data from
the initial session.idle check without re-verifying that incomplete todos
still existed after the countdown finished.
Changes:
- Add fresh todo verification in executeAfterCountdown() before prompt injection
- Use fresh todo data in the continuation prompt message
- Abort injection if no incomplete todos remain after countdown
This properly handles the case where:
1. session.idle fires (e.g., user enters shell mode in TUI)
2. Initial check finds incomplete todos, starts countdown
3. During countdown, todos get completed
4. Countdown ends, fresh check detects no incomplete todos
5. Hook aborts instead of injecting stale prompt
Fixes#234
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- logEventVerbose() logs all event types including message content, tool calls, and results
- Session tags distinguish main vs child sessions for multi-session tracking
- completion.ts error logging instead of silently swallowing API errors
- Helps diagnose realtime streaming behavior in CI environments
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Remove DEFAULT_TIMEOUT_MS (set to 0) to allow CI agent runs to complete without timeout
- Add stdbuf -oL -eL for unbuffered realtime output in GitHub Actions
- Update timeout logic to only set timeout when value > 0
This fixes CI agent runs that were timing out after 30 minutes and not showing realtime output.
🤖 Generated with assistance of OhMyOpenCode
Previously, the condition '&&plannerEnabled&&replacePlan' caused agents to be
completely removed instead of demoted to subagent mode. The logic incorrectly
prevented agents from being added back as subagents when Sisyphus is enabled
with default config.
Fixed by simplifying to just 'replacePlan' condition - agents are now properly
demoted to subagent mode when replacement is enabled, which is the intended
behavior per the README.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Renamed agent from 'Builder-Sisyphus' to 'OpenCode-Builder' in schema and config
- Removed BUILD_SYSTEM_PROMPT and BUILD_PERMISSION custom overrides
- Now uses OpenCode's default build agent configuration exactly
- Simplified agent configuration to rely on OpenCode defaults
🤖 Generated with assistance of OhMyOpenCode
Use environment variables instead of direct GitHub expression interpolation in bash script. This prevents the script from breaking when comment bodies contain quotes or special characters.
Variables like COMMENT_BODY, COMMENT_AUTHOR, COMMENT_ID_VAL are now passed via env: block instead of being interpolated directly into bash commands.
🤖 Generated with assistance of OhMyOpenCode
Fixes#200
## Problem
When executeCompact() recovery fails unexpectedly or gets interrupted,
the compactionInProgress lock is never cleared, permanently blocking both
auto-compact AND manual /compact for the session.
## Root Cause
- No try/finally around lock acquisition (line 261)
- Silent blocking when lock held - no user feedback
- Lock cleanup scattered across 7 manual deletion points
- Any unexpected exception bypasses cleanup, leaving lock stuck forever
## Solution
1. **Try/Finally Lock Guarantee**: Wrapped entire executeCompact body in
try/finally block to guarantee lock cleanup, following the pattern
used in preemptive-compaction hook
2. **User Feedback**: Added toast notification when compact attempt is
blocked by existing lock, replacing silent failure with clear warning
3. **Removed Redundancy**: Removed 6 redundant manual lock deletions
(kept only clearSessionState and finally block)
## Testing Evidence
✅ 10/10 comprehensive tests pass
✅ Lock cleared on successful completion
✅ Lock cleared when summarize throws
✅ Lock cleared when revert throws
✅ Lock cleared when fixEmptyMessages executes
✅ Lock cleared when truncation is sufficient
✅ Lock cleared after max recovery attempts
✅ Lock cleared when toast fails
✅ Lock cleared when prompt_async throws
✅ Toast shown when lock already held
✅ TypeScript type check passes with zero errors
## Files Changed
- executor.ts: Added try/finally, toast notification, removed 6 redundant deletions
- executor.test.ts: New comprehensive test suite (10 tests, 13 assertions)
## Impact
- Severity: High → Fixed
- User Experience: No more stuck sessions requiring restart
- Behavior: Identical except lock now guaranteed to clear
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Filter out original 'build' and 'plan' agents when Builder-Sisyphus/Planner-Sisyphus are enabled with replacement
- Previously both agents could coexist even with replace_build/replace_plan: true
- Now only the replacement agent exists when both enabled and replacement flags are true
- Maintains backward compatibility for all configuration combinations
Fixes#231
The change adds a new "GitHub Markdown Rules" section to the sisyphus agent prompt that specifies:
- Code blocks MUST have exactly 3 backticks with language identifier
- Every opening ``` MUST have a matching closing ``` on its own line
- No trailing backticks or spaces after closing ```
- Inline code should use single backticks
- Lists inside code blocks break rendering
This fixes the issue where code blocks in GitHub comments weren't being closed properly, causing broken markdown rendering.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
The SDK yields events directly as the payload without wrapping in { payload: ... }.
Changed processEvents to treat event as the payload directly instead of looking
for event.payload. This fixes the 'Waiting for completion...' hang in GitHub
Actions where all events were being silently skipped.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Added message.part.updated event handling for incremental text streaming
- Added tool.execute event to display tool calls with input previews
- Added tool.result event to show truncated tool result outputs
- Enhanced EventState with lastPartText and currentTool tracking
- Defined MessagePartUpdatedProps, ToolExecuteProps, ToolResultProps types
- Updated event tests to cover new state fields
This enables the CLI run command to display real-time agent output similar to the native opencode run command, improving user experience with immediate feedback on tool execution.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Add missing mock exports (SESSION_LIST_DESCRIPTION, SESSION_READ_DESCRIPTION,
SESSION_SEARCH_DESCRIPTION, SESSION_INFO_DESCRIPTION, SESSION_DELETE_DESCRIPTION,
TOOL_NAME_PREFIX) to fix test failures when other test files import from constants.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Tests now properly mock the constants module before importing storage functions,
ensuring test data is read/written to temp directories instead of real paths.
This fixes test isolation issues and allows tests to run independently.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
The tool() wrapper from @opencode-ai/plugin requires execute(args, context: ToolContext) signature. Updated all session-manager tool functions (session_list, session_read, session_search, session_info) to accept the context parameter, and updated corresponding tests with mockContext.
🤖 Generated with assistance of OhMyOpenCode
- Build local oh-my-opencode before setup instead of downloading from npm
- Configure opencode to use file:// plugin reference pointing to local repo
- Replace opencode run with bun run dist/cli/index.js run command
- Remove delay on retry logic
This makes the sisyphus-agent workflow use the local plugin directly from the checked-out repo instead of downloading from npm.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Add new 'run' command using @opencode-ai/sdk to manage agent sessions
- Implement recursive descendant session checking (waits for ALL nested child sessions)
- Add completion conditions: all todos done + all descendant sessions idle
- Add SSE event processing for session state tracking
- Fix todo-continuation-enforcer to clean up session tracking
- Comprehensive test coverage with memory-safe test patterns
Unlike 'opencode run', this command ensures the agent completes all tasks
by recursively waiting for nested background agent sessions before exiting.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
* feat(tools): add session management tools for OpenCode sessions
- Add session_list tool for listing sessions with filtering
- Add session_read tool for reading session messages and history
- Add session_search tool for full-text search across sessions
- Add session_info tool for session metadata inspection
- Add comprehensive tests for storage, utils, and tools
- Update documentation in AGENTS.md
Closes#132
* fix(session-manager): add Windows compatibility for storage paths
- Create shared/data-path.ts utility for cross-platform data directory resolution
- On Windows: uses %LOCALAPPDATA% (e.g., C:\Users\Username\AppData\Local)
- On Unix: uses $XDG_DATA_HOME or ~/.local/share (XDG Base Directory spec)
- Update session-manager/constants.ts to use getOpenCodeStorageDir()
- Update hook-message-injector/constants.ts to use same utility
- Remove dependency on xdg-basedir package in session-manager
- Follows existing pattern from auto-update-checker for consistency
---------
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Change truncate_all_tool_outputs default from false to true
- Update schema.ts to use .default(true) instead of .optional()
- Update documentation in all README files (EN, KO, JA, ZH-CN)
- Rebuild JSON schema with new default value
This prevents prompts from becoming too long by dynamically truncating
all tool outputs based on context window usage. Users can opt-out by
setting experimental.truncate_all_tool_outputs to false.
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Changed truncate_all_tool_outputs default from false to true
- Updated schema documentation to reflect new default
- Added entry in README experimental features table
- Regenerated JSON schema
This prevents prompts from becoming too long by dynamically
truncating output from all tool calls, not just whitelisted ones.
Feature is experimental and enabled by default to help manage
context window usage across all tools.
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
- Add 'sisyphus: working' label when Sisyphus starts working on an issue/PR
- Remove label when work completes (success or failure)
- Label operations use gh CLI with idempotent commands
- Handles both issues and PRs with proper conditional logic
- Uses || true for error handling to prevent workflow failures
Closes#202
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Detects non-interactive environments (CI, opencode run) and prevents session idle when:
- Background tasks are still running
- Incomplete todos remain in the queue
Changes:
- Add isNonInteractive() detector for CI/headless environment detection
- Export detector from non-interactive-env hook module
- Enhance todo-continuation-enforcer to inject prompts BEFORE session.idle
- Pass BackgroundManager to todo-continuation-enforcer for task status checks
This fix prevents `opencode run` from exiting prematurely when work is pending.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
The api: "antigravity" field being added to opencode.json causes
authentication failures with the antigravity plugin.
Fixes: NoeFabris/opencode-antigravity-auth#49
* fix: Notification hook works weirdly for subagent sessions
- Added mainSessionID check to prevent notifications in subagent sessions
- Only trigger notifications for main session when waiting for user input
- Added comprehensive tests to validate the fix
Issue: https://github.com/code-yeongyu/oh-my-opencode/issues/92
* chore: changes by sisyphus-dev-ai
---------
Co-authored-by: codingsh <codingsh@pm.me>
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Create directory-specific knowledge bases for high-complexity directories:
- src/hooks/AGENTS.md: Documents 21 hooks across 86 files
- src/tools/AGENTS.md: Documents 11 LSP tools, AST-Grep, MCP, background tasks (50 files)
- src/features/AGENTS.md: Documents 6 Claude Code compatibility features (24 files)
Root AGENTS.md updated to reference these specialized guides while maintaining project overview. Enables better navigation and reduces cognitive load for developers working in specific areas.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Move user reviews to top of documents and clean up citation formatting with dash separators across all localized README files (EN, JA, KO, ZH-CN).
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add user reviews section to READMEs (EN, KO, JA, ZH-CN)
- Update Antigravity request.ts: change default model from gemini-3-pro-preview to gemini-3-pro-high
- Enhance config-manager.ts: add full model specs (name, limit, modalities) to provider config
- Add comprehensive test suite for config-manager (config-manager.test.ts)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
The CLI module was missing from the npm package because the publish workflow
did not include the 'bun build src/cli/index.ts' step. This caused 'bunx oh-my-opencode
install' to fail with missing dist/cli/index.js at runtime. Added explicit CLI build
and verification step to prevent this regression.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Check if metadata is empty before using it
- Wrap output.output in structured object when metadata is missing
- Ensures plugin tools (call_omo_agent, background_task, task) that return strings are properly recorded in transcripts instead of empty {}
🤖 Generated with assistance of OhMyOpenCode
When sending the 'Continue' message after compaction, now includes the
original agent parameter from the stored message. Previously, the Continue
message was sent without the agent parameter, causing OpenCode to use the
default 'build' agent instead of preserving the original agent context
(e.g., Sisyphus).
Implementation:
- Get messageDir using getMessageDir(sessionID)
- Retrieve storedMessage using findNearestMessageWithFields
- Pass agent: storedMessage?.agent to promptAsync body
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Previously, first messages were skipped entirely to avoid interfering with title generation.
Now, keywords detected on the first message are injected directly into the message parts
instead of using the hook message injection system, allowing keywords like 'ultrawork' to
activate on the first message of a session.
This change:
- Removes the early return that skipped first message keyword detection
- Moves keyword context generation before the isFirstMessage check
- For first messages: transforms message parts directly by prepending keyword context
- For subsequent messages: maintains existing hook message injection behavior
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Embed files directly in message parts using file:// URL format
- Remove dependency on Read tool for multimodal-looker agent
- Add inferMimeType helper for proper MIME type detection
- Disable read tool in agent tools config (no longer needed)
- Upgrade multimodal-looker model to gemini-3-flash
- Update all README docs to reflect gemini-3-flash change
Fixes#126🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Detect and warn about interactive commands (vim, nano, less, etc.)
- Filter out descriptive entries with parentheses from pattern matching
🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Add npm_config_yes, PIP_NO_INPUT, YARN_ENABLE_IMMUTABLE_INSTALLS env vars
- Add SHELL_COMMAND_PATTERNS documentation for common command patterns
- Document good/bad patterns for npm, apt, pip, git, system commands
- List banned commands that will always hang (editors, pagers, REPLs)
- Include workarounds for scripts requiring input (yes pipe, heredoc)
Adds getMessageDir() helper function and fallback logic in the session.idle event handler to retrieve stored model information (providerID/modelID) when the API response lacks these fields. This mirrors the approach used in todo-continuation-enforcer hook to ensure preemptive compaction can proceed even when model info is missing from the initial response.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
OpenCode has native skill support that automatically scans .claude/skills/
and injects available_skills into system prompt. The agent reads SKILL.md
files directly via the Read tool, making our separate skill tool a duplicate.
The claude-code-skill-loader feature (which converts skills to slash
commands) is intentionally kept - only the redundant skill tool is removed.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Previously, remindedSessions was only cleared when assistant finished
with finish=true. If agent stopped mid-task (ESC, error), the session
stayed 'reminded' forever, preventing future continuations.
Now also clears remindedSessions when user sends a new message,
allowing continuation to trigger again after user interaction.
- Fixed agent name OmO → Sisyphus
- Added CI PIPELINE section documenting workflow patterns
- Fixed testing documentation (Bun test framework with BDD pattern)
- Added README.zh-cn.md to multi-language docs list
- Added `bun test` command to COMMANDS section
- Added anti-patterns: Over-exploration, Date references
- Updated convention: Test style with BDD comments
- Added script/generate-changelog.ts to structure
- Updated timestamp (2025-12-22) and git commit reference (aad7a72)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Previously, the code was explicitly removing the model property from user config overrides before merging, which prevented users from overriding agent models via config.
This change allows user config like:
{
"agents": {
"librarian": {
"model": "google/gemini-3-flash-preview"
}
}
}
to properly override the default agent models.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* Fix AGENTS.md injection not working with batch tool (#141)
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
* Extend batch tool support to rules-injector
The rules-injector hook now captures file paths from batch tool calls, enabling it to inject rules into files read via the batch tool. This ensures all injection hooks work correctly for all file access patterns.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Change the 'Frontend Files' section from a hard block that delegates ALL frontend changes to a more nuanced decision gate that classifies changes before action. Visual/UI/UX changes (styling, layout, animation) should be delegated to frontend-ui-ux-engineer, while pure logic changes can be handled directly.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Fix draft release workflow so 'Upcoming Changes' draft release is updated on dev push, not master. Previously it was only updated on master push which caused the draft release to show stale/empty content after publish.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Convert XML tags to Markdown headers for better Gemini compatibility
- Preserve all essential content while condensing verbose sections
- Add back missing principles like 'Understand why code is structured'
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
When overriding an agent's model to a different provider, the agent
now automatically gets provider-appropriate reasoning options:
- GPT models: `reasoningEffort`, `textVerbosity`
- Anthropic models: `thinking` with `budgetTokens`
## Why utils.ts changes are required
The original flow merges overrides onto pre-built agent configs:
mergeAgentConfig(sisyphusAgent, { model: "gpt-5.2" })
// Result: { model: "gpt-5.2", thinking: {...} }
The `thinking` config persists because it exists in the pre-built
`sisyphusAgent`. GPT models ignore `thinking` and need `reasoningEffort`.
The fix: call the agent factory with the resolved model, so the factory
can return the correct provider-specific config:
buildAgent(createSisyphusAgent, "gpt-5.2")
// Result: { model: "gpt-5.2", reasoningEffort: "medium" }
Closes#144🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Limit preemptive compaction to Claude models only (opus, sonnet, haiku pattern)
- Add support for detecting `anthropic-beta: context-1m-*` header to use 1M context limit for Sonnet models
- Add `getModelLimit` callback to read model limits from OpenCode config (`provider.*.models.*.limit.context`)
- Remove hardcoded MODEL_CONTEXT_LIMITS and replace with pattern-based model detection
- Cache model context limits from config at startup for performance
This enables flexible per-model context limit configuration without hardcoding limits in the plugin.
Generated with assistance of OhMyOpenCode
* docs: update X account manager from junhoyeo to justsisyphus
Changed the notice to reflect that @justsisyphus is now managing
oh-my-opencode updates on X instead of @_junhoyeo.
* docs: add X account manager notice to all language READMEs
Added notice about @justsisyphus managing oh-my-opencode updates
on X to Korean, Japanese, and Chinese README files.
---------
Co-authored-by: Claude <noreply@anthropic.com>
The empty message recovery is now enabled by default (no longer experimental).
Removes the config option from schema and all README files.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Fixed bug where remindedSessions was never cleared after assistant response
- Now clears reminded state when assistant finishes (finish: true)
- Allows TODO continuation to trigger again after each assistant response
- Ensures continuation prompt can be injected multiple times if needed in long sessions
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Added BeforeSummarizeCallback type to allow injecting context before session summarization
- Added onBeforeSummarize option to PreemptiveCompactionOptions
- Created compaction-context-injector module that injects summarization instructions with sections:
- User Requests (As-Is)
- Final Goal
- Work Completed
- Remaining Tasks
- MUST NOT Do (Critical Constraints)
- Wired up callback invocation in preemptive-compaction before calling summarize API
- Exported new hook from src/hooks/index.ts
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add messageIndex field to ParsedTokenLimitError type for tracking message position
- Extract message index from 'messages.N' format in error messages using regex
- Update fixEmptyMessages to accept optional messageIndex parameter
- Target specific empty message by index instead of fixing all empty messages
- Apply replaceEmptyTextParts before injectTextPart for better coverage
- Remove experimental flag requirement - non-empty content errors now auto-recover by default
- Fixes issue where compaction could create empty messages at positions other than the last message
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This file exported BUILD_AGENT_PROMPT_EXTENSION but was never imported
or used anywhere in the codebase, making it dead code that could be safely removed.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Raise the preemptive compaction trigger point from 80% to 85% to reduce false-positive compactions and allow longer session contexts before automatic compaction kicks in.
🤖 Generated with assistance of OhMyOpenCode
Monitor token usage after assistant responses and automatically trigger session
compaction when exceeding configured threshold (default 80%). Toast notifications
provide user feedback on compaction status.
Controlled via experimental.preemptive_compaction config option.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Implements dual-path config resolution on Windows to ensure backward compatibility
while maintaining cross-platform consistency. Checks ~/.config first (new standard),
falls back to %APPDATA% for existing installations.
Resolves#129🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Requires test and typecheck jobs to pass before publishing
- Prevents publishing if tests or type checks fail
- Improves release quality assurance
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Reduce COUNTDOWN_SECONDS from 5 to 2 for faster reminder display
- Remove logic that clears remindedSessions on assistant response to prevent re-triggering
- Ensures todo continuation reminder displays exactly once per session
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Remove dedicated prove-yourself mode (frustration keyword detector)
- Add ZERO TOLERANCE FAILURES section to ultrawork mode
- Consolidate completion enforcement rules: no scope reduction, no partial completion, no assumed shortcuts, no premature stopping
- Simplify constants by removing separate frustration handler
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Replace recursive retry mechanism with explicit session.prompt_async('Continue')
- Clear all compaction state after successful revert to prevent state corruption
- Prevents infinite retry loops and improves session reliability
🤖 Generated with assistance of oh-my-opencode
- Create script/generate-changelog.ts with reusable changelog generation logic
- Update ci.yml draft-release job to use the new script instead of GitHub's generate-notes API
- Ensures draft release notes follow the same format as published releases
🤖 Generated with assistance of oh-my-opencode
- Add draft-release job in ci.yml that creates/updates draft release with tag 'next' and title 'Upcoming Changes 🍿'
- Generate release notes based on commits since latest published release
- Add step in publish.yml to delete draft release after successful publish
- Follows indentcorp/backend pattern for automatic draft release management
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Add CI that runs tests, typecheck, and build verification on push/PR to master.
Include test script in package.json and new .github/workflows/ci.yml.
Adds:
- .github/workflows/ci.yml: CI workflow with test, typecheck, and build jobs
- package.json: test script entry
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Update all README files (English, Korean, Japanese, Chinese) to clarify that
fallback models should depend on user's available credentials:
- If Claude is available: use anthropic/claude-opus-4-5 as fallback
- If Claude is NOT available: use opencode/big-pickle as fallback
Previously, the fallback logic would hardcode claude-opus-4-5 for ChatGPT
and Gemini questions, which would fail if users didn't have Claude access.
🤖 Generated with assistance of OhMyOpenCode
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Changes:
- Add main session check: skip toast for subagent sessions
- Move todo validation BEFORE countdown: only start countdown when incomplete todos actually exist
- Improve toast message to show remaining task count
This fixes the issue where countdown toast was showing on every idle event, even when no todos existed or in subagent sessions.
Implement countdown toast feature showing visual feedback before todo continuation:
- Changed from 5-second timeout to interval-based countdown
- Shows toast every second: "Resuming in 5s...", "Resuming in 4s...", etc.
- Toast duration set to 900ms to prevent overlap
- Countdown cancels on user message, session error, or session deletion
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add follow-up question for users with Claude Pro/Max subscription to check
if they have access to max20 (20x mode). If not using max20, librarian agent
is configured to use opencode/big-pickle instead of Claude Sonnet 4.5.
Updates all README files (EN, KO, JA, ZH-CN) with clarified setup instructions.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- GIT_EDITOR, EDITOR, VISUAL, GIT_SEQUENCE_EDITOR set to 'true' to block editor invocations during git operations like rebase
- GIT_PAGER, PAGER set to 'cat' to disable pagination
- Fixes issue where git rebase --continue was still opening nvim despite existing non-interactive env vars
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Run update check in background after startup (non-blocking)
- Auto-update pinned versions in config file when newer version available
- Add auto_update config option to disable auto-updating
- Properly invalidate package cache after config update
- Scoped regex replacement to avoid editing outside plugin array
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Reduce analyze-mode agent recommendations from aggressive (10+ agents, 3+ explore, 3+ librarian, 2+ general, 3+ oracle) to moderate (1-2 explore, 1-2 librarian, oracle only if complex) for simple requests like "살펴봐줘". Previous settings caused unnecessary agent spawning and token consumption for straightforward analysis tasks. New recommendation prioritizes context gathering with direct tools (Grep, AST-grep) for typical workflows, reserving oracle consultation for genuinely complex scenarios (architecture, multi-system, debugging after failures).
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
The grep-output-truncator hook was never registered in index.ts, so grep
output was not being truncated since commit 03a4501 which removed grep/Grep
from tool-output-truncator's TRUNCATABLE_TOOLS list.
- Remove unused grep-output-truncator.ts
- Add "grep" and "Grep" back to tool-output-truncator's TRUNCATABLE_TOOLS
Co-authored-by: Claude <noreply@anthropic.com>
- Removes package from node_modules, package.json dependencies, AND bun.lock (workspaces.dependencies + packages)
- Fixes issue where 'update available' notification appeared but actual update didn't happen on restart due to bun.lock pinning old version
- Added BunLockfile interface and stripTrailingCommas helper for JSON parsing
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* docs: rename OmO agent to Sisyphus, OmO-Plan to Planner-Sisyphus
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* refactor: rename OmO agent to Sisyphus with automatic config migration
- Rename OmO agent to Sisyphus (uses mythological pushing-the-boulder concept)
- Rename OmO-Plan to Planner-Sisyphus for consistency
- Update config schema: omo_agent → sisyphus_agent
- Add backward compatibility: automatically migrate user's oh-my-opencode.json files
- Migration handles old keys (OmO, omo, OmO-Plan, omo-plan) and rewrites config when detected
- Update agent name mappings, index files, and type definitions
- Add Sisyphus PNG asset to brand identity
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* docs: add Sisyphus mythology introduction and teammates concept to all READMEs
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(startup-toast): show Sisyphus steering message when enabled
- Updated startup toast to show "Sisyphus on steroids is steering OpenCode" when Sisyphus agent is enabled
- Refactored getToastMessage function to handle conditional message rendering
- Pass isSisyphusEnabled flag from plugin configuration to auto-update-checker hook
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* docs(sisyphus): add philosophical context to Sisyphus agent identity
- Add "Why Sisyphus?" explanation connecting the daily work cycle of humans and AI agents
- Emphasize code quality expectations: indistinguishable from senior engineer's work
- Concise identity statement: work, delegate, verify, ship without AI slop
This clarifies the agent's purpose and reinforces the principle that quality code should not reveal whether it was written by human or AI.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Remove the config file path from the startup toast message. The toast now
only displays 'OpenCode is now on Steroids. oMoMoMoMo...' for a cleaner
user experience. Also removed the unused getUserConfigPath import.
🤖 Generated with assistance of OhMyOpenCode
* feat(anthropic-auto-compact): add aggressive truncation and empty message recovery
Add truncateUntilTargetTokens method, empty content recovery mechanism, and
emptyContentAttemptBySession tracking for robust message handling.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(session-recovery): add auto-resume and recovery callbacks
Implement ResumeConfig, resumeSession() method, and callback support for
enhanced session recovery and resume functionality.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(config): add experimental config schema for gating unstable features
This adds a new 'experimental' config field to the OhMyOpenCode schema that enables fine-grained control over unstable/experimental features:
- aggressive_truncation: Enables aggressive token truncation in anthropic-auto-compact hook for more aggressive token limit handling
- empty_message_recovery: Enables empty message recovery mechanism in anthropic-auto-compact hook for fixing truncation-induced empty message errors
- auto_resume: Enables automatic session resume after recovery in session-recovery hook for seamless recovery experience
The experimental config is optional and all experimental features are disabled by default, ensuring backward compatibility while allowing early adopters to opt-in to cutting-edge features.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Created src/shared/config-errors.ts to isolate config error state management
- Removed function re-exports (getConfigLoadErrors, clearConfigLoadErrors) from main index.ts
- Only ConfigLoadError type is re-exported from main module to avoid OpenCode calling it as a plugin
- Updated auto-update-checker hook to import from shared/config-errors instead of main index
- Fixes "TypeError: undefined is not an object" crash when OpenCode iterated through ALL exports and called clearConfigLoadErrors(input) which returned undefined
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Previously, background_cancel(all=true) only cancelled direct child tasks, leaving grandchildren and deeper nested tasks uncancelled. This caused background agents to continue running even when their parent session was cancelled.
Changes:
- Added getAllDescendantTasks() method to BackgroundTaskManager for recursive task collection
- Updated background_cancel to use getAllDescendantTasks instead of getTasksByParentSession
- Added comprehensive test coverage for nested task cancellation scenarios
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(todo-continuation-enforcer): increase delay to 5s and add write permission check (#89)
- Increase delay from 200ms to 5000ms to prevent firing too quickly before users can respond
- Add write permission check to skip continuation when previous agent lacks write/edit permissions
- Fixes destructive behavior where hook was overriding user wait commands
Resolves#89🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
* improve omo to only work when requested
- Increase delay from 200ms to 5000ms to prevent firing too quickly before users can respond
- Add write permission check to skip continuation when previous agent lacks write/edit permissions
- Fixes destructive behavior where hook was overriding user wait commands
Resolves#89🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Include base directory information in skill template wrapper for improved
context and file resolution during skill loading.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add Key Triggers section, improve tool selection guidance, and update
delegation table for better agent orchestration and decision making.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Remove first-message-only restriction and move keyword injection to chat.message
hook for consistent keyword presence across all messages.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* docs: update document-writer model to Gemini 3 Flash in READMEs
Update model references from gemini-3-pro-preview to gemini-3-flash-preview
and include in available models list for better visibility.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* chore(document-writer): switch to Gemini 3 Flash model
Update model from gemini-3-pro-preview to gemini-3-flash-preview for
improved performance and cost efficiency.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Replace 'Claude is capable' with 'You are capable' to ensure the prompt works effectively with any underlying model, not just Claude.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add systemDefaultModel parameter to createBuiltinAgents() function
- Implement model fallback priority chain for OmO agent:
1. oh-my-opencode.json agents.OmO.model (explicit override)
2. OpenCode system config.model (system default)
3. Hardcoded default in omoAgent (fallback)
- Pass config.model from OpenCode settings to createBuiltinAgents()
This fixes issue #79 where users couldn't change agent models via OpenCode config.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
OpenCode now supports terminal title updates natively (since v1.0.150,
commit 8346550), making this plugin feature redundant. Remove the
entire terminal title feature and clean up associated dead code.
Ref: https://github.com/sst/opencode/commit/8346550
Removed:
- src/features/terminal/ (title.ts, index.ts)
- src/features/claude-code-session-state/detector.ts (dead code)
- src/features/claude-code-session-state/types.ts (dead code)
- Session title tracking (setCurrentSession, getCurrentSessionTitle)
- Terminal title update calls from event handlers
Retained:
- subagentSessions (used by background-agent, session-notification)
- mainSessionID tracking (used by session recovery)
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Inject permission config to automatically allow webfetch and
external_directory (external read) tools without user confirmation.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- When user lacks Claude Pro/Max: Shows opencode/big-pickle fallback for OmO and librarian
- When user lacks ChatGPT: Shows anthropic/claude-opus-4-5 fallback for oracle
- When Gemini not integrated: Shows anthropic/claude-opus-4-5 fallback for frontend-ui-ux-engineer, document-writer, multimodal-looker
Updates all three README files (English, Korean, Japanese) with improved Step 0 setup guidance.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Added opencode-antigravity-auth plugin setup guide to Installation section
- Added oh-my-opencode.json agent model override configuration with google_auth: false
- Added available Antigravity model names reference list
- Updated Configuration > Google Auth section with plugin recommendation
- Documented multi-account load balancing feature
- Applied documentation updates to EN, KO, JA READMEs
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
When project ID fetching failed, an empty string was returned causing 404 errors on API requests. Now uses ANTIGRAVITY_DEFAULT_PROJECT_ID as fallback:
- isFreeTier(): Returns true when tierId is undefined (free tier by default)
- Import ANTIGRAVITY_DEFAULT_PROJECT_ID constant
- Replace empty project ID returns with fallback in all code paths:
- When loadCodeAssist returns null
- When PAID tier is detected
- When non-FREE tier without project
- When onboard/managed project ID fetch fails
Matches behavior of NoeFabris/opencode-antigravity-auth implementation.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Completes the OmO-Plan implementation by providing the READ-ONLY system prompt
and permission configuration that enforce plan-specific constraints. This ensures
OmO-Plan operates in pure analysis and planning mode without file modifications.
Fixes: #77
References: #72, #75🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Instruct LLM agents to ask users if they want to star the repository after successful installation, and run 'gh repo star code-yeongyu/oh-my-opencode' if they agree.
Updated across all 3 README files (English, Korean, Japanese) and session-notification hook.
🤖 Generated with assistance of OhMyOpenCode
Remove OmO agent permission spread from omoPlanBase to ensure OmO-Plan:
- Uses read-only tools only (read, glob, grep, etc)
- Focuses on planning and analysis
- Can ask follow-up questions for clarification
- Does not execute code changes
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Remove OmO agent permission spread from omoPlanBase to ensure OmO-Plan:
- Uses read-only tools only (read, glob, grep, etc)
- Focuses on planning and analysis
- Can ask follow-up questions for clarification
- Does not execute code changes
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Add 'Start now' message for subscription availability in Japanese README
- Add Installation section divisions for humans and LLM agents
- Simplify tool features description by consolidating Tmux integration messaging
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Import subagentSessions from claude-code-session-state in both manager.ts and session-notification.ts
- Add sessionID to subagentSessions Set when creating background task session
- Remove sessionID from subagentSessions when background task session is deleted
- Check if session is in subagentSessions before triggering notification
Fixes#70: Notification hook no longer triggers for subagent idle events
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Update generated timestamp to 2025-12-16T16:00:00+09:00
- Update commit hash to a2d2109
- Bump minimum OpenCode version to 1.0.150
- Add README.ja.md to multi-language documentation list
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add content validation in injectHookMessage() to prevent empty hook content injection
- Add logging to claude-code-hooks and keyword-detector for better debugging
- Document timing issues in empty-message-sanitizer comments
- Update README with improved setup instructions
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Make google_auth enabled by default (true) while still allowing users to disable it by setting google_auth: false.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Add new hook that uses the `experimental.chat.messages.transform` hook to prevent 'non-empty content' API errors by injecting placeholder text into empty messages BEFORE they're sent to the API.
This is a preventive fix - unlike session-recovery which fixes errors after they occur, this hook prevents the error from happening by sanitizing messages before API transmission.
Files:
- src/hooks/empty-message-sanitizer/index.ts (new hook implementation)
- src/hooks/index.ts (export hook function)
- src/config/schema.ts (add hook to HookName type)
- src/index.ts (wire up hook to plugin)
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Added isFreeTier() helper to match 'free', 'free-tier', or any tier starting with 'free'
- Replaced all hardcoded 'FREE' comparisons with isFreeTier() calls
- Fixes issue where FREE tier users couldn't authenticate due to tier ID mismatch
- Added comprehensive debug logging for troubleshooting (ANTIGRAVITY_DEBUG=1)
- Verified: onboardUser API now correctly called for FREE tier users
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
Directly modify empty text parts in storage files before attempting
to inject new parts. This ensures that existing empty text parts are
replaced with placeholder text, fixing the issue where Anthropic API
returns 'messages.X: all messages must have non-empty content' error
even after recovery.
- Added replaceEmptyTextParts function to directly replace empty text parts
- Added findMessagesWithEmptyTextParts function to identify affected messages
- Modified recoverEmptyContentMessage to prioritize replacing existing empty parts
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Removed random project ID generation (doesn't work for FREE tier)
- Added onboardManagedProject() to call onboardUser API for server-assigned managed project ID
- Updated type definitions: AntigravityUserTier, AntigravityOnboardUserPayload
- FREE tier users now get proper project IDs from Google instead of PERMISSION_DENIED errors
- Reference: https://github.com/shekohex/opencode-google-antigravity-auth🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
OmO had a tendency to act without asking questions compared to Claude Code. Even in situations with implicit assumptions, it would rush into work like an unleashed puppy the moment a prompt came in. This commit enhances the Intent Gate prompt to prevent such behavior.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add storage.ts: Functions to find and truncate largest tool results
- Add TruncateState and TRUNCATE_CONFIG for truncation tracking
- Implement truncate-first recovery: truncate largest output -> retry (10x) -> compact (2x) -> revert (3x)
- Move session error handling to immediate recovery instead of session.idle wait
- Add compactionInProgress tracking to prevent concurrent execution
This fixes GitHub issue #63: "prompt is too long" errors now trigger immediate recovery by truncating the largest tool outputs first before attempting compaction.
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
This fix adds CLIProxyAPI-compatible random project ID generation when loadCodeAssist API fails to return a project ID. This allows FREE tier users to use the API without RESOURCE_PROJECT_INVALID errors.
Changes:
1. Added generateRandomProjectId() function matching CLIProxyAPI implementation
2. Changed fallback from empty string "" to generateRandomProjectId()
3. Cache all results (not just when projectId exists)
4. Removed unused ANTIGRAVITY_DEFAULT_PROJECT_ID import
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
The previous Windows implementation used System.Windows.Forms.MessageBox
which displays a blocking modal dialog requiring user interaction.
This replaces it with the native Windows.UI.Notifications.ToastNotificationManager
API (Windows 10+) which shows a non-intrusive toast notification in the corner,
consistent with macOS and Linux behavior.
- Uses native Toast API (no external dependencies like BurntToast)
- Non-blocking: notification auto-dismisses
- Graceful degradation: silently fails on older Windows versions
- Fix escaping for each platform (PowerShell: '' for quotes, AppleScript: backslash)
Implement cross-platform process cleanup handlers for LSP servers.
Added registerProcessCleanup() method to LSPServerManager that:
- Kills all spawned LSP server processes on process.exit
- Handles SIGINT (Ctrl+C) - all platforms
- Handles SIGTERM (kill signal) - Unix/macOS/Linux
- Handles SIGBREAK (Ctrl+Break) - Windows specific
This prevents LSP servers from becoming orphan processes when opencode terminates unexpectedly.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Use os.tmpdir() instead of hardcoded /tmp for cross-platform temp files
- Use os.homedir() with USERPROFILE fallback for Windows home directory
- Disable forceZsh on Windows (zsh not available by default)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Changed agent tools configuration from include pattern (listing allowed tools)
to exclude pattern (listing disabled tools only). This ensures MCP tools like
websearch_exa, context7, and grep_app are available to agents by default.
Affected agents: librarian, oracle, explore, multimodal-looker
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Remove call_omo_agent from blocked tools (only calls explore/librarian, safe)
- Keep task and background_task blocked to prevent recursion
- Add checkSessionTodos() to verify incomplete todos before marking tasks complete
- Update session.idle event handler to respect todo status
- Add polling check in task completion to wait for todo-continuation
🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
- Create README.ja.md with complete Japanese documentation
- Update language selector in README.md to include Japanese link
- Update language selector in README.ko.md to include Japanese link
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add pattern matching for 'content...is empty' format to detectErrorType function
in session-recovery hook. This fixes detection of Anthropic API errors like
'The content field in the Message object at messages.65 is empty'.
Previously only caught 'non-empty content' and 'must have non-empty content'
patterns, missing this actual API error format.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Block capture-pane, save-buffer, show-buffer, pipe-pane and their
aliases in interactive_bash tool. Guide users to use bash tool instead
for terminal output capture operations.
- Add BLOCKED_TMUX_SUBCOMMANDS list in constants.ts
- Add input validation in tools.ts to reject blocked commands
- Update tool description with blocked commands documentation
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add FallbackState interface to track message removal attempts
- Implement getLastMessagePair() to identify last user+assistant message pair
- Add executeRevertFallback() to remove message pairs when compaction fails
- Configure max 3 revert attempts with min 2 messages requirement
- Trigger fallback after 5 compaction retries exceed
- Reset retry counter on successful message removal for fresh compaction attempt
- Clean fallback state on session deletion
Resolves: When massive context (context bomb) is loaded, compaction fails and session becomes completely broken. Now falls back to emergency message removal after all retry attempts fail, allowing session recovery.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- librarian.ts: Add 'CRITICAL: DATE AWARENESS' section warning against 2024 searches
- librarian.ts: Update examples to use 2025 instead of 2024
- utils.ts: Add librarian agent to envContext receiver list alongside OmO
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Reorganized prompt into Phase 0/1/2 workflow for systematic request handling
- Introduced 4 request types (TYPE A/B/C/D) for proper classification
- Removed ASCII art diagrams to simplify documentation
- Reduced prompt from 330 to 232 lines while maintaining clarity
- Improved flow between context gathering and decision-making phases
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add Language Rule (MANDATORY) section in OmO Delegation_Rules
- Clarify that subagent prompts must always be in English
- Update background-task tool documentation with English requirement
- Update call-omo-agent tool documentation with English language rule
- LLMs perform significantly better with English prompts
- Improves consistency and performance across all agent-to-subagent communication
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Restrict background_task tool access for all spawned subagents (oracle, explore, librarian, frontend-ui-ux-engineer, document-writer, multimodal-looker) to prevent potential infinite recursion and unintended background task creation.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Implement getTmuxPath() utility to detect tmux availability at plugin load time
- Add getCachedTmuxPath() for retrieving cached tmux path
- Add startBackgroundCheck() for asynchronous tmux detection
- Conditionally register interactive_bash tool only when tmux is available
- Silently skip registration without error messages if tmux not found
- Export utilities from tools/interactive-bash/index.ts
Tool now gracefully handles systems without tmux installed.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add task: false to oracle agent's tools configuration to prevent the oracle agent from calling the task() tool, which could lead to recursive self-invocation.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- All subagents: disable background_task to prevent recursive spawning
- explore/librarian: additionally disable call_omo_agent
- Ensures task-invoked subagents use call_omo_agent instead of background_task
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Fixed bug where remindedSessions was only cleared on user messages. Now also
clears on assistant response, enabling the todo continuation reminder to be
re-triggered on the next idle period after the assistant provides a response.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add a new tool for managing tmux sessions with automatic tracking and cleanup:
- interactive_bash tool: Accepts tmux commands via tmux_command parameter
- Session tracking hook: Tracks omo-* prefixed tmux sessions per OpenCode session
- System reminder: Appends active session list after create/delete operations
- Auto cleanup: Kills all tracked tmux sessions on OpenCode session deletion
- Output truncation: Registered in TRUNCATABLE_TOOLS for long capture-pane outputs
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Tool names in builtinTools are lowercase ('grep', 'glob') but truncator
hooks were checking for capitalized names ('Grep', 'Glob'), causing
truncation to never trigger and resulting in context window overflow.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add user time and system context to OmO agent prompt to help the model
understand the temporal context of the conversation.
Injected context includes:
- Working directory
- Platform (darwin/linux/win32)
- Current date and time
- Timezone
- Locale
Closes#51🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Message hooks like todo-continuation-enforcer and background-notification
now preserve the agent mode from the previous message when sending follow-up
prompts. This ensures that continuation messages and task completion
notifications use the same agent that was active in the conversation.
- Export findNearestMessageWithFields and MESSAGE_STORAGE from hook-message-injector
- Add getMessageDir helper to locate session message directories
- Pass agent field to session.prompt in todo-continuation-enforcer
- Pass agent field to session.prompt in BackgroundManager.notifyParentSession
Closes#59🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
When OpenCode API doesn't return parts in message response,
read directly from filesystem using readParts(messageID).
This fixes session recovery failures where tool_use IDs couldn't
be extracted because API response had empty parts array.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Replace regex-based command blocking with environment configuration
- Add cross-platform null device support (NUL for Windows, /dev/null for Unix)
- Wrap all bash commands with non-interactive environment variables
- Only block TUI programs that require full PTY
- Update schema, README docs, and all imports/exports
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Instead of blocking commands via regex pattern matching (which caused false
positives like 'startup', 'support'), now wraps all bash commands with:
- CI=true
- DEBIAN_FRONTEND=noninteractive
- GIT_TERMINAL_PROMPT=0
- stdin redirected to /dev/null
TUI programs (text editors, system monitors, etc.) are still blocked as they
require full PTY. Other interactive commands now fail naturally when stdin
is unavailable.
Closes#55 via alternative approach.
- Prevent interactive bash commands from being executed automatically
- Block commands in tool.execute.before hook
- Register in schema and main plugin initialization
- Add findMessagesWithThinkingOnly() to detect orphan thinking messages
- Inject [user interrupted] placeholder for thinking-only messages
- Expand index offset handling from 2 to 3 attempts for better error recovery
- Use constant PLACEHOLDER_TEXT for consistency across recovery functions
- OmO: Primary orchestrator (Claude Opus 4.5)
- OmO-Plan: Inherits ALL settings from OpenCode's plan agent at runtime
- description appended with '(OhMyOpenCode version)'
- Configurable via oh-my-opencode.json agents.OmO-Plan
- build/plan: Demoted to subagent when OmO enabled
- Add plan and OmO-Plan to OverridableAgentNameSchema
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Set build agent's display name to 'OmO' (keeps builtIn: true priority)
- Add OmO as subagent (actual execution target when selected)
- Remove explicit tools list from OmO agent (inherit all)
- Rename omo_agent.disable_build to omo_agent.disabled
This hack works around OpenCode's agent selection by key name.
TODO: Use config.default_agent when PR #5313 is released.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
The documentation incorrectly stated that disable_build defaults to false,
but the actual code behavior defaults to true (Build agent hidden by default).
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add .catch() to notify-send command to prevent GDBus.Error logs
when org.freedesktop.Notifications service is unavailable in WSL environments.
Fixes#47🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add OmO agent description as the default agent
- Update librarian model from anthropic/claude-sonnet-4-5 to opencode/big-pickle
- Add omo_agent configuration section with disable_build option
- Update both English and Korean README files
- Add omo_agent to JSON schema
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add stripJsonComments() to handle // comments in opencode.json
- Add findPackageJsonUp() for robust package.json discovery
- Replace import.meta.dirname with fileURLToPath(import.meta.url) for ESM compatibility
- Fix version showing 'unknown' when config contains JSONC comments
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Adds a fun easter egg command that explains what Oh My OpenCode is about.
Shows project overview, features, and credits when invoked.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add getLocalDevPath() and getLocalDevVersion() functions
- Improve getCachedVersion() with fallback to bundled package.json
- Display correct version in startup toast for local dev mode
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add configurable build agent hiding (omo_agent.disable_build)
- Add startup-toast hook to show version on OpenCode startup
- Fix auto-update-checker to respect version pinning
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add findFileRecursive function using native Node.js fs API
- Remove glob package from dependencies
- Add unit tests for findFileRecursive
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Disable 'task' and 'call_omo_agent' tools in BackgroundManager
- Disable recursive background operation tools in call_omo_agent sync execution
- Prevents agents from spawning background tasks or calling themselves
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Enforce immediate output without questions
- Require actual diff analysis instead of commit message copying
- Unify output format across all change types
- Remove emojis from section headers
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Claude Code commands (user, project scope): sanitize model to undefined
- OpenCode commands (opencode, opencode-project scope): preserve model as-is
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Change model to anthropic/claude-haiku-4
- Fix local-version: use node -p instead of broken sed pattern
- Fix commits/diff: use xargs -I{} pipeline instead of subshell
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Disable 'task' and 'call_omo_agent' tools in BackgroundManager
- Disable recursive background operation tools in call_omo_agent sync execution
- Prevents agents from spawning background tasks or calling themselves
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Refactor grep-output-truncator into a general-purpose tool-output-truncator
that applies dynamic truncation to multiple tools based on context window usage.
Truncated tools:
- Grep, safe_grep (existing)
- Glob, safe_glob (new)
- lsp_find_references (new)
- lsp_document_symbols (new)
- lsp_workspace_symbols (new)
- lsp_diagnostics (new)
- ast_grep_search (new)
Uses the new dynamic-truncator utility from shared/ for context-aware
output size limits based on remaining context window tokens.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Extract and generalize dynamic output truncation logic from grep-output-truncator.
Provides context window-aware truncation that adapts based on remaining tokens.
Features:
- truncateToTokenLimit(): Sync truncation with configurable header preservation
- getContextWindowUsage(): Get current context window usage from session
- dynamicTruncate(): Async truncation that queries context window state
- createDynamicTruncator(): Factory for creating truncator instance
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Port ripgrep auto-installation feature from original OpenCode (sst/opencode).
When ripgrep is not available, automatically downloads and installs it from
GitHub releases.
Features:
- Platform detection (darwin/linux/win32, arm64/x64)
- Archive extraction (tar.gz/zip)
- Caches binary in ~/.cache/oh-my-opencode/bin/
- New resolveGrepCliWithAutoInstall() async function
- Falls back to grep if auto-install fails
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Fix background_output to check completion status before block flag
- Update call_omo_agent return message to correctly indicate block=false as default
- Add system notification guidance in return message
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
When an invalid or unregistered agent is passed to background_task or
call_omo_agent, OpenCode crashes with "TypeError: undefined is not an
object (evaluating 'agent.name')". This fix:
- Validates agent parameter is not empty before launching
- Catches prompt errors and returns friendly error message
- Notifies parent session when background task fails
- Improves error message to guide user on resolution
Fixes#37🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* docs: enhance README with hero image and GitHub badges
- Add hero.jpg and preview.png assets
- Add centered hero section with project visuals
- Add GitHub badges (release, contributors, forks, stars, issues, license)
- Add language toggle for English/Korean
* docs: make hero images clickable to main content section
Link hero and preview images to #oh-my-opencode anchor for quick navigation to the main documentation
- Add BUILD_AGENT_PROMPT_EXTENSION for orchestrator-focused main agent behavior
- Introduce OverridableAgentName type to allow build agent customization
- Update config schema to support build agent override in oh-my-opencode.json
- Inject orchestration prompt into build agent's system prompt
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Change TARGET_TOOLS and AGENT_TOOLS to Set<string> for O(1) lookup
- Normalize tool names to lowercase for case-insensitive comparison
- Remove unnecessary parentSessionID guard that blocked main session triggers
- Fixes issue where Glob/Grep tool calls weren't showing agent usage reminder
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Implements hook that tracks whether explore/librarian agents have been used in a session.
When target tools (Grep, Glob, WebFetch, context7, websearch_exa, grep_app) are called
without prior agent usage, appends reminder message recommending parallel background_task calls.
State persists across tool calls and resets on session compaction, allowing fresh reminders
after context compaction - similar to directory-readme-injector pattern.
Files:
- src/hooks/agent-usage-reminder/: New hook implementation
- types.ts: AgentUsageState interface
- constants.ts: TARGET_TOOLS, AGENT_TOOLS, REMINDER_MESSAGE
- storage.ts: File-based state persistence with compaction handling
- index.ts: Hook implementation with tool.execute.after and event handlers
- src/config/schema.ts: Add 'agent-usage-reminder' to HookNameSchema
- src/hooks/index.ts: Export createAgentUsageReminderHook
- src/index.ts: Instantiate and register hook handlers
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Remove always-zero tool call count from status display
- Show last tool only when available
- Add status-specific notes:
- running: remind no explicit wait needed (system notifies)
- error: indicate task failed, check last message
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Tag community contributors with @username in GitHub releases,
following opencode's publish.ts pattern.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
The agent was missing from AgentNameSchema and AgentOverridesSchema,
causing model overrides in oh-my-opencode.json to be silently dropped.
Co-authored-by: Amp <amp@ampcode.com>
- Add grep_app MCP configuration (https://mcp.grep.app)
- Update explore agent with grep_app usage guide:
- Always launch 5+ grep_app calls with query variations
- Always add 2+ other search tools for verification
- grep_app is fast but potentially outdated, use as starting point only
- Update README.md and README.ko.md with grep_app documentation
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Upgrade librarian agent to use claude-sonnet-4 instead of claude-haiku-4-5
for improved code search and documentation capabilities.
Closes#22🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add a new tool and agent for analyzing media files (PDFs, images, diagrams)
that require visual interpretation beyond raw text.
- Add `multimodal-looker` agent using Gemini 2.5 Flash model
- Add `look_at` tool that spawns multimodal-looker sessions
- Restrict multimodal-looker from calling task/call_omo_agent/look_at tools
Inspired by Sourcegraph Ampcode's look_at tool design.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Replace direct parts[idx].text modification with injectHookMessage
- Context now injected via filesystem (like UserPromptSubmitHook)
- Preserves original user message without modification
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Actually inject THINKING_CONFIGS into message (was defined but unused)
- Add maxTokens: 128000 for Anthropic (required for extended thinking)
- Add maxTokens: 64000 for Amazon Bedrock
- Track thinkingConfigInjected state
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
When "ultrawork" or "ulw" keyword is detected in user prompt:
- Injects ULTRAWORK_CONTEXT with agent-agnostic guidance
- Executes AFTER CC hooks (UserPromptSubmit etc.)
- Follows existing hook pattern (think-mode style)
Key features:
- Agent orchestration principles (by capability, not name)
- Parallel execution rules
- TODO tracking enforcement
- Delegation guidance
Closes#31🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add retry logic for 403 GCP permission errors (max 10 retries)
- Implement exponential backoff with 2s cap (200ms → 400ms → 800ms → 2000ms)
- Detect patterns: PERMISSION_DENIED, Cloud AI Companion API not enabled, etc.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Change warning to allow Google Auth setup (google_auth: true) by default
- Clarify that only model changes and feature disabling require explicit user request
- Add missing disabled_hooks documentation to README.ko.md
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add prompt field to BackgroundTask to store original prompt
- Add lastMessage/lastMessageAt to TaskProgress for real-time monitoring
- Extract last assistant message during polling
- Update formatTaskStatus() to display prompt (truncated 300 chars) and
last message (truncated 500 chars) with timestamp
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Allow users to individually disable built-in hooks via the
`disabled_hooks` configuration option in oh-my-opencode.json.
This addresses issue #28 where users requested the ability to
selectively disable hooks (e.g., comment-checker) that may
conflict with their workflow.
Available hooks:
- todo-continuation-enforcer
- context-window-monitor
- session-recovery
- comment-checker
- grep-output-truncator
- directory-agents-injector
- directory-readme-injector
- empty-task-response-detector
- think-mode
- anthropic-auto-compact
- rules-injector
- background-notification
- auto-update-checker
Closes#28
- Add Google Auth subsection to Configuration in README.md/README.ko.md
- Add google_auth and lsp options to oh-my-opencode.schema.json
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Fixes#30. OpenCode's plugin loader treats subpath exports like
"oh-my-opencode/google-auth" as separate npm packages, causing
BunInstallFailedError.
Solution: Enable Google auth via `google_auth: true` in
oh-my-opencode.json instead of a separate subpath plugin.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add isRetryableResponse() to detect SUBSCRIPTION_REQUIRED 403 errors for retry handling
- Remove JSDoc comments from isRetryableError() for clarity
- Add debug logging for request/response details (streaming flag, status, content-type)
- Refactor transformStreamingResponse() to use TransformStream for true streaming
- Replace buffering approach with incremental chunk processing
- Implement createSseTransformStream() for line-by-line transformation
- Reduces memory footprint and Time-To-First-Byte (TTFB)
- Update SSE content-type detection to include alt=sse URL parameter
- Simplify response transformation logic for non-streaming path
- Add more granular debug logging for thought signature extraction
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add message-converter.ts for OpenAI messages to Gemini contents conversion
- Use SKIP_THOUGHT_SIGNATURE_VALIDATOR as default signature (CLIProxyAPI approach)
- Restore loadCodeAssist API call to get user's actual project ID
- Improve debug logging for troubleshooting
- Fix tool normalization edge cases
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Try both targetIndex and targetIndex-1 to handle system message offset
- Remove 'last assistant message' skip logic (API error means it's not final)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add step-by-step instructions for Anthropic, Google Gemini (Antigravity OAuth),
and OpenAI (Codex Auth) authentication setup.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Checks npm registry for latest version on session.created, invalidates
cache and shows toast notification when update is available.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Change background_output default from block=true to block=false
- Add documentation about system auto-notification on task completion
- Clarify that block=false returns full status info, not empty
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Gemini 3 Pro requires thoughtSignature on function call blocks in
subsequent requests. This commit:
- Add thought-signature-store for session-based signature storage
- Extract signature from both streaming (SSE) and non-streaming responses
- Inject signature into functionCall parts on subsequent requests
- Maintain consistent sessionId per fetch instance
Debug logging available via ANTIGRAVITY_DEBUG=1
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Previously, token calculation accumulated ALL assistant messages' tokens,
causing incorrect usage display (e.g., 524.9%) after compaction.
Now uses only the last message's input tokens, which reflects the actual
current context window usage.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Separate Google Antigravity auth to 'oh-my-opencode/google-auth' subpath
- 'oh-my-opencode/auth' now exports OpenAI Codex auth plugin
- Implement dynamic port allocation to avoid port conflicts
- Add userAgent, requestId, sessionId fields for Antigravity API compatibility
- Add debug logging for troubleshooting (ANTIGRAVITY_DEBUG=1)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Pass-through path (non-string body) now preserves Authorization header.
This ensures authentication works even when request transformation is bypassed.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Handle both SDK response patterns: .data wrapper vs direct array
- Add null/empty message checks for robustness
- Improve type safety with explicit interface definitions
- Prevent errors when messages array is undefined
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Implement createGoogleAntigravityAuthPlugin factory function
- Add OAuth method with PKCE for Google authentication
- Create custom fetch interceptor loader for Antigravity API
- Update auth.ts to export Google Antigravity plugin as default
- Update barrel export in antigravity/index.ts
- Add Google Antigravity auth location to AGENTS.md
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Remove unused chat message notification handler
- Remove formatDuration and formatNotifications helpers
- Simplify to event-only handling
- Remove chat.message hook call from main plugin
Background task notifications now rely on event-based system only.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Rename src/codex-auth.ts → src/auth.ts
- Update package.json exports: ./codex-auth → ./auth
- Update build script to include auth.ts
Users can now use oh-my-opencode/auth as OpenAI auth plugin.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Previously only checked assistant messages for empty content.
Now checks all messages except the final assistant message,
following Anthropic API rules.
Fixes: "messages.N: all messages must have non-empty content" error
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Rename omo-task to call-omo-agent with mandatory run_in_background parameter
- Implement background mode using BackgroundManager (fire-and-forget abort)
- Implement sync mode with existing subagent logic
- Fix background_cancel: use fire-and-forget abort to prevent parent session interruption
- Add call_omo_agent to tool disable list in explore/librarian agents
- Add call_omo_agent to tool disable list in BackgroundManager
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Implements retry logic with up to 5 attempts when compaction fails.
Uses exponential backoff strategy (2s → 4s → 8s → 16s → 30s).
Shows toast notifications for retry status and final failure.
Prevents infinite loops by clearing state after max attempts.
🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
Background task tool이 child session을 생성할 때 background_task, background_output, background_cancel 도구를 자동으로 비활성화합니다. OpenCode Task tool 패턴과 동일하게 무한 재귀 호출을 방지합니다.
- manager.ts: promptAsync 호출 시 tools 설정 추가
- index.ts: 불필요한 agent 레벨 disable 설정 제거 (manager에서 처리)
- notification: tool calls 카운트 제거 (정확하게 트래킹되지 않음)
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Merge background_status into background_output with block parameter
- Replace background_result references with background_output throughout codebase
- Update tool descriptions to reflect new unified API
- Remove background-tasks.json (memory-based only)
- Simplify notification messages and tool usage instructions
session.prompt() fails due to response Zod validation.
promptAsync is fire-and-forget, no response parsing.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
TUI API sends to active session (could be subagent).
Use getMainSessionID() to explicitly target main session.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
session.prompt() fails with validation errors in background context.
Switch to TUI API which directly manipulates the main session input.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Previous implementation had too many defensive checks that blocked
normal cases. Simplified to: Toast -> 200ms delay -> session.prompt()
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Replace promptAsync() with session.prompt() for visible TUI updates
- Add main session check to skip subagent sessions
- Add session status idle check before sending prompt
- Add 200ms debounce with re-check to prevent race conditions
- Fallback to pending queue when session is busy
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Use `promptAsync` instead of `prompt` to avoid session state conflicts
- Use `tui.showToast` for immediate visible feedback
- Hack: Trigger `tui.submitPrompt` after message injection to force TUI refresh and trigger AI response
- Update `BackgroundManager` to accept `PluginInput` for directory access
prompt() waits for AI response, ensuring message is actually processed.
Added response logging to debug if message delivery works.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
promptAsync() doesn't show visible message to user.
Use tui.showToast() instead for immediate visible notification.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
session.get() doesn't return status field - it was always undefined.
Now using session.status() API which returns { type: 'idle' | 'busy' | 'retry' }
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Change prompt() to promptAsync() for parent session notification
- Only mark 404 errors as permanent task failure
- Add defensive progress initialization
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add notifyParentSession() to send message to parent session via prompt()
- Agent receives completion notification immediately, not waiting for next chat.message
- Includes task ID, description, duration, tool calls in notification
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Replace unreliable event-based tracking with 2-second polling
- Use SDK session.get() to detect completion (status === idle)
- Use SDK session.messages() to count tool_use parts for progress
- Auto-start polling on launch, auto-stop when no running tasks
- Resume polling on restore if running tasks exist
Fixes: Child session events not reaching plugin event handler
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Add comprehensive documentation about omo_task tool feature in both English and Korean READMEs.
- Document omo_task tool purpose: spawn explore/librarian as subagents
- Explain use case: agents can delegate specialized tasks to subagents
- Note recursion prevention: explore and librarian cannot use omo_task directly
- Add to Agents section under Tools for discoverability
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Register omo_task tool in main plugin and disable it for explore/librarian agents to prevent infinite recursion.
- Export createOmoTask from src/tools/index.ts
- Initialize omo_task in main plugin with ctx
- Spread omo_task into builtinTools export
- Add recursion prevention: disable omo_task tool for explore agent config
- Add recursion prevention: disable omo_task tool for librarian agent config
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Implement omo_task tool that allows main agents (oracle, frontend-ui-ux-engineer, etc.) to spawn explore or librarian as subagents.
- Add constants: ALLOWED_AGENTS, TASK_TOOL_DESCRIPTION_TEMPLATE
- Add types: AllowedAgentType, OmoTaskArgs, OmoTaskResult
- Implement createOmoTask function with session management
- Support both new session creation and existing session continuation
- Include proper error handling and logging
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Automatically disables these Claude Code hooks that duplicate oh-my-opencode functionality:
- inject_rules.py (replaced by rules-injector hook)
- inject_readme.py (replaced by directory-readme-injector hook)
- inject_knowledge.py (replaced by directory-agents-injector hook)
- remind*rules*.py (replaced by rules-injector hook)
Users can override via opencode-cc-plugin.json if needed.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add findMessageByIndexNeedingThinking for precise message targeting
- Detect "expected X found Y" error pattern for thinking block order
- Remove isLastMessage skip - recovery now handles final assistant messages
- Simplify orphan detection: any non-thinking first part is orphan
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* feat(agents): enhance librarian and explore prompts with parallel execution and evidence-based citations
Librarian agent enhancements:
- Add mandatory 5+ parallel tool execution requirement
- Add WebSearch integration for latest information
- Add repository cloning to /tmp for deep source analysis
- Require GitHub permalinks for all code citations
- Add evidence-based reasoning with specific code references
- Enhanced gh CLI usage with permalink construction
Explore agent enhancements:
- Add mandatory 3+ parallel tool execution requirement
- Extensive Git CLI integration for repository analysis
- Add git log, git blame, git diff commands for exploration
- Add parallel execution examples and best practices
* feat(agents): add LSP and AST-grep tools to librarian and explore prompts
Librarian agent:
- Added LSP tools section (lsp_hover, lsp_goto_definition, lsp_find_references, etc.)
- Added AST-grep section with pattern examples for structural code search
- Updated parallel execution examples to include LSP and AST-grep tools
- Added guidance on when to use AST-grep vs Grep vs LSP
Explore agent:
- Added LSP tools section for semantic code analysis
- Added AST-grep section with examples for TypeScript/React patterns
- Updated parallel execution examples to include 6 tools
- Added tool selection guidance for LSP and AST-grep
* fix(agents): remove explore agent references from librarian prompt
Subagents cannot call other agents, so replaced all Explore agent
references with direct tool usage (Glob, Grep, ast_grep_search).
---------
Co-authored-by: Claude <noreply@anthropic.com>
- Add Zod schema validation following Anthropic Agent Skills Spec v1.0
- Include basePath in skill output for path resolution
- Simplify tool description and output format
- Add validation error logging for invalid skills
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Implements README.md injection similar to existing AGENTS.md injector.
Automatically injects README.md contents when reading files, searching
upward from file directory to project root.
Closes#14🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Enables automatic session summarization when Anthropic token limits are exceeded.
The hook detects token limit errors and triggers compact operation on session idle.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Replace blocking await with non-blocking timer scheduling to handle race
condition between session.idle and session.error events. When ESC abort
occurs, session.error immediately cancels the pending timer, preventing
unwanted continuation prompts.
Changes:
- Add pendingTimers Map to track scheduled continuation checks
- Cancel timer on session.error (especially abort cases)
- Cancel timer on message.updated and session.deleted for cleanup
- Reduce delay to 200ms for faster response
- Maintain existing Set-based flag logic for compatibility
This fixes the issue where ESC abort would not prevent continuation
prompts due to event ordering (idle before error)
- Extract message index from Anthropic error messages (messages.N format)
- Sort messages by time.created instead of id for accurate ordering
- Remove last message skip logic that prevented recovery
- Prioritize recovery targets: index-matched > failedMsg > all empty
- Add error logging for debugging recovery failures
Fixes issue where 'messages.83: all messages must have non-empty content' errors were not being recovered properly due to incorrect message ordering and overly restrictive filtering.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Replace multiple Set-based tracking with explicit SessionStatus state machine
- Implement setTimeout+clearTimeout pattern for robust race condition handling
- SessionStatus tracks: idle → continuation-sent or aborted states
- Increase grace period to 500ms to accommodate event ordering delays
- Add cleanupSession utility for proper resource cleanup
This addresses ESC abort not canceling continuation prompts when session.idle
arrives before session.error event, which can occur due to async event processing
in OpenCode plugin system
100% port verification via Oracle agent parallel checks:
- PreToolUse: recordToolUse(), isHookDisabled(), Object.assign(), error message
- PostToolUse: recordToolResult(), isHookDisabled(), permissionMode, title field
- Stop: isHookDisabled(), parentSessionId, error/interrupt state tracking
- UserPromptSubmit: interrupt checks, recordUserMessage(), log messages
All four hooks now match opencode-cc-plugin/src/plugin/*.ts exactly.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add chat.message handler to createClaudeCodeHooksHook factory
- Integrate executeUserPromptSubmitHooks() for user prompt processing
- Use injectHookMessage() for file system based message injection
- Add sessionFirstMessageProcessed tracking for title generation skip
- Register chat.message hook in plugin entry point
This completes 100% port of Claude Code hooks from opencode-cc-plugin.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Port post-tool-use.ts from opencode-cc-plugin (200 lines)
- Implement executePostToolUseHooks() with full transcript support
- Include temp file cleanup in finally block
- Preserve all exit code handling and output fields
- Update notepad.md with Task 5 completion log
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add snake-case.ts: objectToSnakeCase, objectToCamelCase utilities
- Add tool-name.ts: transformToolName with PascalCase conversion
- Add pattern-matcher.ts: findMatchingHooks for hook config matching
- Add hook-disabled.ts: isHookDisabled for hook config validation
- Add temporary stub types at src/hooks/claude-code-hooks/types.ts
- Export all new utilities from src/shared/index.ts
Stub types will be replaced with full implementation in Task 1.
Import paths adjusted from opencode-cc-plugin structure to oh-my-opencode.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add loadCommands() and loadSkills() to config
- Register think-mode hook for UserPromptSubmit event
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Provides 'skill' tool that invokes skills loaded by skill-loader.
Skills expand into detailed instructions when invoked.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Provides 'slashcommand' tool that executes commands loaded by command-loader.
Handles shell injection and file reference resolution.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Added directory tree example showing how multiple AGENTS.md files are
collected and injected in hierarchical order when reading nested files.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Added directory tree example showing how multiple AGENTS.md files are
collected and injected in hierarchical order when reading nested files.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Tools can take arbitrary time, so we need a fresh baseline after execution.
Previously, lastHeartbeat wasn't updated after tool.execute.after, causing
stalled detection to trigger immediately after long-running tools.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
Remove forced monitoring restart in tool.execute.after to avoid false positive
stalled session detection when LLM legitimately completes response after tool run.
Monitoring now resumes naturally on next session/message event.
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
- Add directoryAgentsInjector to plugin event handlers
- Wire up tool.execute.after hook for directory agents injection
- Fix: Format src/index.ts with consistent semicolon style
- Scan all non-final assistant messages for empty content, orphan thinking blocks, and disabled thinking
- Add storage utility functions: findMessagesWithThinkingBlocks, findMessagesWithOrphanThinking, stripThinkingParts, prependThinkingPart
- Fix: Previously only processed single failed message, now handles multiple broken messages in history
- Improve: Use filesystem-based recovery instead of unreliable SDK APIs
- Override OpenCode's built-in glob with 60s timeout
- Kill process on expiration to prevent indefinite hanging
- Reuse grep's CLI resolver for ripgrep detection
Generated by [OpenCode](https://opencode.ai/)
Split session-recovery.ts into modular structure:
- types.ts: SDK-aligned type definitions
- constants.ts: storage paths and part type sets
- storage.ts: reusable read/write operations
- index.ts: main recovery hook logic
OpenCode storage uses 'tool' type for tool calls, but the hasContent
check only recognized 'tool_use' (Anthropic API format). This caused
messages with tool calls to be incorrectly identified as empty.
Previously, findEmptyContentMessageFromStorage only detected messages
with parts.length > 0 that had no content. This missed the case where
a message has zero parts entirely, causing infinite recovery loops.
- Add diagnosticsStore to capture Push model notifications
- Handle textDocument/publishDiagnostics notifications in processBuffer
- Fix workspace/configuration response for JSON LSP validation
- Add missing language mappings (json, html, css, sh, fish, md, tf)
- diagnostics() now tries Pull first, falls back to Push store
- Replace API-based recovery with direct JSON file editing for empty content messages
- Add cross-platform storage path support via xdg-basedir (Linux/macOS/Windows)
- Inject '(interrupted)' text part to fix messages with only thinking/meta blocks
- Update README docs with detailed session recovery scenarios
- Check file size >10KB to filter out placeholder files
- Check cached binary first
- Then npm package paths with validation
- Homebrew paths as last resort
- Fixes SIGTRAP/ENOEXEC from invalid binaries
- Remove hardcoded homebrew paths
- Remove npm package path resolution (prone to placeholder issues)
- Only check cached binary (~/.cache/oh-my-opencode/bin/sg)
- If not found, cli.ts will auto-download from GitHub releases
The download logic in cli.ts handles all cases properly.
- Add isValidBinary() check: file must be >10KB (placeholder files are ~100 bytes)
- Check homebrew paths first on macOS (most reliable)
- Check cached binary second
- npm package paths last (prone to placeholder issues)
Fixes ENOEXEC error when @ast-grep/cli has placeholder instead of real binary
description:Report a bug or unexpected behavior in oh-my-opencode
title:"[Bug]: "
labels:["bug","needs-triage"]
body:
- type:markdown
attributes:
value:|
**Please write your issue in English.** See our [Language Policy](https://github.com/code-yeongyu/oh-my-opencode/blob/dev/CONTRIBUTING.md#language-policy) for details.
- type:checkboxes
id:prerequisites
attributes:
label:Prerequisites
description:Please confirm the following before submitting
options:
- label:I will write this issue in English (see our [Language Policy](https://github.com/code-yeongyu/oh-my-opencode/blob/dev/CONTRIBUTING.md#language-policy))
required:true
- label:I have searched existing issues to avoid duplicates
required:true
- label:I am using the latest version of oh-my-opencode
required:true
- label:I have read the [documentation](https://github.com/code-yeongyu/oh-my-opencode#readme) or asked an AI coding agent with this project's GitHub URL loaded and couldn't find the answer
required:true
- type:textarea
id:description
attributes:
label:Bug Description
description:A clear and concise description of what the bug is
placeholder:Describe the bug in detail...
validations:
required:true
- type:textarea
id:reproduction
attributes:
label:Steps to Reproduce
description:Steps to reproduce the behavior
placeholder:|
1. Configure oh-my-opencode with...
2. Run command '...'
3. See error...
validations:
required:true
- type:textarea
id:expected
attributes:
label:Expected Behavior
description:What did you expect to happen?
placeholder:Describe what should happen...
validations:
required:true
- type:textarea
id:actual
attributes:
label:Actual Behavior
description:What actually happened?
placeholder:Describe what actually happened...
validations:
required:true
- type:textarea
id:doctor
attributes:
label:Doctor Output
description:|
**Required:** Run `bunx oh-my-opencode doctor` and paste the full output below.
This helps us diagnose your environment and configuration.
placeholder:|
Paste the output of: bunx oh-my-opencode doctor
Example:
✓ OpenCode version: 1.0.150
✓ oh-my-opencode version: 1.2.3
✓ Plugin loaded successfully
...
render:shell
validations:
required:true
- type:textarea
id:logs
attributes:
label:Error Logs
description:If applicable, add any error messages or logs
placeholder:Paste error logs here...
render:shell
- type:textarea
id:config
attributes:
label:Configuration
description:If relevant, share your oh-my-opencode configuration (remove sensitive data)
placeholder:|
{
"agents": { ... },
"disabled_hooks": [ ... ]
}
render:json
- type:textarea
id:context
attributes:
label:Additional Context
description:Any other context about the problem
placeholder:Add any other context, screenshots, or information...
- type:dropdown
id:os
attributes:
label:Operating System
description:Which operating system are you using?
options:
- macOS
- Linux
- Windows
- Other
validations:
required:true
- type:input
id:opencode-version
attributes:
label:OpenCode Version
description:Run `opencode --version` to get your version
description:Suggest a new feature or enhancement for oh-my-opencode
title:"[Feature]: "
labels:["enhancement","needs-triage"]
body:
- type:markdown
attributes:
value:|
**Please write your issue in English.** See our [Language Policy](https://github.com/code-yeongyu/oh-my-opencode/blob/dev/CONTRIBUTING.md#language-policy) for details.
- type:checkboxes
id:prerequisites
attributes:
label:Prerequisites
description:Please confirm the following before submitting
options:
- label:I will write this issue in English (see our [Language Policy](https://github.com/code-yeongyu/oh-my-opencode/blob/dev/CONTRIBUTING.md#language-policy))
required:true
- label:I have searched existing issues and discussions to avoid duplicates
required:true
- label:This feature request is specific to oh-my-opencode (not OpenCode core)
required:true
- label:I have read the [documentation](https://github.com/code-yeongyu/oh-my-opencode#readme) or asked an AI coding agent with this project's GitHub URL loaded and couldn't find the answer
required:true
- type:textarea
id:problem
attributes:
label:Problem Description
description:What problem does this feature solve? What's the use case?
placeholder:|
Describe the problem or limitation you're experiencing...
Example: "As a user, I find it difficult to..."
validations:
required:true
- type:textarea
id:solution
attributes:
label:Proposed Solution
description:Describe how you'd like this feature to work
placeholder:|
Describe your proposed solution in detail...
Example: "Add a new hook that..."
validations:
required:true
- type:textarea
id:alternatives
attributes:
label:Alternatives Considered
description:Have you considered any alternative solutions or workarounds?
placeholder:|
Describe any alternative solutions you've considered...
Example: "I tried using X but it didn't work because..."
- type:textarea
id:doctor
attributes:
label:Doctor Output (Optional)
description:|
If relevant to your feature request, run `bunx oh-my-opencode doctor` and paste the output.
This helps us understand your environment.
placeholder:|
Paste the output of: bunx oh-my-opencode doctor
(Optional for feature requests)
render:shell
- type:textarea
id:context
attributes:
label:Additional Context
description:Any other context, mockups, or examples
placeholder:|
Add any other context, screenshots, code examples, or links...
Examples from other tools/projects are helpful!
- type:dropdown
id:feature-type
attributes:
label:Feature Type
description:What type of feature is this?
options:
- New Agent
- New Hook
- New Tool
- New MCP Integration
- Configuration Option
- Documentation
- Other
validations:
required:true
- type:checkboxes
id:contribution
attributes:
label:Contribution
description:Are you willing to contribute to this feature?
options:
- label:I'm willing to submit a PR for this feature
description:Ask a question or start a discussion about oh-my-opencode
title:"[Question]: "
labels:["question","needs-triage"]
body:
- type:markdown
attributes:
value:|
**Please write your issue in English.** See our [Language Policy](https://github.com/code-yeongyu/oh-my-opencode/blob/dev/CONTRIBUTING.md#language-policy) for details.
- type:checkboxes
id:prerequisites
attributes:
label:Prerequisites
description:Please confirm the following before submitting
options:
- label:I will write this issue in English (see our [Language Policy](https://github.com/code-yeongyu/oh-my-opencode/blob/dev/CONTRIBUTING.md#language-policy))
required:true
- label:I have searched existing issues and discussions
required:true
- label:I have read the [documentation](https://github.com/code-yeongyu/oh-my-opencode#readme) or asked an AI coding agent with this project's GitHub URL loaded and couldn't find the answer
required:true
- label:This is a question (not a bug report or feature request)
required:true
- type:textarea
id:question
attributes:
label:Question
description:What would you like to know or discuss?
placeholder:|
Ask your question in detail...
Examples:
- How do I configure agent X to do Y?
- What's the best practice for Z?
- Why does feature A work differently than B?
validations:
required:true
- type:textarea
id:context
attributes:
label:Context
description:Provide any relevant context or background
placeholder:|
What have you tried so far?
What's your use case?
Any relevant configuration or setup details?
- type:textarea
id:doctor
attributes:
label:Doctor Output (Optional)
description:|
If your question is about configuration or setup, run `bunx oh-my-opencode doctor` and paste the output.
placeholder:|
Paste the output of: bunx oh-my-opencode doctor
(Optional for questions)
render:shell
- type:dropdown
id:category
attributes:
label:Question Category
description:What is your question about?
options:
- Configuration
- Agent Usage
- Hook Behavior
- Tool Usage
- Installation/Setup
- Best Practices
- Performance
- Integration
- Other
validations:
required:true
- type:textarea
id:additional
attributes:
label:Additional Information
description:Any other information that might be helpful
if:(github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
Thank you for your contribution! Before we can merge this PR, we need you to sign our [Contributor License Agreement (CLA)](https://github.com/code-yeongyu/oh-my-opencode/blob/master/CLA.md).
**To sign the CLA**, please comment on this PR with:
```
I have read the CLA Document and I hereby sign the CLA
```
This is a one-time requirement. Once signed, all your future contributions will be automatically accepted.
custom-pr-sign-comment:'I have read the CLA Document and I hereby sign the CLA'
custom-allsigned-prcomment:|
All contributors have signed the CLA. Thank you! ✅
for platform in darwin-arm64 darwin-x64 darwin-x64-baseline linux-x64 linux-x64-baseline linux-arm64 linux-x64-musl linux-x64-musl-baseline linux-arm64-musl windows-x64 windows-x64-baseline; do
jq --arg v "$VERSION" '.version = $v' "packages/${platform}/package.json" > tmp.json
for platform in darwin-arm64 darwin-x64 darwin-x64-baseline linux-x64 linux-x64-baseline linux-arm64 linux-x64-musl linux-x64-musl-baseline linux-arm64-musl windows-x64 windows-x64-baseline; do
jq --arg v "$VERSION" '.version = $v' "packages/${platform}/package.json" > tmp.json
[CODE RED] Maximum precision required. Ultrathink before acting.
YOU MUST LEVERAGE ALL AVAILABLE AGENTS TO THEIR FULLEST POTENTIAL.
TELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.
## AGENT UTILIZATION PRINCIPLES (by capability, not by name)
- **Codebase Exploration**: Spawn exploration agents using BACKGROUND TASKS for file patterns, internal implementations, project structure
- **Documentation & References**: Use librarian-type agents via BACKGROUND TASKS for API references, examples, external library docs
- **Planning & Strategy**: For implementation tasks, spawn a dedicated planning agent for work breakdown (not needed for simple questions/investigations)
- **Frontend/UI Tasks**: Delegate to UI-specialized agents for design and implementation
## EXECUTION RULES
- **TODO**: Track EVERY step. Mark complete IMMEDIATELY after each.
- **PARALLEL**: Fire independent agent calls simultaneously via background_task - NEVER wait sequentially.
- **BACKGROUND FIRST**: Use background_task for exploration/research agents (10+ concurrent if needed).
- **VERIFY**: Re-read request after completion. Check ALL requirements met before reporting done.
- **DELEGATE**: Don't do everything yourself - orchestrate specialized agents for their strengths.
## WORKFLOW
1. Analyze the request and identify required capabilities
2. Spawn exploration/librarian agents via background_task in PARALLEL (10+ if needed)
3. Always Use Plan agent with gathered context to create detailed work breakdown
4. Execute with continuous verification against original requirements
## TDD (if test infrastructure exists)
1. Write spec (requirements)
2. Write tests (failing)
3. RED: tests fail
4. Implement minimal code
5. GREEN: tests pass
6. Refactor if needed (must stay green)
7. Next feature, repeat
## ZERO TOLERANCE FAILURES
- **NO Scope Reduction**: Never make "demo", "skeleton", "simplified", "basic" versions - deliver FULL implementation
- **NO MockUp Work**: When user asked you to do "port A", you must "port A", fully, 100%. No Extra feature, No reduced feature, no mock data, fully working 100% port.
- **NO Partial Completion**: Never stop at 60-80% saying "you can extend this..." - finish 100%
- **NO Assumed Shortcuts**: Never skip requirements you deem "optional" or "can be added later"
- **NO Premature Stopping**: Never declare done until ALL TODOs are completed and verified
- **NO TEST DELETION**: Never delete or skip failing tests to make the build pass. Fix the code, not the tests.
THE USER ASKED FOR X. DELIVER EXACTLY X. NOT A SUBSET. NOT A DEMO. NOT A STARTING POINT.
- **PRs**: Use ALL THREE commands to get COMPLETE context:
```bash
gh pr view NUMBER_PLACEHOLDER --comments
gh api repos/REPO_PLACEHOLDER/pulls/NUMBER_PLACEHOLDER/comments
gh api repos/REPO_PLACEHOLDER/pulls/NUMBER_PLACEHOLDER/reviews
```
**WHAT TO EXTRACT FROM THE CONVERSATION:**
- The ORIGINAL issue/PR description (first message) - this is often the TRUE requirement
- ALL previous attempts and their outcomes
- ALL decisions made and their reasoning
- ALL feedback, criticism, and rejection reasons
- ANY linked issues, PRs, or external references
- The EXACT ask from the user who mentioned you
**FAILURE TO READ EVERYTHING = GUARANTEED FAILURE**
You WILL make wrong assumptions. You WILL repeat past mistakes. You WILL miss critical context.
2. **CREATE TODOS IMMEDIATELY**: Right after reading, create your todo list using todo tools.
- First todo: "Summarize issue/PR context and requirements"
- Break down ALL work into atomic, verifiable steps
- **GIT WORKFLOW (MANDATORY for implementation tasks)**: ALWAYS include these final todos:
- "Create new branch from origin/BRANCH_PLACEHOLDER (NEVER push directly to BRANCH_PLACEHOLDER)"
- "Commit changes"
- "Create PR to BRANCH_PLACEHOLDER branch"
- Plan everything BEFORE starting any work
---
Plan everything using todo tools.
Then investigate and satisfy the request. Only if user requested to you to work explicitly, then use plan agent to plan, todo obsessively then create a PR to `BRANCH_PLACEHOLDER` branch.
When done, report the result to the issue/PR with `gh issue comment NUMBER_PLACEHOLDER` or `gh pr comment NUMBER_PLACEHOLDER`.
> You do NOT need to write any of this. It's handled.
>
> **For a patch release**, this is usually sufficient on its own. However, if there are notable bug fixes or changes worth highlighting, an enhanced summary can be added.
> **For a minor/major release**, an enhanced summary is **required** — I'll draft one in the next step.
Wait for the user to acknowledge before proceeding.
</agent-instruction>
---
## STEP 6: DRAFT ENHANCED RELEASE SUMMARY
<decision-gate>
| Release Type | Action |
|-------------|--------|
| **patch** | ASK the user: "Would you like me to draft an enhanced summary highlighting the key bug fixes / changes? Or is the auto-generated changelog sufficient?" If user declines → skip to Step 8. If user accepts → draft a concise bug-fix / change summary below. |
| **minor** | MANDATORY. Draft a concise feature summary. Do NOT proceed without one. |
| **major** | MANDATORY. Draft a full release narrative with migration notes if applicable. Do NOT proceed without one. |
</decision-gate>
### What You're Writing (and What You're NOT)
You are writing the **headline layer** — a product announcement that sits ABOVE the auto-generated commit log. Think "release blog post", not "git log".
<rules>
- NEVER duplicate commit messages. The auto-generated section already lists every commit.
- NEVER write generic filler like "Various bug fixes and improvements" or "Several enhancements".
- ALWAYS focus on USER IMPACT: what can users DO now that they couldn't before?
- ALWAYS group by THEME or CAPABILITY, not by commit type (feat/fix/refactor).
- ALWAYS use concrete language: "You can now do X" not "Added X feature".
</rules>
<examples>
<bad title="Commit regurgitation — DO NOT do this">
## What's New
- feat(auth): add JWT refresh token rotation
- fix(auth): handle expired token edge case
- refactor(auth): extract middleware
</bad>
<good title="User-impact narrative — DO this">
## 🔐 Smarter Authentication
Token refresh is now automatic and seamless. Sessions no longer expire mid-task — the system silently rotates credentials in the background. If you've been frustrated by random logouts, this release fixes that.
</good>
<bad title="Vague filler — DO NOT do this">
## Improvements
- Various performance improvements
- Bug fixes and stability enhancements
</bad>
<good title="Specific and measurable — DO this">
## ⚡ 3x Faster Rule Parsing
Rules are now cached by file modification time. If your project has 50+ rule files, you'll notice startup is noticeably faster — we measured a 3x improvement in our test suite.
</good>
</examples>
### Drafting Process
1.**Analyze** the commit list from Step 5's preview. Identify 2-5 themes that matter to users.
2.**Write** the summary to `/tmp/release-summary-v${NEW_VERSION}.md`.
3.**Present** the draft to the user for review and approval before applying.
> "Here's the release summary I drafted. This will appear AT THE TOP of the release notes, above the auto-generated commit changelog and contributor thanks. Want me to adjust anything before applying?"
Do NOT proceed to Step 7 without user confirmation.
</agent-instruction>
---
## STEP 7: APPLY ENHANCED SUMMARY TO RELEASE
**Skip this step ONLY if the user opted out of the enhanced summary in Step 6** — proceed directly to Step 8.
<architecture>
The final release note structure:
```
┌─────────────────────────────────────┐
│ Enhanced Summary (from Step 6) │ ← You wrote this
│ - Theme-based, user-impact focused │
├─────────────────────────────────────┤
│ --- (separator) │
├─────────────────────────────────────┤
│ Auto-generated Commit Changelog │ ← Workflow wrote this
│ - feat/fix/refactor grouped │
│ - Contributor thank-you messages │
└─────────────────────────────────────┘
```
</architecture>
<zero-content-loss-policy>
- Fetch the existing release body FIRST
- PREPEND your summary above it
- The existing auto-generated content must remain 100% INTACT
- NOT A SINGLE CHARACTER of existing content may be removed or modified
</zero-content-loss-policy>
```bash
# 1. Fetch existing auto-generated body
EXISTING_BODY=$(gh release view "v${NEW_VERSION}" --json body --jq '.body')
# 2. Combine: enhanced summary on top, auto-generated below
description: Remove unused code from this project with ultrawork mode, LSP-verified safety, atomic commits
---
<command-instruction>
Dead code removal via massively parallel deep agents. You are the ORCHESTRATOR — you scan, verify, batch, then delegate ALL removals to parallel agents.
<rules>
- **LSP is law.** Verify with `LspFindReferences(includeDeclaration=false)` before ANY removal decision.
prompt="Find files in src/ NOT imported by any other file. Check all import statements. EXCLUDE: index.ts, *.test.ts, entry points, .md, packages/. Return: file paths.")
prompt="Find exported functions/types/constants in src/ that are never imported by other files. Cross-reference: for each export, grep the symbol name across src/ — if it only appears in its own file, it's a candidate. EXCLUDE: src/index.ts exports, test files. Return: file path, line, symbol name, export type.")
Files in the same directory CAN be batched together (they won't conflict as long as no two agents edit the same file). Maximize batch count for parallelism.
description: "Read-only GitHub triage for issues AND PRs. 1 item = 1 background task (category: quick). Analyzes all open items and writes evidence-backed reports to /tmp/{datetime}/. Every claim requires a GitHub permalink as proof. NEVER takes any action on GitHub - no comments, no merges, no closes, no labels. Reports only. Triggers: 'triage', 'triage issues', 'triage PRs', 'github triage'."
---
# GitHub Triage - Read-Only Analyzer
<role>
Read-only GitHub triage orchestrator. Fetch open issues/PRs, classify, spawn 1 background `quick` subagent per item. Each subagent analyzes and writes a report file. ZERO GitHub mutations.
Pass `REPO`, `REPORT_DIR`, and `COMMIT_SHA` to every subagent.
---
---
## Phase 1: Fetch All Open Items (CORRECTED)
**IMPORTANT:**`body` and `comments` fields may contain control characters that break jq parsing. Fetch basic metadata first, then fetch full details per-item in subagents.
description: "Nuclear-grade 16-agent pre-publish release gate. Runs /get-unpublished-changes to detect all changes since last npm release, spawns up to 10 ultrabrain agents for deep per-change analysis, invokes /review-work (5 agents) for holistic review, and 1 oracle for overall release synthesis. Use before EVERY npm publish. Triggers: 'pre-publish review', 'review before publish', 'release review', 'pre-release review', 'ready to publish?', 'can I publish?', 'pre-publish', 'safe to publish', 'publishing review', 'pre-publish check'."
---
# Pre-Publish Review — 16-Agent Release Gate
Three-layer review before publishing to npm. Every layer covers a different angle — together they catch what no single reviewer could.
| Layer | Agents | Type | What They Check |
|-------|--------|------|-----------------|
| Per-Change Deep Dive | up to 10 | ultrabrain | Each logical change group individually — correctness, edge cases, pattern adherence |
{GROUP_COMMITS — hash and message for each commit in this group}
</commits>
<changed_files>
{GROUP_FILES — files changed in this group}
</changed_files>
<diff>
{GROUP_DIFF — only the diff for this group's files}
</diff>
<file_contents>
{Read and include full content of each changed file in this group}
</file_contents>
You are reviewing a specific subset of changes heading into an npm release. Focus exclusively on THIS change group. Other groups are reviewed by parallel agents.
ANALYSIS CHECKLIST:
1. **Intent Clarity**: What is this change trying to do? Is the intent clear from the code and commit messages? If you have to guess, that's a finding.
2. **Correctness**: Trace through the logic for 3+ scenarios. Does the code actually do what it claims? Off-by-one errors, null handling, async edge cases, resource cleanup.
3. **Breaking Changes**: Does this change alter any public API, config format, CLI behavior, or hook contract? If yes, is it backward compatible? Would existing users be surprised?
4. **Pattern Adherence**: Does the new code follow the established patterns visible in the existing file contents? New patterns where old ones exist = finding.
5. **Edge Cases**: What inputs or conditions would break this? Empty arrays, undefined values, concurrent calls, very large inputs, missing config fields.
6. **Error Handling**: Are errors properly caught and propagated? No empty catch blocks? No swallowed promises?
7. **Type Safety**: Any `as any`, `@ts-ignore`, `@ts-expect-error`? Loose typing where strict is possible?
8. **Test Coverage**: Are the behavioral changes covered by tests? Are the tests meaningful or just coverage padding?
9. **Side Effects**: Could this change break something in a different module? Check imports and exports — who depends on what changed?
10. **Release Risk**: On a scale of SAFE / CAUTION / RISKY — how confident are you this change won't cause issues in production?
OUTPUT FORMAT:
<group_name>{GROUP_NAME}</group_name>
<verdict>PASS or FAIL</verdict>
<risk>SAFE / CAUTION / RISKY</risk>
<summary>2-3 sentence assessment of this change group</summary>
<has_breaking_changes>YES or NO</has_breaking_changes>
<breaking_change_details>If YES, describe what breaks and for whom</breaking_change_details>
<findings>
For each finding:
- [CRITICAL/MAJOR/MINOR] Category: Description
- File: path (line range)
- Evidence: specific code reference
- Suggestion: how to fix
</findings>
<blocking_issues>Issues that MUST be fixed before publish. Empty if PASS.</blocking_issues>
""")
```
### Layer 2: Holistic Review via /review-work (5 agents)
Spawn a sub-agent that loads the `/review-work` skill. The review-work skill internally launches 5 parallel agents: Oracle (goal verification), unspecified-high (QA execution), Oracle (code quality), Oracle (security), unspecified-high (context mining). All 5 must pass for the review to pass.
```
task(
category="unspecified-high",
run_in_background=true,
load_skills=["review-work"],
description="Run /review-work on all unpublished changes",
prompt="""
Run /review-work on the unpublished changes between v{PUBLISHED} and HEAD.
GOAL: Review all changes heading into npm publish of oh-my-opencode. These changes span {COMMIT_COUNT} commits across {FILE_COUNT} files.
CONSTRAINTS:
- This is a plugin published to npm — public API stability matters
- TypeScript strict mode, Bun runtime
- No `as any`, `@ts-ignore`, `@ts-expect-error`
- Factory pattern (createXXX) for tools, hooks, agents
- kebab-case files, barrel exports, no catch-all files
BACKGROUND: Pre-publish review of oh-my-opencode, an OpenCode plugin with 1268 TypeScript files, 160k LOC. Changes since v{PUBLISHED} are about to be published.
The diff base is: git diff v{PUBLISHED}..HEAD
Follow the /review-work skill flow exactly — launch all 5 review agents and collect results. Do NOT skip any of the 5 agents.
""")
```
### Layer 3: Oracle Release Synthesis (1 agent)
The oracle gets the full picture — all commits, full diff stat, and changed file list. It provides the final release readiness assessment.
```
task(
subagent_type="oracle",
run_in_background=true,
load_skills=[],
description="Oracle: overall release synthesis and version bump recommendation",
{CHANGED_FILES — full list of modified file paths}
</changed_files>
<full_diff>
{FULL_DIFF — the complete git diff between published version and HEAD}
</full_diff>
<file_contents>
{Read and include full content of KEY changed files — focus on public API surfaces, config schemas, agent definitions, hook registrations, tool registrations}
</file_contents>
You are the final gate before an npm publish. 10 ultrabrain agents are reviewing individual changes and 5 review-work agents are doing holistic review. Your job is the bird's-eye view that those focused reviews might miss.
SYNTHESIS CHECKLIST:
1. **Release Coherence**: Do these changes tell a coherent story? Or is this a grab-bag of unrelated changes that should be split into multiple releases?
2. **Version Bump**: Based on semver:
- PATCH: Bug fixes only, no behavior changes
- MINOR: New features, backward-compatible changes
- MAJOR: Breaking changes to public API, config format, or behavior
Recommend the correct bump with specific justification.
3. **Breaking Changes Audit**: Exhaustively list every change that could break existing users. Check:
"prompt":"I need to add a `max_background_agents` config option to oh-my-opencode that limits how many background agents can run simultaneously. It should be in the plugin config schema with a default of 5. Add validation and make sure the background manager respects it. Create a PR for this.",
"expected_output":"Agent creates worktree, implements config option with schema validation, adds tests, creates PR, iterates through verification gates until merged",
"files":[],
"assertions":[
{"id":"worktree-isolation","text":"Plan uses git worktree in a sibling directory (not main working directory)"},
{"id":"branch-from-dev","text":"Branch is created from origin/dev (not master/main)"},
{"id":"atomic-commits","text":"Plan specifies multiple atomic commits for multi-file changes"},
{"id":"local-validation","text":"Runs bun run typecheck, bun test, and bun run build before pushing"},
{"id":"pr-targets-dev","text":"PR is created targeting dev branch (not master)"},
{"id":"three-gates","text":"Verification loop includes all 3 gates: CI, review-work, and Cubic"},
{"id":"gate-ordering","text":"Gates are checked in order: CI first, then review-work, then Cubic"},
{"id":"cubic-check-method","text":"Cubic check uses gh api to check cubic-dev-ai[bot] reviews for 'No issues found'"},
{"id":"worktree-cleanup","text":"Plan includes worktree cleanup after merge"},
{"id":"real-file-references","text":"Code changes reference actual files in the codebase (config schema, background manager)"}
]
},
{
"id":2,
"prompt":"The atlas hook has a bug where it crashes when boulder.json is missing the worktree_path field. Fix it and land the fix as a PR. Make sure CI passes.",
"expected_output":"Agent creates worktree for the fix branch, adds null check and test for missing worktree_path, creates PR, iterates verification loop",
"files":[],
"assertions":[
{"id":"worktree-isolation","text":"Plan uses git worktree in a sibling directory"},
{"id":"test-added","text":"Test case added for the missing worktree_path scenario"},
{"id":"three-gates","text":"Verification loop includes all 3 gates: CI, review-work, Cubic"},
{"id":"real-atlas-files","text":"References actual atlas hook files in src/hooks/atlas/"},
{"id":"fix-branch-naming","text":"Branch name follows fix/ prefix convention"}
]
},
{
"id":3,
"prompt":"Refactor src/tools/delegate-task/constants.ts to split DEFAULT_CATEGORIES and CATEGORY_MODEL_REQUIREMENTS into separate files. Keep backward compatibility with the barrel export. Make a PR.",
"expected_output":"Agent creates worktree, splits file with atomic commits, ensures imports still work via barrel, creates PR, runs through all gates",
"files":[],
"assertions":[
{"id":"worktree-isolation","text":"Plan uses git worktree in a sibling directory"},
{"id":"multiple-atomic-commits","text":"Uses 2+ commits for the multi-file refactor"},
{"id":"barrel-export","text":"Maintains backward compatibility via barrel re-export in constants.ts or index.ts"},
{"id":"three-gates","text":"Verification loop includes all 3 gates"},
{"id":"real-constants-file","text":"References actual src/tools/delegate-task/constants.ts file and its exports"}
]
},
{
"id":4,
"prompt":"implement issue #100 - we need to add a new built-in MCP for arxiv paper search. just the basic search endpoint, nothing fancy. pr it",
{"id":"worktree-isolation","text":"Plan uses git worktree in a sibling directory"},
{"id":"follows-mcp-pattern","text":"New MCP follows existing pattern from src/mcp/ (websearch, context7, grep_app)"},
{"id":"three-gates","text":"Verification loop includes all 3 gates"},
{"id":"pr-targets-dev","text":"PR targets dev branch"},
{"id":"local-validation","text":"Runs local checks before pushing"}
]
},
{
"id":5,
"prompt":"The comment-checker hook is too aggressive - it's flagging legitimate comments that happen to contain 'Note:' as AI slop. Relax the regex pattern and add test cases for the false positives. Work on a separate branch and make a PR.",
"expected_output":"Agent creates worktree, fixes regex, adds specific test cases for false positive scenarios, creates PR, all three gates pass",
"files":[],
"assertions":[
{"id":"worktree-isolation","text":"Plan uses git worktree in a sibling directory"},
{"id":"real-comment-checker-files","text":"References actual comment-checker hook files in the codebase"},
{"id":"regression-tests","text":"Adds test cases specifically for 'Note:' false positive scenarios"},
{"id":"three-gates","text":"Verification loop includes all 3 gates"},
{"id":"minimal-change","text":"Only modifies regex and adds tests — no unrelated changes"}
{"assertion":"Plan uses git worktree in a sibling directory","reason":"Uses git checkout -b, no worktree isolation"},
{"assertion":"Plan specifies multiple atomic commits for multi-file changes","reason":"Steps listed sequentially but no atomic commit strategy mentioned"},
{"assertion":"Verification loop includes all 3 gates: CI, review-work, and Cubic","reason":"Only mentions CI pipeline in step 6. No review-work or Cubic."},
{"assertion":"Gates are checked in order: CI first, then review-work, then Cubic","reason":"No gate ordering - only CI mentioned"},
{"assertion":"Cubic check uses gh api to check cubic-dev-ai[bot] reviews","reason":"No mention of Cubic at all"},
{"assertion":"Plan includes worktree cleanup after merge","reason":"No worktree used, no cleanup needed"}
]
}
},
{
"eval_name":"bugfix-atlas-null-check",
"with_skill":{
"pass_rate":1.0,
"passed":6,
"total":6,
"duration_seconds":506,
"failed_assertions":[]
},
"without_skill":{
"pass_rate":0.667,
"passed":4,
"total":6,
"duration_seconds":325,
"failed_assertions":[
{"assertion":"Plan uses git worktree in a sibling directory","reason":"No worktree. Steps go directly to creating branch and modifying files."},
{"assertion":"Verification loop includes all 3 gates","reason":"Only mentions CI pipeline (step 5). No review-work or Cubic."}
]
}
},
{
"eval_name":"refactor-split-constants",
"with_skill":{
"pass_rate":1.0,
"passed":5,
"total":5,
"duration_seconds":181,
"failed_assertions":[]
},
"without_skill":{
"pass_rate":0.4,
"passed":2,
"total":5,
"duration_seconds":229,
"failed_assertions":[
{"assertion":"Plan uses git worktree in a sibling directory","reason":"git checkout -b only, no worktree"},
{"assertion":"Uses 2+ commits for the multi-file refactor","reason":"Single atomic commit: 'refactor: split delegate-task constants and category model requirements'"},
{"assertion":"Verification loop includes all 3 gates","reason":"Only mentions typecheck/test/build. No review-work or Cubic."}
]
}
},
{
"eval_name":"new-mcp-arxiv-casual",
"with_skill":{
"pass_rate":1.0,
"passed":5,
"total":5,
"duration_seconds":152,
"failed_assertions":[]
},
"without_skill":{
"pass_rate":0.6,
"passed":3,
"total":5,
"duration_seconds":197,
"failed_assertions":[
{"assertion":"Verification loop includes all 3 gates","reason":"Only mentions bun test/typecheck/build. No review-work or Cubic."}
]
}
},
{
"eval_name":"regex-fix-false-positive",
"with_skill":{
"pass_rate":0.8,
"passed":4,
"total":5,
"duration_seconds":570,
"failed_assertions":[
{"assertion":"Only modifies regex and adds tests — no unrelated changes","reason":"Also proposes config schema change (exclude_patterns) and Go binary update — goes beyond minimal fix"}
]
},
"without_skill":{
"pass_rate":0.6,
"passed":3,
"total":5,
"duration_seconds":399,
"failed_assertions":[
{"assertion":"Plan uses git worktree in a sibling directory","reason":"git checkout -b, no worktree"},
{"assertion":"Verification loop includes all 3 gates","reason":"Only bun test and typecheck. No review-work or Cubic."}
]
}
}
],
"analyst_observations":[
"Three-gates assertion (CI + review-work + Cubic) is the strongest discriminator: 5/5 with-skill vs 0/5 without-skill. Without the skill, agents never know about Cubic or review-work gates.",
"Worktree isolation is nearly as discriminating (5/5 vs 1/5). One without-skill run (eval-4) independently chose worktree, suggesting some agents already know worktree patterns, but the skill makes it consistent.",
"The skill's only failure (eval-5 minimal-change) reveals a potential over-engineering tendency: the skill-guided agent proposed config schema changes and Go binary updates for what should have been a minimal regex fix. Consider adding explicit guidance for fix-type tasks to stay minimal.",
"Duration tradeoff: with-skill is 12% slower on average (340s vs 303s), driven mainly by eval-2 (bugfix) and eval-5 (regex fix) where the skill's thorough verification planning adds overhead. For eval-1 and eval-3-4, with-skill was actually faster.",
"Without-skill duration has lower variance (stddev 78s vs 169s), suggesting the skill introduces more variable execution paths depending on task complexity.",
"Non-discriminating assertions: 'References actual files', 'PR targets dev', 'Runs local checks' — these pass regardless of skill. They validate baseline agent competence, not skill value. Consider removing or downweighting in future iterations.",
"Atomic commits assertion discriminates moderately (2/2 with-skill tested vs 0/2 without-skill tested). Without the skill, agents default to single commits even for multi-file refactors."
- **three-gates** (CI + review-work + Cubic): 5/5 vs 0/5 — strongest signal
- **worktree-isolation**: 5/5 vs 1/5
- **atomic-commits**: 2/2 vs 0/2
- **cubic-check-method**: 1/1 vs 0/1
## Non-Discriminating Assertions
- References actual files: passes in both conditions
- PR targets dev: passes in both conditions
- Runs local checks before pushing: passes in both conditions
## Only With-Skill Failure
- **eval-5 minimal-change**: Skill-guided agent proposed config schema changes and Go binary update for a minimal regex fix. The skill may encourage over-engineering in fix scenarios.
## Analyst Notes
- The skill adds most value for procedural knowledge (verification gates, worktree workflow) that agents cannot infer from codebase alone.
- Duration cost is modest (+12%) and acceptable given the +45% pass rate improvement.
"prompt":"I need to add a `max_background_agents` config option to oh-my-opencode that limits how many background agents can run simultaneously. It should be in the plugin config schema with a default of 5. Add validation and make sure the background manager respects it. Create a PR for this.",
"assertions":[
{
"id":"worktree-isolation",
"text":"Plan uses git worktree in a sibling directory (not main working directory)",
"type":"manual"
},
{
"id":"branch-from-dev",
"text":"Branch is created from origin/dev (not master/main)",
"type":"manual"
},
{
"id":"atomic-commits",
"text":"Plan specifies multiple atomic commits for multi-file changes",
"type":"manual"
},
{
"id":"local-validation",
"text":"Runs bun run typecheck, bun test, and bun run build before pushing",
"type":"manual"
},
{
"id":"pr-targets-dev",
"text":"PR is created targeting dev branch (not master)",
"type":"manual"
},
{
"id":"three-gates",
"text":"Verification loop includes all 3 gates: CI, review-work, and Cubic",
"type":"manual"
},
{
"id":"gate-ordering",
"text":"Gates are checked in order: CI first, then review-work, then Cubic",
"type":"manual"
},
{
"id":"cubic-check-method",
"text":"Cubic check uses gh api to check cubic-dev-ai[bot] reviews for 'No issues found'",
"type":"manual"
},
{
"id":"worktree-cleanup",
"text":"Plan includes worktree cleanup after merge",
"type":"manual"
},
{
"id":"real-file-references",
"text":"Code changes reference actual files in the codebase (config schema, background manager)",
{"text":"Plan uses git worktree in a sibling directory","passed":true,"evidence":"Uses ../omo-wt/feat-max-background-agents"},
{"text":"Branch is created from origin/dev","passed":true,"evidence":"git checkout dev && git pull origin dev, then branch"},
{"text":"Plan specifies multiple atomic commits for multi-file changes","passed":true,"evidence":"2 commits: schema+tests, then concurrency+manager"},
{"text":"Runs bun run typecheck, bun test, and bun run build before pushing","passed":true,"evidence":"Explicit pre-push section with all 3 commands"},
{"text":"PR is created targeting dev branch","passed":true,"evidence":"--base dev in gh pr create"},
{"text":"Verification loop includes all 3 gates: CI, review-work, and Cubic","passed":true,"evidence":"Gate A (CI), Gate B (review-work 5 agents), Gate C (Cubic)"},
{"text":"Gates are checked in order: CI first, then review-work, then Cubic","passed":true,"evidence":"Explicit ordering in verify loop pseudocode"},
{"text":"Cubic check uses gh api to check cubic-dev-ai[bot] reviews","passed":true,"evidence":"Mentions cubic-dev-ai[bot] and 'No issues found' signal"},
{"text":"Plan includes worktree cleanup after merge","passed":true,"evidence":"Phase 4: git worktree remove ../omo-wt/feat-max-background-agents"},
{"text":"Code changes reference actual files in the codebase","passed":true,"evidence":"References src/config/schema/background-task.ts, src/features/background-agent/concurrency.ts, manager.ts"}
**Rationale:** Follows exact same pattern as `maxDepth` and `maxDescendants` — `z.number().int().min(1).optional()`. The field is optional; runtime default of 5 is applied in `ConcurrencyManager`. No barrel export changes needed since `src/config/schema.ts` already does `export * from "./schema/background-task"` and the type is inferred.
`Background agent spawn blocked: ${current} agents running, max is ${max}. Wait for existing tasks to complete or increase background_task.maxBackgroundAgents.`
`Background agent spawn blocked: ${current} agents running, max is ${max}. Wait for existing tasks to complete or increase background_task.maxBackgroundAgents.`
- `BackgroundManager.launch()` checks `concurrencyManager.canSpawnGlobally()` before creating task
- `BackgroundManager.trackTask()` also checks global limit
- On task completion/cancellation/error, call `releaseGlobal()`
- Throw descriptive error when limit hit: `"Background agent spawn blocked: ${current} agents running, max is ${max}. Wait for existing tasks to complete or increase background_task.maxBackgroundAgents."`
### Local Validation
```bash
bun run typecheck
bun test src/config/schema/background-task.test.ts
bun test src/features/background-agent/concurrency.test.ts
**Title:**`feat: add max_background_agents config to limit concurrent background agents`
**Base:**`dev`
---
## Summary
- Add `maxBackgroundAgents` field to `BackgroundTaskConfigSchema` (default: 5, min: 1) to cap total simultaneous background agents across all models/providers
- Enforce the global limit in `BackgroundManager.launch()` and `trackTask()` with descriptive error messages when the limit is hit
- Release global slots on task completion, cancellation, error, and interrupt to prevent slot leaks
## Motivation
The existing concurrency system in `ConcurrencyManager` limits agents **per model/provider** (e.g., 5 concurrent `anthropic/claude-opus-4-6` tasks). However, there is no **global** cap across all models. A user running tasks across multiple providers could spawn an unbounded number of background agents, exhausting system resources.
`max_background_agents` provides a single knob to limit total concurrent background agents regardless of which model they use.
## Config Usage
```jsonc
// .opencode/oh-my-opencode.jsonc
{
"background_task":{
"maxBackgroundAgents":10// default: 5, min: 1
}
}
```
## Changes
| File | What |
|------|------|
| `src/config/schema/background-task.ts` | Add `maxBackgroundAgents` schema field |
Before every push, run all three checks sequentially:
```bash
bun run typecheck && bun test&& bun run build
```
Specific test files to watch:
```bash
bun test src/config/schema/background-task.test.ts
bun test src/features/background-agent/concurrency.test.ts
```
---
## Gate A: CI (`ci.yml`)
### What CI runs
1.**Tests (split):** mock-heavy tests run in isolation (separate `bun test` processes), rest in batch
2.**Typecheck:**`bun run typecheck` (tsc --noEmit)
3.**Build:**`bun run build` (ESM + declarations + schema)
4.**Schema auto-commit:** if generated schema changed, CI commits it
### How to monitor
```bash
gh pr checks <PR_NUMBER> --watch
```
### Common failure scenarios and fixes
| Failure | Likely Cause | Fix |
|---------|-------------|-----|
| Typecheck error | New field not matching existing type imports | Verify `BackgroundTaskConfig` type is auto-inferred from schema, no manual type updates needed |
| Test failure | Test assertion wrong or missing import | Fix test, re-push |
| Build failure | Import cycle or missing export | Check barrel exports in `src/config/schema.ts` (already re-exports via `export *`) |
| Schema auto-commit | Generated JSON schema changed | Pull the auto-commit, rebase if needed |
### Recovery
```bash
# Read CI logs
gh run view <RUN_ID> --log-failed
# Fix, commit, push
git add -A && git commit -m "fix: address CI failure"&& git push
```
---
## Gate B: review-work (5 parallel agents)
### What it checks
Run `/review-work` which launches 5 background sub-agents:
| Agent | Role | What it checks for this PR |
|-------|------|---------------------------|
| Oracle (goal) | Goal/constraint verification | Does `maxBackgroundAgents` actually limit agents? Is default 5? Is min 1? |
| Oracle (quality) | Code quality | Follows existing patterns? No catch-all files? Under 200 LOC? given/when/then tests? |
| Oracle (security) | Security review | No injection vectors, no unsafe defaults, proper input validation via Zod |
| Hephaestus (context) | Context mining | Checks git history, related issues, ensures no duplicate/conflicting PRs |
### Pass criteria
All 5 agents must pass. Any single failure blocks.
### Common failure scenarios and fixes
| Agent | Likely Issue | Fix |
|-------|-------------|-----|
| Oracle (goal) | Global limit not enforced in all exit paths (completion, cancel, error, interrupt) | Audit every status transition in `manager.ts` that should call `releaseGlobal()` |
| Oracle (quality) | Test style not matching given/when/then | Restructure tests with `#given`/`#when`/`#then` describe nesting |
| Oracle (quality) | File exceeds 200 LOC | `concurrency.ts` is 137 LOC + ~25 new = ~162 LOC, safe. `manager.ts` is already large but we're adding ~20 lines to existing methods, not creating new responsibility |
| Oracle (security) | Integer overflow or negative values | Zod `.int().min(1)` handles this at config parse time |
| Hephaestus (QA) | Test actually fails when run | Run tests locally first, fix before push |
Cubic is an automated code review bot that analyzes the PR diff. It must respond with "No issues found" for the gate to pass.
### Common failure scenarios and fixes
| Issue | Likely Cause | Fix |
|-------|-------------|-----|
| "Missing error handling" | `releaseGlobal()` not called in some error path | Add `releaseGlobal()` to the missed path |
| "Inconsistent naming" | Field name doesn't match convention | Use `maxBackgroundAgents` (camelCase in schema, `max_background_agents` in JSONC config) |
| "Missing documentation" | No JSDoc on new public methods | Add JSDoc comments to `canSpawnGlobally()`, `acquireGlobal()`, `releaseGlobal()`, `getMaxBackgroundAgents()` |
| "Test coverage gap" | Missing edge case test | Add the specific test case Cubic identifies |
### Recovery
```bash
# Read Cubic's review
gh api repos/code-yeongyu/oh-my-openagent/pulls/<PR_NUMBER>/reviews
No iteration cap. Loop continues until all three gates pass simultaneously in a single iteration.
---
## Risk Assessment
| Risk | Probability | Mitigation |
|------|------------|------------|
| Slot leak (global count never decremented) | Medium | Audit every exit path: `tryCompleteTask`, `cancelTask`, `handleEvent(session.error)`, `startTask` prompt error, `resume` prompt error |
| Race condition on global count | Low | `globalRunningCount` is synchronous (single-threaded JS), no async gap between check and increment in `launch()` |
| Breaking existing behavior | Low | Default is 5, same as existing per-model default. Users with <5 total agents see no change |
| `manager.ts` exceeding 200 LOC | Already exceeded | File is already ~1500 LOC (exempt due to being a core orchestration class with many methods). Our changes add ~20 lines to existing methods, not a new responsibility |
{"text":"Plan uses git worktree in a sibling directory","passed":false,"evidence":"Uses git checkout -b, no worktree isolation"},
{"text":"Branch is created from origin/dev","passed":true,"evidence":"git checkout -b feat/max-background-agents dev"},
{"text":"Plan specifies multiple atomic commits for multi-file changes","passed":false,"evidence":"Steps listed sequentially but no atomic commit strategy mentioned"},
{"text":"Runs bun run typecheck, bun test, and bun run build before pushing","passed":true,"evidence":"Step 6 runs typecheck and tests, Step 8 implies push after verification"},
{"text":"PR is created targeting dev branch","passed":true,"evidence":"Step 8 mentions creating PR"},
{"text":"Verification loop includes all 3 gates: CI, review-work, and Cubic","passed":false,"evidence":"Only mentions CI pipeline in step 6. No review-work or Cubic."},
{"text":"Gates are checked in order: CI first, then review-work, then Cubic","passed":false,"evidence":"No gate ordering - only CI mentioned"},
{"text":"Cubic check uses gh api to check cubic-dev-ai[bot] reviews","passed":false,"evidence":"No mention of Cubic at all"},
{"text":"Plan includes worktree cleanup after merge","passed":false,"evidence":"No worktree used, no cleanup needed"},
{"text":"Code changes reference actual files in the codebase","passed":true,"evidence":"References actual files with detailed design decisions"}
/** Maximum number of background agents that can run simultaneously across all models/providers (default: no global limit, only per-model limits apply) */
**What changed:** Added `maxBackgroundAgents` field after `maxDescendants` (grouped with other limit fields). Uses `z.number().int().min(1).optional()` matching the pattern of `maxDepth` and `maxDescendants`.
* Get current count for a model (for testing/debugging)
*/
getCount(model: string):number{
returnthis.counts.get(model)??0
}
/**
* Get queue length for a model (for testing/debugging)
*/
getQueueLength(model: string):number{
returnthis.queues.get(model)?.length??0
}
/**
* Get current global count across all models (for testing/debugging)
*/
getGlobalCount():number{
returnthis.globalCount
}
/**
* Get global queue length (for testing/debugging)
*/
getGlobalQueueLength():number{
returnthis.globalQueue.length
}
}
```
**What changed:**
- Added `globalCount` field to track total active agents across all keys
- Added `globalQueue` for tasks waiting on the global limit
- Added `getGlobalLimit()` method to read `maxBackgroundAgents` from config
- Modified `acquire()` to check both per-model AND global limits
- Modified `release()` to handle global queue handoff and decrement global count
- Modified `clear()` to reset global state
- Added `getGlobalCount()` and `getGlobalQueueLength()` for testing
**Important design note:** The `release()` implementation above is a simplified version. In practice, the global queue handoff is tricky because we need to know which model the global waiter was trying to acquire for. A cleaner approach would be to store the model key in the QueueEntry. Let me refine:
### Refined approach (simpler, more correct)
Instead of a separate global queue, a simpler approach is to check the global limit inside `acquire()` and use a single queue per model. When global capacity frees up on `release()`, we try to drain any model's queue:
This refined approach keeps all waiters in per-model queues (no separate global queue), and on release, tries to drain waiters from any model queue that was blocked by the global limit.
Add a `max_background_agents` config option to oh-my-opencode that limits total simultaneous background agents across all models/providers. Currently, concurrency is only limited per-model/provider key (default 5 per key). This new option adds a **global ceiling** on total running background agents.
## Step-by-Step Plan
### Step 1: Create feature branch
```bash
git checkout -b feat/max-background-agents dev
```
### Step 2: Add `max_background_agents` to BackgroundTaskConfigSchema
**File:**`src/config/schema/background-task.ts`
- Add `maxBackgroundAgents` field to the Zod schema with `z.number().int().min(1).optional()`
- This follows the existing pattern of `maxDepth` and `maxDescendants` (integer, min 1, optional)
- The field name uses camelCase to match existing schema fields (`defaultConcurrency`, `maxDepth`, `maxDescendants`)
- No `.default()` needed since the hardcoded fallback of 5 lives in `ConcurrencyManager`
### Step 3: Modify `ConcurrencyManager` to enforce global limit
| `src/features/background-agent/concurrency.test.ts` | Add global limit enforcement tests |
## Files NOT Modified (intentional)
| File | Reason |
|------|--------|
| `src/config/schema/oh-my-opencode-config.ts` | No change needed - `BackgroundTaskConfigSchema` is already composed into root schema via `background_task` field |
| `src/create-managers.ts` | No change needed - `pluginConfig.background_task` already passed to `BackgroundManager` constructor |
| `src/features/background-agent/manager.ts` | No change needed - already passes config to `ConcurrencyManager` |
| `src/plugin-config.ts` | No change needed - `background_task` is a simple object field, uses default override merge |
1.**Field name `maxBackgroundAgents`** - camelCase to match existing schema fields (`maxDepth`, `maxDescendants`, `defaultConcurrency`). The user-facing JSONC config key is also camelCase per existing convention in `background_task` section.
2.**Global limit vs per-model limit** - The global limit is a ceiling across ALL concurrency keys. Per-model limits still apply independently. A task needs both a per-model slot AND a global slot to proceed.
3.**Default of 5** - Matches the existing hardcoded default in `getConcurrencyLimit()`. When `maxBackgroundAgents` is not set, no global limit is enforced (only per-model limits apply), preserving backward compatibility.
4.**Queue behavior** - When global limit is reached, tasks wait in the same FIFO queue mechanism. The global check happens inside `acquire()` before the per-model check.
5.**0 means Infinity** - Following the existing pattern where `defaultConcurrency: 0` means unlimited, `maxBackgroundAgents: 0` would also mean no global limit.
**Title:** feat: add `maxBackgroundAgents` config to limit total simultaneous background agents
**Body:**
## Summary
- Add `maxBackgroundAgents` field to `BackgroundTaskConfigSchema` that enforces a global ceiling on total running background agents across all models/providers
- Modify `ConcurrencyManager` to track global count and enforce the limit alongside existing per-model limits
- Add schema validation tests and concurrency enforcement tests
## Motivation
Currently, concurrency is only limited per model/provider key (default 5 per key). On resource-constrained machines or when using many different models, the total number of background agents can grow unbounded (5 per model x N models). This config option lets users set a hard ceiling.
- Added `globalCount` tracking total active agents across all concurrency keys
- Added `getGlobalLimit()` reading `maxBackgroundAgents` from config (defaults to `Infinity` = no global limit)
- Modified `acquire()` to check both per-model AND global capacity
- Modified `release()` to decrement global count and drain cross-model waiters blocked by global limit
- Modified `clear()` to reset global state
- Added `getGlobalCount()` / `getGlobalQueueLength()` for testing
### Tests
-`src/config/schema/background-task.test.ts`: 6 test cases for schema validation (valid, min boundary, below min, negative, non-integer, undefined)
-`src/features/background-agent/concurrency.test.ts`: 8 test cases for global limit enforcement (cross-model blocking, release unblocking, per-model vs global interaction, no-config default, clear reset)
## Config Example
```jsonc
{
"background_task":{
"maxBackgroundAgents":5,
"defaultConcurrency":3
}
}
```
## Backward Compatibility
- When `maxBackgroundAgents` is not set (default), no global limit is enforced - behavior is identical to before
- Existing `defaultConcurrency`, `providerConcurrency`, and `modelConcurrency` continue to work unchanged
| No global limit = no enforcement | No config, acquire 6 different models | All succeed |
| Clear resets global count | Acquire 2, clear | `getGlobalCount()` is 0 |
### Existing Test Regression
```bash
bun test src/features/background-agent/concurrency.test.ts
bun test src/config/schema/background-task.test.ts
bun test src/config/schema.test.ts
```
All existing tests must continue to pass unchanged.
## 3. Integration Verification
### Config Loading Path
Verify the config flows correctly through the system:
1.**Schema → Type**: `BackgroundTaskConfig` type auto-includes `maxBackgroundAgents` via `z.infer`
2.**Config file → Schema**: `loadConfigFromPath()` in `plugin-config.ts` uses `OhMyOpenCodeConfigSchema.safeParse()` which includes `BackgroundTaskConfigSchema`
3.**Config → Manager**: `create-managers.ts` passes `pluginConfig.background_task` to `BackgroundManager` constructor
4.**Manager → ConcurrencyManager**: `BackgroundManager` constructor passes config to `new ConcurrencyManager(config)`
5.**ConcurrencyManager → Enforcement**: `acquire()` reads `config.maxBackgroundAgents` via `getGlobalLimit()`
No changes needed in steps 2-4 since the field is optional and the existing plumbing passes the entire `BackgroundTaskConfig` object.
### Manual Config Test
Create a test config to verify parsing:
```bash
echo'{ "background_task": { "maxBackgroundAgents": 3 } }'| bun -e "
"prompt":"The atlas hook has a bug where it crashes when boulder.json is missing the worktree_path field. Fix it and land the fix as a PR. Make sure CI passes.",
"assertions":[
{
"id":"worktree-isolation",
"text":"Plan uses git worktree in a sibling directory",
**Rationale**: `readBoulderState` casts raw `JSON.parse()` output as `BoulderState` without validating individual fields. When boulder.json has `"worktree_path": null` (valid JSON from manual edits, corrupted state, or external tools), the runtime type is `null` but TypeScript type says `string | undefined`. This sanitization ensures downstream code always gets the correct type.
---
## File 2: `src/hooks/atlas/idle-event.ts`
**Change**: Add defensive string type guard before passing `worktree_path` to continuation functions.
**Rationale**: Belt-and-suspenders defense. Even though `readBoulderState` now sanitizes, direct `writeBoulderState` calls elsewhere could still produce invalid state. The `typeof` check is zero-cost and prevents any possibility of `null` or non-string values leaking through.
---
## File 3: `src/hooks/atlas/index.test.ts`
**Change**: Add test cases for missing `worktree_path` scenarios within the existing `session.idle handler` describe block.
```typescript
test("should inject continuation when boulder.json has no worktree_path field",async()=>{
fix(atlas): prevent crash when boulder.json missing worktree_path
```
# PR Body
## Summary
- Fix runtime type violation in atlas hook when `boulder.json` lacks `worktree_path` field
- Add `worktree_path` sanitization in `readBoulderState()` to reject non-string values (e.g., `null` from manual edits)
- Add defensive `typeof` guards in `idle-event.ts` before passing worktree path to continuation injection
- Add test coverage for missing and null `worktree_path` scenarios
## Problem
`readBoulderState()` in `src/features/boulder-state/storage.ts` casts raw `JSON.parse()` output directly as `BoulderState` via `return parsed as BoulderState`. This bypasses TypeScript's type system entirely at runtime.
When `boulder.json` is missing the `worktree_path` field (common for boulders created before worktree support was added, or created without `--worktree` flag), `boulderState.worktree_path` is `undefined` which is handled correctly. However, when boulder.json has `"worktree_path": null` (possible from manual edits, external tooling, or corrupted state), the runtime type becomes `null` which violates the TypeScript type `string | undefined`.
2.`idle-event.ts:scheduleRetry()` callback → same chain
While the `boulder-continuation-injector.ts` handles falsy values via `worktreePath ? ... : ""`, the type mismatch can cause subtle downstream issues and violates the contract of the `BoulderState` interface.
{"text":"Plan uses git worktree in a sibling directory","passed":false,"evidence":"No worktree. Steps go directly to creating branch and modifying files."},
{"text":"Fix is minimal — adds null check, doesn't refactor unrelated code","passed":true,"evidence":"Focused fix though also adds try/catch in setTimeout (reasonable secondary fix)"},
{"text":"Test case added for the missing worktree_path scenario","passed":true,"evidence":"Detailed test plan for missing/null/malformed boulder.json"},
{"text":"Verification loop includes all 3 gates","passed":false,"evidence":"Only mentions CI pipeline (step 5). No review-work or Cubic."},
{"text":"References actual atlas hook files","passed":true,"evidence":"References idle-event.ts, storage.ts with line numbers"},
{"text":"Branch name follows fix/ prefix convention","passed":true,"evidence":"fix/atlas-hook-missing-worktree-path"}
**Rationale:** Validates that required fields (`active_plan`, `plan_name`) are strings. Strips `worktree_path` if it's present but not a string (e.g., `null`, number). This prevents downstream crashes from `existsSync(undefined)` and ensures type safety at the boundary.
---
## Change 2: Add try/catch in setTimeout retry callback
**Rationale:** The async callback in setTimeout creates a floating promise. Without try/catch, any error becomes an unhandled rejection that can crash the process. This is the critical safety net even after the `readBoulderState` fix.
**Rationale:** Defense-in-depth. Even though `readBoulderState` now validates `active_plan`, the `getPlanProgress` function is a public API that could be called from other paths with invalid input. A `typeof` check before `existsSync` prevents the TypeError from `existsSync(undefined)`.
returnparsedasBoulderState// <-- unsafe cast, no field validation
```
It validates `session_ids` but NOT `active_plan`, `plan_name`, or `worktree_path`. This means a malformed `boulder.json` (e.g., `{}` or missing key fields) passes through and downstream code crashes.
### Crash Path
1.`boulder.json` is written without required fields (manual edit, corruption, partial write)
2.`readBoulderState()` returns it as `BoulderState` with `active_plan: undefined`
3. Multiple call sites pass `boulderState.active_plan` to `getPlanProgress(planPath: string)`:
4.`getPlanProgress()` calls `existsSync(undefined)` which throws: `TypeError: The "path" argument must be of type string`
### worktree_path-Specific Issues
When `worktree_path` field is missing from `boulder.json`:
- The `idle-event.ts``scheduleRetry` setTimeout callback (lines 62-88) has NO try/catch. An unhandled promise rejection from the async callback crashes the process.
-`readBoulderState()` returns `worktree_path: undefined` which itself is handled in `boulder-continuation-injector.ts` (line 42 uses truthiness check), but the surrounding code in the setTimeout lacks error protection.
### Secondary Issue: Unhandled Promise in setTimeout
- Fix crash in atlas hook when `boulder.json` is missing `worktree_path` (or other required fields) by hardening `readBoulderState()` validation
- Wrap the unprotected `setTimeout` retry callback in `idle-event.ts` with try/catch to prevent unhandled promise rejections
- Add defensive type guard in `getPlanProgress()` to prevent `existsSync(undefined)` TypeError
## Context
When `boulder.json` is malformed or manually edited to omit fields, `readBoulderState()` returns an object cast as `BoulderState` without validating required fields. Downstream callers like `getPlanProgress(boulderState.active_plan)` then pass `undefined` to `existsSync()`, which throws a TypeError. This crash is especially dangerous in the `setTimeout` retry callback in `idle-event.ts`, where the error becomes an unhandled promise rejection.
## Changes
### `src/features/boulder-state/storage.ts`
-`readBoulderState()`: Validate `active_plan` and `plan_name` are strings (return `null` if not)
-`readBoulderState()`: Strip `worktree_path` if present but not a string type
-`getPlanProgress()`: Add `typeof planPath !== "string"` guard before `existsSync`
### `src/hooks/atlas/idle-event.ts`
- Wrap `scheduleRetry` setTimeout async callback body in try/catch
### Tests
-`src/features/boulder-state/storage.test.ts`: 5 new tests for missing/malformed fields
-`src/hooks/atlas/index.test.ts`: 2 new tests for worktree_path presence/absence in continuation prompt
"prompt":"Refactor src/tools/delegate-task/constants.ts to split DEFAULT_CATEGORIES and CATEGORY_MODEL_REQUIREMENTS into separate files. Keep backward compatibility with the barrel export. Make a PR.",
"assertions":[
{
"id":"worktree-isolation",
"text":"Plan uses git worktree in a sibling directory",
"type":"manual"
},
{
"id":"multiple-atomic-commits",
"text":"Uses 2+ commits for the multi-file refactor",
"type":"manual"
},
{
"id":"barrel-export",
"text":"Maintains backward compatibility via barrel re-export in constants.ts or index.ts",
"type":"manual"
},
{
"id":"three-gates",
"text":"Verification loop includes all 3 gates",
"type":"manual"
},
{
"id":"real-constants-file",
"text":"References actual src/tools/delegate-task/constants.ts file and its exports",
{"text":"Plan uses git worktree in a sibling directory","passed":true,"evidence":"../omo-wt/refactor-delegate-task-constants"},
{"text":"Uses 2+ commits for the multi-file refactor","passed":true,"evidence":"Commit 1: category defaults+appends, Commit 2: plan agent prompt+names"},
{"text":"Maintains backward compatibility via barrel re-export","passed":true,"evidence":"constants.ts converted to re-export from 4 new files, full import map verified"},
{"text":"Verification loop includes all 3 gates","passed":true,"evidence":"Gate A (CI), Gate B (review-work), Gate C (Cubic)"},
{"text":"References actual src/tools/delegate-task/constants.ts","passed":true,"evidence":"654 lines analyzed, 4 responsibilities identified, full external+internal import map"}
refactor(delegate-task): split constants.ts into focused modules
```
# PR Body
## Summary
- Split the 654-line `src/tools/delegate-task/constants.ts` into 4 single-responsibility modules: `default-categories.ts`, `category-prompt-appends.ts`, `plan-agent-prompt.ts`, `plan-agent-names.ts`
-`constants.ts` becomes a pure re-export barrel, preserving all existing import paths (`from "./constants"` and `from "./delegate-task"`)
- Zero import changes across the codebase (6 external + 7 internal consumers verified)
## Motivation
`constants.ts` at 654 lines violates the project's 200 LOC soft limit (`modular-code-enforcement.md` rule) and bundles 4 unrelated responsibilities: category model configs, category prompt text, plan agent prompts, and plan agent name utilities.
All 13 consumers continue importing from `"./constants"` or `"../tools/delegate-task/constants"` with zero changes. The re-export chain: new modules -> `constants.ts` -> `index.ts` -> external consumers.
## Note on CATEGORY_MODEL_REQUIREMENTS
`CATEGORY_MODEL_REQUIREMENTS` already lives in `src/shared/model-requirements.ts`. No move needed. The AGENTS.md reference to it being in `constants.ts` is outdated.
## Testing
-`bun run typecheck` passes
-`bun test src/tools/delegate-task/` passes (all existing tests untouched)
{"text":"Plan uses git worktree in a sibling directory","passed":false,"evidence":"git checkout -b only, no worktree"},
{"text":"Uses 2+ commits for the multi-file refactor","passed":false,"evidence":"Single atomic commit: 'refactor: split delegate-task constants and category model requirements'"},
{"text":"Maintains backward compatibility via barrel re-export","passed":true,"evidence":"Re-exports from new files, zero consumer changes"},
{"text":"Verification loop includes all 3 gates","passed":false,"evidence":"Only mentions typecheck/test/build. No review-work or Cubic."},
{"text":"References actual src/tools/delegate-task/constants.ts","passed":true,"evidence":"654 lines, detailed responsibility breakdown, full import maps"}
> Note: Each `*_CATEGORY_PROMPT_APPEND` contains the full template string from the original. Abbreviated with `...` here for readability. The actual code would contain the complete unmodified prompt text.
`src/tools/delegate-task/constants.ts` is **654 lines** with 6 distinct responsibilities. Violates the 200 LOC modular-code-enforcement rule. `CATEGORY_MODEL_REQUIREMENTS` is actually in `src/shared/model-requirements.ts` (311 lines, also violating 200 LOC), not in `constants.ts`.
## Pre-Flight Analysis
### Current `constants.ts` responsibilities:
1.**Category prompt appends** (8 template strings, ~274 LOC prompt text)
- Extract `CATEGORY_MODEL_REQUIREMENTS` from `src/shared/model-requirements.ts` (311 LOC) into `category-model-requirements.ts`, bringing both files under the 200 LOC limit
- Convert original files to barrel re-exports for 100% backward compatibility (zero consumer changes)
## Motivation
Both files violate the project's 200 LOC modular-code-enforcement rule. `constants.ts` mixed 6 unrelated responsibilities (category configs, prompt templates, plan agent builders, identity utils). `model-requirements.ts` mixed agent and category model requirements.
## Changes
### `src/tools/delegate-task/`
| New File | Responsibility |
|----------|---------------|
| `default-categories.ts` | `DEFAULT_CATEGORIES` record |
| `category-descriptions.ts` | `CATEGORY_DESCRIPTIONS` record |
| `plan-agent-prompt.ts` | Plan agent system prompts + builder functions |
| `plan-agent-identity.ts` | `isPlanAgent`, `isPlanFamily` + name lists |
`constants.ts` is now a barrel re-export file (~25 LOC).
### `src/shared/`
| New File | Responsibility |
|----------|---------------|
| `category-model-requirements.ts` | `CATEGORY_MODEL_REQUIREMENTS` record |
`model-requirements.ts` retains types + `AGENT_MODEL_REQUIREMENTS` and re-exports `CATEGORY_MODEL_REQUIREMENTS`.
## Backward Compatibility
All existing import paths (`from "./constants"`, `from "../../tools/delegate-task/constants"`, `from "../../shared/model-requirements"`) continue to work unchanged. Zero consumer files modified.
## Testing
-`bun run typecheck` passes
-`bun test` passes (existing `tools.test.ts` validates all re-exported symbols)
Expected: 0 errors. This confirms all 14 consumer files (8 internal + 6 external) resolve their imports correctly through the barrel re-exports.
## 2. Behavioral Regression
### 2a. Existing test suite
```bash
bun test src/tools/delegate-task/tools.test.ts
```
This test file imports `DEFAULT_CATEGORIES`, `CATEGORY_PROMPT_APPENDS`, `CATEGORY_DESCRIPTIONS`, `isPlanAgent`, `PLAN_AGENT_NAMES`, `isPlanFamily`, `PLAN_FAMILY_NAMES` from `./constants`. If the barrel re-export is correct, all these tests pass unchanged.
### 2b. Category resolver tests
```bash
bun test src/tools/delegate-task/category-resolver.test.ts
```
This exercises `resolveCategoryConfig()` which imports `DEFAULT_CATEGORIES` and `CATEGORY_PROMPT_APPENDS` from `./constants` and `CATEGORY_MODEL_REQUIREMENTS` from `../../shared/model-requirements`.
### 2c. Model selection tests
```bash
bun test src/tools/delegate-task/model-selection.test.ts
```
### 2d. Merge categories tests
```bash
bun test src/shared/merge-categories.test.ts
```
Imports `DEFAULT_CATEGORIES` from `../tools/delegate-task/constants` (external path).
### 2e. Full test suite
```bash
bun test
```
## 3. Build Verification
```bash
bun run build
```
Confirms ESM bundle + declarations emit correctly with the new file structure.
## 4. Export Completeness Verification
### 4a. Verify `constants.ts` re-exports match original exports
Cross-check that every symbol previously exported from `constants.ts` is still exported. The original file exported these symbols:
-`VISUAL_CATEGORY_PROMPT_APPEND`
-`ULTRABRAIN_CATEGORY_PROMPT_APPEND`
-`ARTISTRY_CATEGORY_PROMPT_APPEND`
-`QUICK_CATEGORY_PROMPT_APPEND`
-`UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND`
-`UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND`
-`WRITING_CATEGORY_PROMPT_APPEND`
-`DEEP_CATEGORY_PROMPT_APPEND`
-`DEFAULT_CATEGORIES`
-`CATEGORY_PROMPT_APPENDS`
-`CATEGORY_DESCRIPTIONS`
-`PLAN_AGENT_SYSTEM_PREPEND_STATIC_BEFORE_SKILLS`
-`PLAN_AGENT_SYSTEM_PREPEND_STATIC_AFTER_SKILLS`
-`buildPlanAgentSkillsSection`
-`buildPlanAgentSystemPrepend`
-`PLAN_AGENT_NAMES`
-`isPlanAgent`
-`PLAN_FAMILY_NAMES`
-`isPlanFamily`
All 19 must be re-exported from the barrel.
### 4b. Verify `model-requirements.ts` re-exports match original exports
Original exports: `FallbackEntry`, `ModelRequirement`, `AGENT_MODEL_REQUIREMENTS`, `CATEGORY_MODEL_REQUIREMENTS`. All 4 must still be available.
## 5. LOC Compliance Check
Verify each new file is under 200 LOC (excluding prompt template text per modular-code-enforcement rule):
| File | Expected Total LOC | Non-prompt LOC | Compliant? |
- If no remote MCP exists for arXiv, this would need to be a stdio MCP or a custom HTTP wrapper. For this plan, we assume a remote MCP endpoint pattern consistent with existing built-ins.
### Step 2: Update `src/mcp/types.ts`
- Add `"arxiv"` to `McpNameSchema` enum: `z.enum(["websearch", "context7", "grep_app", "arxiv"])`
### Step 3: Update `src/mcp/index.ts`
- Import `arxiv` from `"./arxiv"`
- Add conditional block in `createBuiltinMcps()`:
```typescript
if (!disabledMcps.includes("arxiv")) {
mcps.arxiv = arxiv
}
```
### Step 4: Create `src/mcp/arxiv.test.ts`
- Test arXiv config shape (type, url, enabled, oauth)
- Follow pattern from existing tests (given/when/then)
> **Note:** The URL `https://mcp.arxiv.org` is a placeholder. The actual endpoint needs to be verified. If no hosted arXiv MCP exists, alternatives include community-hosted servers or a self-hosted wrapper around the arXiv REST API (`export.arxiv.org/api/query`). This would be the single blocker requiring resolution before merging.
Pattern followed: `grep-app.ts` (static export, no auth, no config factory needed since arXiv API is public).
- The arXiv API is public (`export.arxiv.org/api/query`) but has no native MCP endpoint
- Need to identify a hosted remote MCP server for arXiv (e.g., community-maintained or self-hosted)
- If no hosted endpoint exists, consider alternatives: (a) use a community-hosted one from the MCP registry, (b) flag this in the PR and propose a follow-up for hosting
- For this plan, assume a remote MCP endpoint at a URL like `https://mcp.arxiv.org` or a third-party equivalent
## Implementation Steps (4 files to modify, 2 files to create)
### Step 1: Create `src/mcp/arxiv.ts`
- Follow the `grep-app.ts` pattern (simplest: static export, no auth, no config)
- arXiv API is public, so no API key needed
- Export a `const arxiv` with `type: "remote"`, `url`, `enabled: true`, `oauth: false`
### Step 2: Update `src/mcp/types.ts`
- Add `"arxiv"` to the `McpNameSchema` z.enum array
- This makes it a recognized built-in MCP name
### Step 3: Update `src/mcp/index.ts`
- Import `arxiv` from `"./arxiv"`
- Add the `if (!disabledMcps.includes("arxiv"))` block inside `createBuiltinMcps()`
- Place it after `grep_app` block (alphabetical among new additions, or last)
### Step 4: Update `src/mcp/index.test.ts`
- Update test "should return all MCPs when disabled_mcps is empty" to expect 4 MCPs instead of 3
- Update test "should filter out all built-in MCPs when all disabled" to include "arxiv" in the disabled list and expect it not present
- Update test "should handle empty disabled_mcps by default" to expect 4 MCPs
- Update test "should only filter built-in MCPs, ignoring unknown names" to expect 4 MCPs
- Add new test: "should filter out arxiv when disabled"
### Step 5: Create `src/mcp/arxiv.test.ts` (optional, only if factory pattern used)
- If using static export (like grep-app), no separate test file needed
- If using factory with config, add tests following `websearch.test.ts` pattern
If the endpoint doesn't exist or returns non-2xx, the MCP will silently fail at runtime (MCP framework handles connection errors gracefully). This is acceptable for a built-in MCP but should be documented.
## 7. Regression Check
Verify no existing functionality is broken:
-`bun test` (full suite) passes
- Existing 3 MCPs (websearch, context7, grep_app) still work
-`disabled_mcps` config still works for all MCPs
-`mcp-config-handler.test.ts` passes (if it has count-based assertions, update them)
## Checklist
- [ ]`bun run typecheck` passes
- [ ]`bun test src/mcp/` passes (all tests green)
- [ ]`bun run build` succeeds
- [ ]`lsp_diagnostics` clean on all 4 changed files
- [ ] arXiv MCP endpoint URL verified reachable
- [ ] No hardcoded MCP count assertions broken elsewhere in codebase
"prompt":"The comment-checker hook is too aggressive - it's flagging legitimate comments that happen to contain 'Note:' as AI slop. Relax the regex pattern and add test cases for the false positives. Work on a separate branch and make a PR.",
"assertions":[
{
"id":"worktree-isolation",
"text":"Plan uses git worktree in a sibling directory",
"type":"manual"
},
{
"id":"real-comment-checker-files",
"text":"References actual comment-checker hook files in the codebase",
"type":"manual"
},
{
"id":"regression-tests",
"text":"Adds test cases specifically for 'Note:' false positive scenarios",
"type":"manual"
},
{
"id":"three-gates",
"text":"Verification loop includes all 3 gates",
"type":"manual"
},
{
"id":"minimal-change",
"text":"Only modifies regex and adds tests — no unrelated changes",
The comment-checker delegates to an external Go binary (`code-yeongyu/go-claude-code-comment-checker` v0.4.1). The binary contains the regex `(?i)^[\s#/*-]*note:\s*\w` which matches ANY comment starting with "Note:" followed by a word character. This flags legitimate technical notes like:
- `// Note: Thread-safe by design`
- `# Note: See RFC 7231 for details`
- `// Note: This edge case requires special handling`
Full list of 24 embedded regex patterns extracted from the binary:
- Add `exclude_patterns` config to comment-checker schema, allowing users to whitelist comment prefixes (e.g. `["^Note:", "^TODO:"]`) that should not be flagged as AI slop
- Thread the exclude patterns through `cli-runner.ts` and `cli.ts` to the Go binary via `--exclude-pattern` flags
- Add test cases covering false positive scenarios: legitimate technical notes, RFC references, and AI memo detection with/without exclusions
## Context
The comment-checker Go binary (`go-claude-code-comment-checker` v0.4.1) contains the regex `(?i)^[\s#/*-]*note:\s*\w` which matches ALL comments starting with "Note:" followed by a word character. This produces false positives for legitimate technical comments:
```typescript
// Note: Thread-safe by design <- flagged as AI slop
#Note: SeeRFC7231fordetails<-flaggedasAIslop
// Note: This edge case requires... <- flagged as AI slop
```
These are standard engineering comments, not AI agent memos.
## Changes
| File | Change |
|------|--------|
| `src/config/schema/comment-checker.ts` | Add `exclude_patterns: string[]` optional field |
| `src/hooks/comment-checker/cli.ts` | Pass `--exclude-pattern` flags to binary |
| `src/hooks/comment-checker/cli-runner.ts` | Thread `excludePatterns` through `processWithCli` and `processApplyPatchEditsWithCli` |
| `src/hooks/comment-checker/hook.ts` | Pass `config.exclude_patterns` to CLI runner calls |
| `src/hooks/comment-checker/cli.test.ts` | Add 6 new test cases for false positive scenarios |
| `src/hooks/comment-checker/hook.apply-patch.test.ts` | Add test verifying exclude_patterns config threading |
## Usage
```jsonc
// .opencode/oh-my-opencode.jsonc
{
"comment_checker":{
"exclude_patterns":["^Note:","^TODO:","^FIXME:"]
}
}
```
## Related
- Go binary repo: `code-yeongyu/go-claude-code-comment-checker` (needs corresponding `--exclude-pattern` flag support)
| Oracle (code quality) | Code quality check | Factory pattern consistency, no catch-all files, <200 LOC |
| Oracle (security) | Security review | Regex patterns are user-supplied - verify no ReDoS risk from config |
| Hephaestus (QA) | Hands-on execution | Run tests, verify mock binary tests actually exercise the exclude flow |
| Hephaestus (context) | Context mining | Check git history for related changes, verify no conflicting PRs |
### Potential review-work flags
1.**ReDoS concern**: User-supplied regex patterns in `exclude_patterns` could theoretically cause ReDoS in the Go binary. Mitigation: the patterns are passed as CLI args, Go's `regexp` package is RE2-based (linear time guarantee).
2.**Breaking change check**: Adding optional field to config schema is non-breaking (Zod `z.optional()` fills default).
3.**Go binary dependency**: The `--exclude-pattern` flag must exist in the Go binary for this to work. If the binary doesn't support it yet, the patterns are silently ignored (binary treats unknown flags differently).
### Failure handling
- If any Oracle flags issues: address feedback, push new commit, re-run review-work
- If Hephaestus QA finds test gaps: add missing tests, push, re-verify
## Gate C: Cubic (`cubic-dev-ai[bot]`)
### Expected review focus
- Schema change additive and backward-compatible
- Parameter threading is mechanical and low-risk
- Tests use mock binaries (shell scripts) - standard project pattern per `cli.test.ts`
{"text":"Plan uses git worktree in a sibling directory","passed":false,"evidence":"git checkout -b, no worktree"},
{"text":"References actual comment-checker hook files","passed":true,"evidence":"Deep analysis of Go binary, tree-sitter, formatter.go, agent_memo.go with line numbers"},
{"text":"Adds test cases for Note: false positive scenarios","passed":true,"evidence":"Detailed test cases distinguishing legit vs AI slop patterns"},
{"text":"Verification loop includes all 3 gates","passed":false,"evidence":"Only bun test and typecheck. No review-work or Cubic."},
{"text":"Only modifies regex and adds tests — no unrelated changes","passed":true,"evidence":"Adds allowed-prefix filter module — focused approach with config extension"}
The comment-checker hook delegates to an external Go binary (`code-yeongyu/go-claude-code-comment-checker`). The binary:
1. Detects ALL comments in written/edited code using tree-sitter
2. Filters out only BDD markers, linter directives, and shebangs
3. Flags every remaining comment as problematic (exit code 2)
4. In the output formatter (`formatter.go`), uses `AgentMemoFilter` to categorize comments for display
The `AgentMemoFilter` in `pkg/filters/agent_memo.go` contains the overly aggressive regex:
```go
regexp.MustCompile(`(?i)^[\s#/*-]*note:\s*\w`),
```
This matches ANY comment starting with `Note:` (case-insensitive) followed by a word character, causing legitimate comments like `// Note: Thread-safe implementation` or `// NOTE: See RFC 7231` to be classified as "AGENT MEMO" AI slop with an aggressive warning banner.
Additionally, the binary flags ALL non-filtered comments (not just agent memos), so even without the `Note:` regex, `// Note: ...` comments would still be flagged as generic "COMMENT DETECTED."
## Architecture Understanding
```
TypeScript (oh-my-opencode) Go Binary (go-claude-code-comment-checker)
Add `allowed_comment_prefixes` field with sensible defaults. This lets users configure which comment prefixes should be treated as legitimate (not AI slop).
### Step 3: Add a post-processing filter in cli-runner.ts
After the Go binary returns its result, parse the stderr message to identify and suppress comments that match allowed prefixes. The binary's output contains XML like:
The comment-checker hook's upstream Go binary (`go-claude-code-comment-checker`) flags ALL non-filtered comments as problematic. Its `AgentMemoFilter` regex `(?i)^[\s#/*-]*note:\s*\w` classifies any `Note:` comment as AI-generated "agent memo" slop, triggering an aggressive warning banner.
This causes false positives for legitimate, widely-used comment patterns:
```typescript
// Note: Thread-safe implementation required due to concurrent access
// NOTE: See RFC 7231 section 6.5.4 for 404 semantics
// Note: This timeout matches the upstream service SLA
```
These are standard engineering documentation patterns, not AI slop.
## Solution
Rather than waiting for an upstream binary fix, this PR adds a configurable **post-processing filter** on the TypeScript side:
2.**Filter**: After the Go binary returns flagged comments, `filterAllowedComments()` parses the XML output and suppresses comments matching allowed prefixes
3.**Behavior**: If ALL flagged comments are legitimate → suppress entire warning. If mixed → remove only the legitimate entries from the XML, keep the warning for actual slop.
- Empty message from binary (exit code 0) - filter should be no-op
- Binary not available - hook gracefully degrades (existing behavior)
- Message with no `<comment>` XML elements - filter passes through
- Very long messages with many comments - regex performance
- Comments containing XML-special characters (`<`, `>`, `&`) in text
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.