Commit Graph

5096 Commits

Author SHA1 Message Date
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 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
YeonGyu-Kim 3a656136b6 feat(delegate-task): add resolveMetadataModel helper for model fallback
Add helper that picks primary model with fallback to a secondary model

(e.g., categoryModel → parentContext.model). Enforces consistent

{providerID, modelID} shape.

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
YeonGyu-Kim f3af23565e Merge pull request #3486 from code-yeongyu/chore/bump-claude-opus-4-7
refactor(models): bump claude-opus-4-6 to claude-opus-4-7 across fallback chains, categories, and docs
2026-04-17 15:42:38 +09:00
YeonGyu-Kim b3beea129c docs: complete claude-opus-4-7 bump in installation, matching, and overview guides
Sed-based bulk replace only touched hyphenated IDs (claude-opus-4-6)
but the tutorial prose and comparison tables used the dotted human
form 'Claude Opus 4.6' / 'Opus 4.6'. Sync those occurrences to 4.7
in:

- docs/guide/installation.md (model families table + Sisyphus tutorial)
- docs/guide/agent-model-matching.md (recommended-model table)
- docs/guide/overview.md (three references to Opus default)

Without this commit, users following the installation guide would be
told Sisyphus 'strongly recommends Opus 4.6' while the plugin itself
already routes to Opus 4.7.
2026-04-17 15:35:22 +09:00
YeonGyu-Kim 5478bab457 refactor(models): preserve legacy claude-opus-4-6 aliases and category mapping
Addresses review feedback on #3486:

1. claude-thinking-legacy-alias now matches both claude-opus-4-6-thinking
   and claude-opus-4-7-thinking, canonicalizing both to claude-opus-4-7.
   The previous diff retargeted the regex to 4-7 only, which dropped
   backward compatibility for users still pinned to the 4-6 thinking
   suffix.

2. MODEL_TO_CATEGORY_MAP keeps the claude-opus-4-6 to unspecified-high
   entry alongside the new 4-7 entry. The map is order-independent from
   MODEL_VERSION_MAP, so preserving the 4-6 key avoids relying on a
   specific migration ordering for legacy agent configs.

3. Fix stale 'Claude Opus 4.6' labels and BDD test comments that the
   sed-based bump missed.
2026-04-17 15:35:11 +09:00
YeonGyu-Kim f34a074f12 docs: bump claude-opus-4-6 to claude-opus-4-7 across docs, examples, and AGENTS.md
Syncs the README translations, CONTRIBUTING, docs/reference,
docs/guide, docs/examples JSONC configs, and the hierarchical
src/**/AGENTS.md files with the model version bump already landed
in the source and migration commits.
2026-04-17 14:52:19 +09:00
YeonGyu-Kim 4ca4c06698 refactor(migration): auto-upgrade claude-opus-4-5 and 4-6 to claude-opus-4-7
MODEL_VERSION_MAP now chains the legacy claude-opus-4-5 entry straight
to claude-opus-4-7 and adds an explicit claude-opus-4-6 to 4-7 bump
path, letting existing user configs upgrade on next load without an
intermediate 4-6 stop.

MODEL_TO_CATEGORY_MAP picks up claude-opus-4-7 as the canonical
unspecified-high model (prior 4-6 entry is covered by the chained
version map above, so legacy hardcoded configs still resolve).

Migration tests rewritten to reflect the chained 4-5 to 4-7 behavior
and the new 4-6 to 4-7 bump path, including the sidecar-union
scenario.
2026-04-17 14:52:02 +09:00
YeonGyu-Kim def44338ff refactor(models): bump claude-opus-4-6 to claude-opus-4-7 across fallback chains, categories, and hooks
Updates the canonical Anthropic Opus model in every fallback chain
(sisyphus, oracle, prometheus, metis, momus, visual-engineering,
ultrabrain, deep, artistry, unspecified-high), the unspecified-high
category default, the think-mode HIGH_VARIANT_MAP, the Claude Code
alias map, the claude-thinking legacy alias, the context-limit GA
regex, and event.ts fallback strings.

Widens supportsCachedAnthropicLimit to accept both claude-*-4-6 and
claude-*-4-7 so the 1M context cache still applies across the bump.

Regenerates the bundled model-capabilities snapshot from models.dev
and the model-fallback snapshot to match the new source output.
2026-04-17 14:51:52 +09:00
YeonGyu-Kim b1764a880c Merge pull request #3484 from code-yeongyu/fix/ci-remaining-test-fixes
fix(test): complete session_id→task_id migration in CI-breaking tests
2026-04-17 12:48:00 +09:00
YeonGyu-Kim 2fca3dced8 fix(test): complete session_id→task_id migration in test assertions
The previous PR #3481 only added a not.toContain check but left the
final toContain assertion still expecting task(session_id=...).
Also updates dynamic-agent-core-sections.ts and verification-reminders.ts
which still had session_id format after the refactor.
2026-04-17 12:47:49 +09:00
YeonGyu-Kim 3a956b2103 fix(test): align session_id→task_id across tests and source files
Several places still emitted task(session_id=...) after the refactor:
- src/hooks/atlas/verification-reminders.ts: 2 occurrences
- src/agents/dynamic-agent-core-sections.ts: buildNonClaudePlannerSection prompt

Tests updated to match: atlas index.test.ts and dynamic-agent-prompt-builder.test.ts
2026-04-17 12:46:44 +09:00
YeonGyu-Kim 28a896d093 fix(test): update dynamic-agent-prompt-builder test to expect task_id
Same session_id->task_id migration as the atlas hook test.
2026-04-17 12:46:44 +09:00
YeonGyu-Kim 843f1dbdbf Merge pull request #3483 from code-yeongyu/fix/bin-alias-oh-my-openagent
fix: add oh-my-openagent bin alias for renamed package
2026-04-17 12:42:37 +09:00
YeonGyu-Kim fec50c5d85 fix: add oh-my-openagent bin alias for renamed package
After the package was renamed from oh-my-opencode to oh-my-openagent,
the bin entry only had 'oh-my-opencode'. Users running:
  npm install -g oh-my-openagent
could not invoke 'oh-my-openagent' from the command line.

Add 'oh-my-openagent' as a second bin entry pointing to the same
bin/oh-my-opencode.js entry point. Both aliases now work.

Fixes #3482
2026-04-17 12:42:21 +09:00
YeonGyu-Kim 62d185cf72 Merge pull request #3481 from code-yeongyu/fix/atlas-test-task-id-parameter
fix(test): update atlas test to expect task_id parameter instead of session_id
2026-04-17 12:12:41 +09:00
YeonGyu-Kim 91ebffa9da fix(test): update atlas test to expect task_id parameter instead of session_id
verification-reminders.ts was updated to use task(task_id=...) but the
'should ignore extracted session ids' test still expected the old
task(session_id=...) format, causing a consistent CI failure on dev.

Fixes the pre-existing test failure unrelated to any code changes.
2026-04-17 12:12:26 +09:00
YeonGyu-Kim 22942c25da Merge pull request #3480 from code-yeongyu/fix/zod-external-bundle
fix(build): externalize zod from plugin bundle to prevent dual-instance crash
2026-04-17 12:09:03 +09:00
YeonGyu-Kim e97953e390 fix(build): externalize zod from plugin bundle to prevent dual-instance crash
When oh-my-openagent is loaded by opencode 1.4.6+, both sides ship zod v4
but as two separate instances. zod v4 uses instance-identity checks
(schema._zod.def) that fail across module boundaries, causing:
  TypeError: undefined is not an object (evaluating 'n._zod.def')

Fix:
- Add --external zod to the plugin bundle build command so the plugin
  resolves zod from opencode's runtime instead of embedding its own copy
- Move zod from dependencies to peerDependencies (^4.0.0) so package
  managers know to deduplicate on a single shared instance
- Keep zod in devDependencies so local build/test continues to work

The plugin dist/index.js no longer contains node_modules/zod/v4 internals.

Fixes #3479
2026-04-17 12:08:39 +09:00
YeonGyu-Kim 99ffb5f585 refactor(task): drop session_id resume alias 2026-04-16 23:18:38 +09:00
YeonGyu-Kim d89e257d8a refactor(task): align continuation ids with task_id 2026-04-16 23:13:44 +09:00
YeonGyu-Kim 56be458ede fix(config): remove obsolete maxDescendants config 2026-04-16 23:13:34 +09:00
YeonGyu-Kim 611f1cc932 fix(background-agent): remove descendant spawn cap 2026-04-16 23:02:27 +09:00
github-actions[bot] e2f7fbb4c7 @EnochLi15 has signed the CLA in code-yeongyu/oh-my-openagent#3473 2026-04-16 11:45:12 +00:00
YeonGyu-Kim 5c349fac06 Merge pull request #3471 from code-yeongyu/fix/copilot-effort-max
fix(anthropic-effort): clamp variant=max for github-copilot Claude models
2026-04-16 18:41:29 +09:00
YeonGyu-Kim 1ae32283ef fix(anthropic-effort): clamp variant=max for github-copilot Claude models
GitHub Copilot proxies Anthropic's API but does not support
output_config.effort: "max" (same constraint as Anthropic OAuth).

Previously the anthropic-effort hook early-returned for github-copilot
provider, skipping all effort clamping. Users on github-copilot/claude-opus-4.6
with variant=max got HTTP 400 'invalid_reasoning_effort'.

Fix: Remove the github-copilot early return. Treat github-copilot as a
constrained provider (alongside Anthropic OAuth), clamping max→high.

Rename isAnthropicOAuth→isConstrainedProvider to reflect the broader scope.

Fixes the remaining user report from #3429.
2026-04-16 18:41:09 +09:00
github-actions[bot] a5ae0b838c @omer-koren has signed the CLA in code-yeongyu/oh-my-openagent#3470 2026-04-16 06:35:11 +00:00
github-actions[bot] c9350c67fe release: v3.17.4 2026-04-16 06:27:22 +00:00
YeonGyu-Kim fe091ef2ae chore: bump version to 3.17.4 2026-04-16 15:15:58 +09:00
YeonGyu-Kim 9b72bf8e68 Merge pull request #3467 from code-yeongyu/refactor/delegate-task-metadata-hardening
refactor: harden delegate-task metadata pipeline
2026-04-16 15:12:38 +09:00
YeonGyu-Kim d612549b73 Merge pull request #3468 from code-yeongyu/fix/bugs-3429-3459
fix: installer writes hyphenated anthropic IDs, variant=max Anthropic OAuth compat
2026-04-16 14:30:10 +09:00
YeonGyu-Kim 7bc170fb86 fix: installer writes hyphenated anthropic IDs, variant=max Anthropic OAuth compat (#3429, #3459) 2026-04-16 14:28:56 +09:00
YeonGyu-Kim c6a407c486 refactor(tools): migrate producers to shared metadata bridge
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-16 13:52:20 +09:00
YeonGyu-Kim 4da3005797 fix(plugin): harden metadata recovery and extraction
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-16 13:52:12 +09:00
YeonGyu-Kim 80d3339c4c feat(background-agent): add wait-for-task-session helper
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-16 13:52:04 +09:00
YeonGyu-Kim a1842f2de7 feat(tool-metadata): add shared metadata contract and bridge
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-16 13:51:58 +09:00
github-actions[bot] 80e73f5727 @CHLK has signed the CLA in code-yeongyu/oh-my-openagent#3455 2026-04-15 13:10:42 +00:00