The test asserted worktree_path was undefined after running with worktreeEnabled: false, but provided no --worktree flag in the input. The worktree_path was never going to be stored anyway, so the test passed vacuously regardless of whether the config suppression actually worked. Add a --worktree flag with a mocked valid detectWorktreePath return so the only reason storage is suppressed is the config.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
SkillLoadOptions and createSkillTool now accept startWorkConfig and forward it to discoverCommandsSync. tool-registry passes pluginConfig.start_work to both call sites so the skill tool description and skill(name="start-work") invocation honour the worktree config flag.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
discoverCommandsSync() was calling loadBuiltinCommands() with no config, always rendering the /start-work template with worktree instructions regardless of user config.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The test at the bottom of 'worktree disabled by config' was misplaced and
broken in two ways:
- It lived outside the 'worktree support' describe block, so detectSpy was
not in scope (compile error).
- It passed no --worktree flag, meaning explicitWorktreePath was null and
resolveWorktreeContext returned undefined regardless of worktreeEnabled,
so the test could never observe the enabled behavior it claimed to assert.
Move the test into 'worktree support' where detectSpy is available, pass
--worktree /valid/wt in the user request, mock detectWorktreePath to return
the path, and assert that 'Worktree Active' is injected and worktree_path is
stored in boulder.json.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The auto-slash-command executor called loadBuiltinCommands() with no config,
so the startWorkConfig?.worktree ?? true fallback always fired, ignoring the
user's start_work.worktree setting.
Thread startWorkConfig through ExecutorOptions -> AutoSlashCommandHookOptions
-> createSkillHooks so the user's config is respected when /start-work is
invoked via the slash-command path.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
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>
- 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