Commit Graph

377 Commits

Author SHA1 Message Date
YeonGyu-Kim 8bc27da0f0 test(install): restore Bun mocks after installer tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-11 21:25:27 +09:00
YeonGyu-Kim acb0f6b006 fix(install): isolate installer telemetry failures
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-11 21:25:27 +09:00
YeonGyu-Kim 2510870133 fix(run): isolate CLI telemetry failures
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-11 21:25:26 +09:00
YeonGyu-Kim 365900b17f feat(telemetry): add install command events and user-facing telemetry notice 2026-04-11 14:14:36 +09:00
YeonGyu-Kim 1c27000c37 feat(telemetry): instrument CLI run command with lifecycle events 2026-04-11 14:14:32 +09:00
YeonGyu-Kim 12c9db729b test(cli): update all CLI command tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-10 15:53:28 +09:00
YeonGyu-Kim c9aedbc77f fix(cli): improve doctor system check
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-10 15:53:18 +09:00
YeonGyu-Kim 785d6e2dee feat(cli): add PostHog tracking and improve runner hooks
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-10 15:53:04 +09:00
YeonGyu-Kim 33ac57ba7a refactor: update remaining modules to use plugin-identity constants
Update various modules to use centralized constants from plugin-identity:
- get-local-version/formatter: Use PUBLISHED_PACKAGE_NAME
- run/session-resolver: Use PUBLISHED_PACKAGE_NAME
- background-agent/task-poller: Use PUBLISHED_PACKAGE_NAME
- mcp-oauth/provider: Use PUBLISHED_PACKAGE_NAME
- auto-update-checker/constants: Use ACCEPTED_PACKAGE_NAMES
- comment-checker/downloader: Use PUBLISHED_PACKAGE_NAME
- legacy-plugin-toast/hook: Use PLUGIN_NAME
- shared/data-path: Use CACHE_DIR_NAME
- shared/external-plugin-detector: Use ACCEPTED_PACKAGE_NAMES
- shared/logger: Use LOG_FILENAME
- tools/ast-grep/downloader: Use PUBLISHED_PACKAGE_NAME
- tools/call-omo-agent/tools: Use PUBLISHED_PACKAGE_NAME
- tools/delegate-task/category-resolver: Use PUBLISHED_PACKAGE_NAME
- tools/grep/constants: Use PUBLISHED_PACKAGE_NAME
- tools/grep/downloader: Use PUBLISHED_PACKAGE_NAME
- tools/lsp/lsp-client-wrapper: Use PUBLISHED_PACKAGE_NAME

🤖 Generated with assistance of OhMyOpenCode
2026-04-10 11:16:16 +09:00
YeonGyu-Kim 41b9b4d724 refactor(doctor): use plugin-identity constants for package names
Update doctor checks to use centralized constants from plugin-identity:
- PACKAGE_NAME now references PUBLISHED_PACKAGE_NAME
- System check uses PLUGIN_NAME and LEGACY_PLUGIN_NAME for plugin
  registration validation and legacy name detection
- Formatters updated for consistency

🤖 Generated with assistance of OhMyOpenCode
2026-04-10 11:16:08 +09:00
YeonGyu-Kim 58a981e07b fix(cli): use published package name in installer help text
Update CLI installer to show oh-my-opencode (published name) instead
of oh-my-openagent (plugin name) in usage instructions.

🤖 Generated with assistance of OhMyOpenCode
2026-04-10 11:15:59 +09:00
YeonGyu-Kim 6bde5e6f4c feat(doctor): support both package names in version detection
Update systemLoadedVersion check to detect installs under both
oh-my-opencode and oh-my-openagent package names. Adds package
candidate selection logic for dual-published packages.

🤖 Generated with assistance of OhMyOpenCode
2026-04-10 11:15:55 +09:00
YeonGyu-Kim 87ddb9baf3 feat(cli): integrate legacy config migration into write-omo-config
Update writeOmoConfig to detect and migrate legacy config files before
writing. Adds logic to handle oh-my-opencode.json -> oh-my-openagent.json
migration with proper path resolution and fallback handling.

🤖 Generated with assistance of OhMyOpenCode
2026-04-10 11:15:51 +09:00
YeonGyu-Kim 2083cb0710 feat(agents): add centralized GPT apply_patch permission guard
Extract hardcoded GPT apply_patch permission logic into a reusable module
to ensure consistent behavior across all agents. This prevents GPT models
from using the unreliable apply_patch tool while allowing other models.

- Add gpt-apply-patch-guard.ts with GPT_APPLY_PATCH_GUIDANCE and getGptApplyPatchPermission
- Update Hephaestus agent to use centralized permission logic
- Update Sisyphus-Junior agent to use centralized permission logic
- Update all GPT prompt builders to reference shared guidance constant

🤖 Generated with assistance of OhMyOpenCode
2026-04-10 10:47:27 +09:00
YeonGyu-Kim defe4e511c Merge remote-tracking branch 'origin/dev' into fix/doctor-custom-providers-rebased 2026-04-09 11:03:12 +09:00
YeonGyu-Kim 6d8d82d760 fix(installer): enforce minimum OpenCode version check during install
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 17:20:00 +09:00
YeonGyu-Kim 389b194fbf fix(installer): actually upgrade pinned plugin version instead of preserving old entry
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 17:19:52 +09:00
YeonGyu-Kim cdd6e88557 fix(installer): add upgrade path safety checks
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:26:33 +09:00
YeonGyu-Kim 01f7d5e2a8 feat(installer): export version compatibility and backup utilities
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:26:29 +09:00
YeonGyu-Kim 2f86a17516 feat(installer): add config backup utility for safe upgrades
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:26:27 +09:00
YeonGyu-Kim 7022a7e85d feat(installer): add version compatibility checking utilities
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:26:26 +09:00
YeonGyu-Kim a09b905b18 fix(installer): add installedVersion to DetectedConfig type
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:26:22 +09:00
YeonGyu-Kim b7d9521a39 feat(installer): add opencode v1.4.0 minimum version check
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:13:03 +09:00
YeonGyu-Kim 76239972c2 fix(doctor): include custom providers from opencode.json in provider check
The doctor's 'Model override uses unavailable provider' check only
looked at providers from ~/.cache/opencode/models.json (built-in
providers from models.dev). Custom OpenAI-compatible providers defined
in the user's opencode.json (under the 'provider' key) were not
included, causing false-positive warnings.

Now loadAvailableModelsFromCache() also reads provider names from
~/.config/opencode/opencode.json and ~/.config/opencode/opencode.jsonc,
merging them with the cache providers. This eliminates the false
positive while preserving real warnings for truly unknown providers.

7 new tests cover: cache-only, custom-only, merged, deduplicated,
JSONC variant, and malformed config resilience.

Fixes #3199
2026-04-07 20:24:03 +09:00
YeonGyu-Kim bb1bad8e02 fix(cli): include fallback_models when writing agent model config (#3144)
Installer now generates fallback_models array alongside explicit model
overrides, preserving the fallback chain.

46 tests pass, tsc clean.

Closes #3144
2026-04-07 15:39:21 +09:00
YeonGyu-Kim f8c626086e fix(agent-names): use HTTP-header-safe display names and config keys for API calls (#3138)
Display names with parentheses like 'Atlas (Plan Executor)' cause HTTP
header validation errors in x-opencode-agent-name. This was blocking
Atlas/Prometheus from working via /start-work and auto-retry.

Changes:
- Display names: parens -> dashes ('Atlas - Plan Executor')
- Hooks (start-work, no-hephaestus-non-gpt, no-sisyphus-gpt): use
  config keys ('atlas', 'sisyphus', 'hephaestus') for agent API fields
- auto-retry: use config key instead of display name for promptAsync
- agent-override-protection: handle dash-suffix normalization
- Updated all test expectations to match new format

Closes #3138
2026-04-07 10:08:04 +09:00
YeonGyu-Kim 0de7453349 fix(tests): fix globalThis.fetch pollution between test files
- install.test.ts: save and restore globalThis.fetch in beforeEach/afterEach
  to prevent leaking a mock fetch (without .preconnect) into subsequent test files
- provider.test.ts: guard against originalFetch missing .preconnect when captured
  from a leaked mock (defensive null-safe binding)
- discovery.test.ts: add writable:true to all Object.defineProperty fetch assignments
  so downstream plain assignments (globalThis.fetch = ...) are not silently ignored

Root cause: install.test.ts set globalThis.fetch = mock(...) inside test bodies
without restoring it, leaving a mock fetch (no .preconnect method) that caused
provider.test.ts refresh tests to throw TypeError at the fetchMock construction
2026-04-06 18:20:37 +09:00
YeonGyu-Kim 9438c89c1c Merge pull request #3148 from MoerAI/fix/remove-installer-subscription-upsell
fix(cli): replace subscription upsell with informational note (fixes #3069)
2026-04-06 16:43:35 +09:00
YeonGyu-Kim bd723b5163 fix(tests): repair test regressions from zod v3 downgrade
- Fix zod/v4 imports in background-task schema tests
- Remove ZWSP prefix from agent-key-remapper test (fixed in #3136)
- Use toMatchObject for openai-only catalog tests (fallback_models added by #3144)
- Replace z.toJSONSchema (zod v4) with zodToJsonSchema (zod v3 compat)
- Fix task-list.ts type narrowing for zod v3 inferred types
2026-04-06 14:43:19 +09:00
YeonGyu-Kim 4659f14ce3 fix(tests): update model-fallback snapshots after installer fallback chain fix 2026-04-06 14:21:32 +09:00
YeonGyu-Kim f69bb45662 fix(cli): dedupe generated installer fallback models
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 13:25:58 +09:00
YeonGyu-Kim 57b152994f fix(cli): preserve installer fallback chains in generated config (#3144)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 13:25:58 +09:00
YeonGyu-Kim ed3045cca4 fix(test): register session agent in boulder continuation tests for CI isolation
Tests relied on leaked agent registration from other tests when run locally.
In CI, each test batch runs in isolation so the session agent was null,
causing getLastAgentFromSession to return null and the test to incorrectly
pass (return true instead of false).
2026-04-06 11:56:07 +09:00
MoerAI 2f10ff4605 fix(cli): replace subscription upsell with informational note (fixes #3069) 2026-04-06 10:09:13 +09:00
YeonGyu-Kim d143d2dfa6 feat(run): integrate session origins and agent detection into continuation state
- Update continuation-state to use session_origins from boulder state
- Add isTrackedDescendantSession helper for lineage detection
- Integrate getLastAgentFromSession for reliable agent detection
- Update completion tests for new lineage-aware continuation logic
- Add JSON backend tests for continuation state

🤖 Generated with assistance of OhMyOpenCode
2026-04-05 18:32:13 +09:00
YeonGyu-Kim d12c74120d feat(run): integrate session origins and agent detection into continuation state
- Update continuation-state to use session_origins from boulder state
- Add isTrackedDescendantSession helper for lineage detection
- Integrate getLastAgentFromSession for reliable agent detection
- Update completion tests for new lineage-aware continuation logic
- Add JSON backend tests for continuation state

🤖 Generated with assistance of OhMyOpenCode
2026-04-05 17:18:10 +09:00
YeonGyu-Kim 97ccbf1da3 test: add comprehensive tests for boulder lineage and completion
Add tests for descendant session detection, agent mismatch handling,
background task retry logic, and start-work functionality.

🤖 Generated with assistance of OhMyOpenCode
2026-04-05 15:34:22 +09:00
YeonGyu-Kim 24ca704821 feat(run): implement boulder lineage detection in continuation state
Make getContinuationState async to support client-side lineage checks.
Add hasActiveBoulderContinuation with agent eligibility verification
and subagent session tracking for proper boulder session inheritance.

🤖 Generated with assistance of OhMyOpenCode
2026-04-05 15:34:02 +09:00
YeonGyu-Kim d7c2b6249b fix(config): fall back to legacy path when migration fails and use canonical basename everywhere (#3133)
Root cause: loadPluginConfig() unconditionally switched userConfigPath to the
canonical name after calling migrateLegacyConfigFile(), even when migration
failed (e.g. file lock on Windows, permission denied). This left the config
path pointing to a non-existent file, so the plugin config silently loaded
as empty defaults.

Additionally, several fallback/default paths were hardcoded to the legacy
'oh-my-opencode' basename instead of using CONFIG_BASENAME ('oh-my-openagent'),
causing CLI config commands (writeOmoConfig, detectCurrentConfig) to write to
the wrong filename.

Changes:
- plugin-config.ts: check migrateLegacyConfigFile() return value; only switch
  to canonical path if migration succeeded OR the canonical file already exists
- opencode-config-dir.ts: use CONFIG_BASENAME for omoConfig path in
  getOpenCodeConfigPaths()
- config-context.ts: getOmoConfigPath() now uses detectPluginConfigFile() to
  find whichever name variant actually exists on disk
- plugin-config.ts: default fallback paths use CONFIG_BASENAME instead of
  hardcoded legacy name
- Added test: loadPluginConfig still loads config when migration fails
  (read-only directory simulation)
2026-04-05 14:27:24 +09:00
YeonGyu-Kim 7b7526e2f6 docs(src): update counts across tools, features, config, cli AGENTS.md
- tools: 15 -> 16 dirs, writing model kimi-k2p5 -> gemini-3-flash
- features: builtin skills 6 -> 8 (+review-work, +ai-slop-remover)
- config: schema files 24 -> 27 (+git-env-prefix, model-capabilities, openclaw)
- cli: commands 5 -> 6 (+refresh-model-capabilities)
- plugin-handlers: 13 -> 14 non-test files
- shared: 95+ -> 100+ utility files
2026-04-05 14:12:31 +09:00
YeonGyu-Kim 852859ed9c refactor(config-manager): remove legacy config path detection and migration logic
🤖 Generated with assistance of OhMyOpenCode
2026-04-05 11:24:10 +09:00
YeonGyu-Kim 98c2f92251 refactor: convert config path constants to getter functions for dynamic OPENCODE_CONFIG_DIR support
🤖 Generated with assistance of OhMyOpenCode
2026-04-05 11:24:10 +09:00
YeonGyu-Kim f22935cb28 Config-manager: migrate legacy OMO config path 2026-04-05 11:24:10 +09:00
YeonGyu-Kim 130f4ac080 fix: resolve #3124 #3125 #3127 session tools, cache priming, and compaction loop
- #3124: Session tools now merge SDK and file-backed sessions for SQLite backend
- #3125: Cache priming fixed for OpenCode >=1.3.14 empty workspace
- #3127: Activity-based progress detection prevents infinite compaction on Kimi/Minimax

All 29 new tests pass, 4885 total tests passing.
2026-04-05 09:30:19 +09:00
YeonGyu-Kim f3840a7325 Merge pull request #2843 from code-yeongyu/refactor/model-alias-pattern-matching
refactor(aliases): migrate to pattern-based model alias resolution
2026-04-04 20:34:38 +09:00
YeonGyu-Kim 032f23a4d9 test(mcp-oauth): remove provider module mock leak 2026-04-04 19:33:17 +09:00
YeonGyu-Kim 92ba31272d Fix mock isolation in system.test.ts by moving mocks to importFresh
- Move mock.module() calls from top-level into importFreshSystemModule()
- Restore real modules in afterAll to prevent cross-test contamination
- Reset mocks before each test

🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
2026-04-04 18:56:29 +09:00
YeonGyu-Kim 8c06c8e2fe fix(test): make runner env setup test deterministic
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-04 17:45:26 +09:00
YeonGyu-Kim 179ad05f5f fix(test): silence expected oauth logout cli output
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-04 17:45:26 +09:00
YeonGyu-Kim fb7e3fd98d fix(test): silence expected oauth login cli output
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-04 17:45:26 +09:00