Commit Graph

3940 Commits

Author SHA1 Message Date
YeonGyu-Kim 6dc2234d89 fix(shared): memoize detectPluginConfigFile per process
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:12:55 +09:00
YeonGyu-Kim 948343ab66 test(shared): cover detectPluginConfigFile memoization
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:12:50 +09:00
YeonGyu-Kim 76e8508fa4 fix(runtime-fallback): inject pluginConfig and defer cleanup interval to first event
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:12:41 +09:00
YeonGyu-Kim 3d4299445e fix(auto-update-checker): defer npm registry check until first idle
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:12:37 +09:00
YeonGyu-Kim 4f59e91d2d test(todo-continuation-enforcer): cover lazy prune interval
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:11:50 +09:00
YeonGyu-Kim 443891fdfd test(rules-injector): cover per-session cache isolation and invalidation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:11:39 +09:00
Sisyphus 79eb6c738f fix(shared/project-discovery-dirs): memoize detectWorktreePath per process 2026-04-18 14:11:24 +09:00
YeonGyu-Kim a03faaa278 test(auto-update-checker): cover deferred update check
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:11:17 +09:00
Sisyphus bcd7b8e348 fix(rules-injector): memoize project-root lookup per process lifecycle
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:11:14 +09:00
Sisyphus 886ef82494 perf(directory-readme-injector): migrate sync FS to fs.promises
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:11:03 +09:00
YeonGyu-Kim a4c45e2770 fix(write-existing-file-guard): defer realpath/existsSync to first tool call
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:11:03 +09:00
YeonGyu-Kim 3cb1d5d936 test(claude-code-command-loader): cover excluded dirs and per-directory cache
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:10:49 +09:00
YeonGyu-Kim ac2686ffde fix(shared): memoize loadOpencodePlugins by directory
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:10:45 +09:00
YeonGyu-Kim 7be6ab4478 fix(tools/slashcommand): skip EXCLUDED_DIRS in recursive command discovery
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:10:26 +09:00
YeonGyu-Kim d8e00ebfbc test(runtime-fallback): cover pluginConfig DI and lazy interval
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:10:25 +09:00
YeonGyu-Kim 51f1fc1df3 perf(directory-agents-injector): migrate sync FS to fs.promises
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:10:18 +09:00
YeonGyu-Kim a6e3c6a5ed test(write-existing-file-guard): cover lazy canonical path init
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:10:12 +09:00
YeonGyu-Kim 9677c7daf3 test(directory-agents-injector): cover async migration
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:10:12 +09:00
Sisyphus 3717121b0d test(directory-readme-injector): cover async migration
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:10:04 +09:00
YeonGyu-Kim 428bae632c test(shared): cover loadOpencodePlugins memoization
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:09:46 +09:00
Sisyphus e599840fba fix(comment-checker): defer CLI download and cleanup scheduler to first tool call 2026-04-18 14:09:43 +09:00
Sisyphus 493e37bb7d test(comment-checker): cover lazy CLI init and cleanup startup 2026-04-18 14:09:38 +09:00
YeonGyu-Kim d0eda8b4bf test(tools/slashcommand): cover excluded-dir pruning during discovery
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:09:34 +09:00
Sisyphus 76945bf3c8 test(rules-injector): cover project-root-finder memoization
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 14:09:32 +09:00
Sisyphus 32598bc5e1 test(shared/project-discovery-dirs): cover worktree-path memoization 2026-04-18 14:09:17 +09:00
Sisyphus c5b7aa8e4b test(rules-injector): cover per-session scan caching behavior 2026-04-18 14:09:07 +09:00
Sisyphus 578c49f9c2 fix(rules-injector): skip EXCLUDED_DIRS in recursive rule scanner 2026-04-18 14:08:52 +09:00
Sisyphus d566d69c37 test(rules-injector): add regression coverage for excluded-dir pruning 2026-04-18 14:07:58 +09:00
Sisyphus 49c7d4dbf9 chore(shared): add EXCLUDED_DIRS constant for recursive FS scans
Introduces a frozen Set<string> of directory basenames (node_modules, .git,
dist, build, .next, .sisyphus, .omx, .turbo, coverage, out, .cache,
.vscode-test, target, .local-ignore) that callers performing recursive
filesystem scans should skip.

This is shared infrastructure for upcoming fixes in rules-injector,
command-discovery, and claude-code-command-loader that currently descend
into node_modules and other junk directories, causing slow plugin init
and slow edit loops when the plugin is launched in-tree.
2026-04-18 14:04:45 +09:00
YeonGyu-Kim 1a8f60b89e Merge pull request #3488 from chan1103/fix/explore-allow-lsp-ast-grep
fix(explore): allow LSP and ast-grep tools
2026-04-18 03:28:10 +09:00
YeonGyu-Kim f1268c0448 feat(team-mode): add worktree manager (optional per-member isolation) 2026-04-18 03:10:25 +09:00
YeonGyu-Kim b00e22c2b8 feat(team-mode): add core types (discriminatedUnion for members, D-41/D-42)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 03:10:25 +09:00
YeonGyu-Kim 1b5f3167eb Merge pull request #3492 from code-yeongyu/refactor/legacy-plugin-decoupling
refactor: modernize plugin entry to V1 format and decouple legacy/tightly-coupled code
2026-04-18 03:10:14 +09:00
YeonGyu-Kim 70ddc01e10 refactor: remove AI slop from refactored files
Behavior-preserving cleanup of AI-generated code smells in 5 files authored/moved by this PR:

- src/hooks/model-fallback/fallback-state-controller.ts (-47/+47 net reorganization, redundant defensiveness removed)
- src/shared/model-string-parser.ts (-4 LOC obvious-comment cleanup)
- src/shared/ripgrep-cli.ts (-13 LOC obvious comments + redundant defensive checks)
- src/tools/delegate-task/tool-description.ts (-6 LOC)
- src/tools/look-at/look-at-input-preparer.ts (-6 LOC)

Targets: obvious comments that restate code, over-defensive null checks on guaranteed values, redundant existence checks. No public API signatures changed, no type hints removed, no new abstractions introduced. Full test suite still passes.
2026-04-18 03:01:51 +09:00
YeonGyu-Kim 81b37dd2cc refactor: remove cosmetic OhMyOpenCodePlugin references
Post-V1-migration cleanup of the removed symbol's ghost references:

- src/index.ts: log prefix '[OhMyOpenCodePlugin]' -> '[oh-my-openagent]'
- src/index.test.ts: describe label 'OhMyOpenCodePlugin' -> 'oh-my-openagent plugin module'
- src/index.telemetry.test.ts: describe label 'OhMyOpenCodePlugin telemetry isolation' -> 'oh-my-openagent telemetry isolation'
- src/shared/log-legacy-plugin-startup-warning.ts: log prefix '[OhMyOpenCodePlugin]' -> '[legacy-migration]' (plus matching test assertion)

After these renames 'grep -rn OhMyOpenCodePlugin src/' returns zero matches. Pure cosmetic rename, no behavior change.
2026-04-18 02:52:10 +09:00
YeonGyu-Kim e6f84f713b refactor(tools): break glob->grep sibling-tool coupling
Hoist shared ripgrep CLI resolution helpers (resolveGrepCli, resolveGrepCliWithAutoInstall, GrepBackend, DEFAULT_RG_THREADS, ResolvedCli) out of src/tools/grep/constants.ts into src/shared/ripgrep-cli.ts so they no longer straddle two sibling tool directories.

Before: src/tools/glob/constants.ts re-exported from src/tools/grep/constants.ts, violating the project's "tools should not import from sibling tools" rule enforced by .sisyphus/rules/modular-code-enforcement.md.

After: both src/tools/glob/ and src/tools/grep/ consume the shared helpers from src/shared/ripgrep-cli.ts. src/tools/grep/constants.ts keeps only the grep-specific UI-exposed constants.
2026-04-18 02:38:24 +09:00
YeonGyu-Kim 5e4102566c refactor(model-fallback): fully encapsulate session state in factory closure
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 02:35:46 +09:00
YeonGyu-Kim e2f5c0d361 refactor(plugin): remove orphaned createPluginDispose + stale test mocks
Remove the dead plugin-dispose module and its dedicated test now that V1 plugin migration removed the last production call site. Clean the remaining bootstrap test mocks so src no longer references createPluginDispose.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 02:23:55 +09:00
YeonGyu-Kim f56e3934d8 docs: update plugin entry references to V1 PluginModule shape
Sync the stale plugin entry docs with the shipped V1 PluginModule default export and remove the removed callable symbol references.\n\nUltraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)\nCo-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 02:17:25 +09:00
YeonGyu-Kim 81b68d828c refactor(model-fallback): move fallback state into factory closure and split hook.ts
Move the pending fallback, toast, and session-chain maps behind a shared controller initialized from the hook factory. This preserves the existing singleton semantics because exported helpers and hook instances still resolve the same lazily initialized controller while hook.ts stays under the 200-line limit.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 01:53:03 +09:00
YeonGyu-Kim 0d10498a11 refactor(hooks): split session-notification.ts to comply with 200 LOC module rule
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 01:52:26 +09:00
YeonGyu-Kim 0f1b16567a refactor(delegate-task): split tools.ts to comply with 200 LOC module rule
Extract the tool description/category metadata into tool-description.ts and move argument normalization plus validation into tool-argument-preparation.ts. This keeps createDelegateTask focused on orchestration while preserving behavior and bringing tools.ts under the module LOC rule.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 01:52:12 +09:00
YeonGyu-Kim db056346d2 refactor(shared): move parseModelString out of delegate-task to break cross-tool coupling
Move parseModelString into src/shared so callers can depend on a neutral module instead of reaching into delegate-task internals.

Cross-tool coupling violates module boundaries, and this keeps call-omo-agent plus runtime-fallback from importing through a sibling tool.
2026-04-18 01:51:26 +09:00
YeonGyu-Kim 1aebf39d23 refactor(hooks): split preemptive-compaction.ts to comply with 200 LOC module rule
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 01:50:41 +09:00
YeonGyu-Kim 963355d241 refactor(look-at): split tools.ts to comply with 200 LOC module rule
Extract input preparation and image conversion handling into look-at-input-preparer.ts.

Extract prompt construction and multimodal session execution into look-at-prompt.ts and look-at-session-runner.ts while keeping createLookAt stable.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 01:45:30 +09:00
YeonGyu-Kim f94632ce64 refactor(skill-mcp): split tools.ts to comply with 200 LOC module rule
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 01:43:08 +09:00
YeonGyu-Kim cb8f44ed95 refactor(ralph-loop test): clarify race-condition predicate naming
Rename the local wait predicate to avoid confusion with deprecated auth-prompt condition fields.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 01:42:01 +09:00
YeonGyu-Kim 1b10ab36d2 refactor(plugin): migrate to V1 PluginModule format
Convert the default export from the legacy callable Plugin to the V1 PluginModule shape (`{ id, server }`) documented by opencode's plugin SDK. This aligns oh-my-openagent with the canonical plugin entry format and removes plugin-format legacy debt.

Drop the module-level `let activePluginDispose` cleanup guard: opencode instantiates plugins in a scope-bound Layer per server and dynamic-imports fresh modules on reload, so module-level state is not preserved across reloads. Individual managers already register their own SIGINT/SIGTERM cleanup (skill-mcp-manager, background-agent process-cleanup), so the orphaned createPluginDispose call provided no runtime value.

Remove the non-standard `name` return field that opencode's Hooks interface does not include. The PluginModule's `id` now carries the plugin identity instead.

Drop the unused `lspManager` import that only fed the orphaned createPluginDispose.

Update src/index.test.ts and src/index.telemetry.test.ts to call `plugin.server(ctx)` instead of `plugin(ctx)`, and assert the V1 shape.
2026-04-18 01:37:46 +09:00
YeonGyu-Kim 5759a9c503 docs(agents): refresh AGENTS.md hierarchy via /init-deep
Updated root + 14 core subdirectory AGENTS.md files to reflect current
state (commit 2892ca4a on dev). Added 4 new AGENTS.md files for gap
directories: hooks/comment-checker (AI slop blocker), features/claude-
code-plugin-loader (CC compat layer), features/claude-code-mcp-loader
(tier 2 MCP loader), cli/doctor (health diagnostics with 25 check files).
2026-04-18 01:21:20 +09:00
YeonGyu-Kim 2892ca4adf fix(delegate-task): align metadata with opencode core task tool
Match opencode core 'task' tool behavior for metadata consistency:

1. Model fallback: When categoryModel/task.model/resumeModel is undefined,

   fall back to parentContext.model so subagent metadata always includes

   model info. Thread parentContext into executeSyncContinuation for parity.

2. Task ID consistency: unstable-agent-task was missing taskId and

   backgroundTaskId in metadata. background_output used inconsistent

   snake_case 'task_id' vs camelCase 'taskId' elsewhere. Standardize on

   camelCase: taskId = sessionID (resume id), backgroundTaskId = bg task id.

Update text output blocks to use buildTaskMetadataBlock helper.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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