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
- 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>