Commit Graph

4813 Commits

Author SHA1 Message Date
YeonGyu-Kim 8276eb6c53 Merge pull request #4121 from mguttmann/fix-4119
fix(delegate-task): default run_in_background and load_skills instead of throwing (fixes #4119)
2026-05-21 00:01:12 +09:00
YeonGyu-Kim 3e9c3f8ada Merge pull request #4146 from LYY/fix/skill-shortname-fallback
fix: support unambiguous short skill names in delegated skill loading
2026-05-20 23:42:44 +09:00
YeonGyu-Kim 2fd627144a Merge remote-tracking branch 'origin/dev' into dev 2026-05-20 23:41:09 +09:00
YeonGyu-Kim 791825fc20 Merge pull request #4153 from MoerAI/fix/fallback-model-string-guard
fix(shared,delegate-task,claude-code-agent-loader): guard model parsers against non-string input (fixes #4145)
2026-05-20 23:40:33 +09:00
YeonGyu-Kim e246965789 Merge pull request #4154 from MoerAI/fix/todo-description-override-fires
fix(plugin): wire tool.definition handler so todo-description-override actually fires (fixes #3705)
2026-05-20 23:38:51 +09:00
YeonGyu-Kim b463acda72 Merge pull request #4171 from MoerAI/fix/multimodal-looker-tool-usage-guidance
fix(agents): declare multimodal-looker tool allowlist in prompt to prevent death loop on small VL models (fixes #4116)
2026-05-20 23:36:10 +09:00
YeonGyu-Kim eea27d6f7e fix(mcp): resolve local mcp runtimes
Resolve built-in local MCP runtime executables before handing command arrays to OpenCode so lsp and ast_grep do not depend on a bare node or bun lookup in the host PATH.

Keep source, dist, bootstrap, workspace-safety, and disabled_mcps behavior covered by focused tests and real OpenCode MCP status QA.

Plan: plans/fix-built-in-mcp-runtime-executables.md
2026-05-20 23:33:32 +09:00
YeonGyu-Kim 37be0d5691 Merge pull request #4174 from MoerAI/fix/cli-setup-alias-for-install
fix(cli): add 'setup' as an alias for the install command (fixes #4112)
2026-05-20 23:31:41 +09:00
YeonGyu-Kim fd6a7aed17 Merge pull request #4176 from jangByeongHui/fix/skill-mcp-env-allowlist-bypass-3995
fix(skill-mcp-manager): trust explicit skill MCP env vars (#3995)
2026-05-20 23:09:12 +09:00
YeonGyu-Kim 1e42c61026 fix(todo-continuation): normalize prompt agent
Todo continuation could reinject with a lowercase built-in config key such as hephaestus when no registered alias was available. OpenCode prompt dispatch expects the prompt-facing agent name, so the continuation failed with an agent-not-found error.

Normalize the dispatch fallback through the existing prompt agent display-name resolver and pin the lowercase Hephaestus regression.
2026-05-20 23:07:52 +09:00
YeonGyu-Kim 32f0e1e0af Merge pull request #4186 from lang-911/feat/grok-reasoning-effort
fix(model-heuristics): register Grok family so reasoningEffort survives on @ai-sdk/openai
2026-05-20 22:05:22 +09:00
YeonGyu-Kim 5a6955053b Merge pull request #4206 from jeongjin0/fix/session-ready-background-tasks
fix(notification): suppress ready alerts during background tasks
2026-05-20 19:44:46 +09:00
YeonGyu-Kim 69e7ab4723 Merge pull request #4083 from PeterPonyu/fix/3724-slash-command-content-duplicated 2026-05-20 19:07:18 +09:00
YeonGyu-Kim 4611856176 Merge pull request #4172 from MoerAI/fix/team-mode-base-dir-chmod-eperm 2026-05-20 18:59:59 +09:00
YeonGyu-Kim fbcc1435e2 fix(runtime-fallback): recognize completion progress events 2026-05-20 18:19:26 +09:00
YeonGyu-Kim 330e437f08 docs(agents): regenerate hierarchical AGENTS.md for 2026-05-20
Sync the AGENTS.md hierarchy to current code state:

Drift fixes in 11 existing files
- Root: 2026-05-20 commit 39aadbf9f, ~2167 TS files, 120 barrel index.ts,
  57 src/hooks dirs, 297 (179 non-test) src/shared files, 11 OpenCode hook
  handlers in plugin-interface.ts, packages list adds ast-grep-mcp + rules-core,
  first-prompt-watchdog 206 LOC, parent-wake-notifier 587 LOC
- src/AGENTS.md: file counts, plugin-interface handler count
- src/shared/AGENTS.md: title + counts 278/170 -> 297/179
- src/hooks/AGENTS.md: 57 dirs, note unwired WIP (task-reminder,
  hashline-edit-diff-enhancer)
- src/features/AGENTS.md: module map with NON-TEST counts + sub-AGENTS.md
  column, 7 modules without sub-doc
- src/features/background-agent/AGENTS.md: add 12 newer files (parent-wake-
  notifier 587 LOC, loop-detector, error-classifier, fallback-retry-handler,
  process-cleanup, subagent-spawn-limits, session-status-classifier,
  compaction-aware-message-resolver, etc.)
- src/plugin/AGENTS.md: 11 handlers, add system-transform.ts + command-
  execute-before.ts + build-team-idle-wake-hint-client.ts
- src/config/AGENTS.md: note schema/internal/permission.ts
- src/cli/AGENTS.md: 8 commands including 'version'
- src/plugin-handlers/AGENTS.md, packages/web/AGENTS.md: date bump

New AGENTS.md in 4 directories
- packages/AGENTS.md: index of 15 packages (11 platform binaries + 2 MCP
  packages + rules-core + web), role map, conventions
- docs/AGENTS.md: WHERE TO LOOK table for 19 docs across 6 subdirs
- .opencode/AGENTS.md: 5 skills + 4 slash commands + relationship to .agents/
- .agents/AGENTS.md: superset migration target (9 skills + 4 commands)
2026-05-20 17:18:44 +09:00
YeonGyu-Kim 39aadbf9f0 fix(context-recovery): handle idle sessions 2026-05-20 17:02:18 +09:00
신정진 60a23a557e fix(notification): suppress ready alerts during background tasks
Gate idle ready notifications on the existing background-task continuation marker so cmux does not receive premature ready alerts while delegated work is still active.

Constraint: Reuse marker state from background task lifecycle without adding new notification config

Rejected: Patch cmux directly | notification readiness belongs upstream in OMO

Confidence: high

Scope-risk: narrow
2026-05-20 16:40:45 +09:00
YeonGyu-Kim b24dc6eeb8 fix(rules-core): isolate package + block symlink escape from rule sources
- Drop the back-import of src/shared/logger so @oh-my-opencode/rules-core
  stays free of host-adapter dependencies (ROADMAP package layering
  invariant). Expose setSisyphusRuleDeprecationLogger(logger) for hosts to
  inject their own logger; default is a noop.
- Wire the host injection in src/hooks/rules-injector/rule-file-finder.ts
  as a module-level side effect so existing behavior is preserved.
- Add realpath boundary check to findRuleFilesRecursive and
  validFileRealPath. Project rule scanners now refuse entries whose
  realpath escapes the rule-source root, closing the symlink-escape
  vector where a malicious repo could point .github/copilot-instructions.md
  (or any .omo/rules/* entry) at ~/.ssh/id_rsa and have the rule injector
  pull the secret into model context.
2026-05-20 15:29:16 +09:00
YeonGyu-Kim 89f6902617 Merge pull request #4205 from code-yeongyu/fix/comment-checker-apply-patch-payloads
fix(comment-checker): handle apply_patch payloads
2026-05-20 15:28:35 +09:00
YeonGyu-Kim 3bd6302021 fix(comment-checker): handle apply_patch payloads
Accept apply_patch edits from nested result/metadata file lists and from raw patchText args when OpenCode does not provide direct metadata.files.

Forward tool args through the after-hook pipeline so comment-checker can inspect raw apply_patch inputs while preserving existing write, edit, and multiedit routing.

Tests: bun test src/hooks/comment-checker/hook.apply-patch.test.ts src/hooks/comment-checker/hook.before-after.test.ts src/plugin/tool-execute-after.test.ts

Tests: bun test src/hooks/comment-checker

Tests: bun run typecheck

Tests: bun run build
2026-05-20 15:21:12 +09:00
YeonGyu-Kim 0ebba9eba1 fix(rules-injector): retry storage writes after cleanup race
The full Bun suite can remove the shared rules-injector storage directory between a parent-directory check and the file write. Save operations now create the directory immediately before writing and retry once if ENOENT still wins the race.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 14:35:28 +09:00
YeonGyu-Kim 4a72729acc fix(plugin): run idle hooks for synthetic status idle
OpenCode now treats session.status idle as the durable completion boundary, but the plugin only dispatched the synthetic session.idle through the main hook chain. Idle-only side effects such as tmux forwarding and team member idle continuations were skipped.

Route synthetic idle through the same idle-only hook path used by real session.idle events and pin the behavior with a regression test.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 14:35:28 +09:00
YeonGyu-Kim fbe423a2d4 feat(rules-injector): hydrate dedup cache from session transcript
Ports the codex-rules transcript-aware dedup strategy: when a session cache is fresh (process restart or compaction-cleared cache), the injector now scans prior tool outputs for the `[Rule: <relativePath>]` banner and pre-populates the cache so duplicate rule injections are suppressed even when the persistent JSON has been lost. Hydration runs at most once per session per process, fails open on transport errors, and is short-circuited when the same banner reappears.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:58:13 +09:00
YeonGyu-Kim c6dc266f2f test(test-isolation): add diagnostic regression test for cross-suite leak
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:34:24 +09:00
YeonGyu-Kim 504a7779e7 Merge pull request #4200 from code-yeongyu/fix/rules-core-restore-sisyphus-with-deprecation-warning
fix(rules-core): restore .sisyphus/rules discovery with deprecation warning (planned removal v4.3.0)
2026-05-20 13:24:31 +09:00
YeonGyu-Kim 53ddc470e3 test(rules-injector): align duplicate-cache mock types
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:24:24 +09:00
YeonGyu-Kim 11d2cfb8a8 fix(background-agent): re-enqueue parent wake on same-source reservation instead of dropping
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:24:08 +09:00
YeonGyu-Kim ee8b80a5e2 test(background-agent): add red test for parent-wake drop on same-source reservation hold (BUG-E)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:24:08 +09:00
YeonGyu-Kim 1f9a581e70 fix(rules-core): fall back to workspace directory when no project root marker is found
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:20:47 +09:00
YeonGyu-Kim 4c7d7e8c2b Merge pull request #4197 from code-yeongyu/fix/prompt-gate-event-shapes-and-finish-marker
fix(runtime-fallback,prompt-gate): recognize all OpenCode progress event shapes and boolean/completed finish markers
2026-05-20 13:19:46 +09:00
YeonGyu-Kim f8f4b572dc fix(runtime-fallback,prompt-gate): recognize all OpenCode progress event shapes and boolean/completed finish markers
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:12:06 +09:00
YeonGyu-Kim 20efb79fbf test(runtime-fallback,prompt-gate): add red tests for event-shape and finish-marker blind spots (BUG-C+D)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:12:06 +09:00
YeonGyu-Kim da5aa7f32e test(team-mode): allow reclaimed reservations to stay readable
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:05:57 +09:00
YeonGyu-Kim f79da77fe0 test(team-mode): decouple resume history fixture from session routing
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 13:00:48 +09:00
YeonGyu-Kim af42f0ac70 test(team-mode): stabilize resume stale reservation history check
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 12:52:00 +09:00
YeonGyu-Kim 655dffbc2a fix(team-mode): release reservation on ambiguous failure, commit on success-path mark failure
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 12:30:02 +09:00
YeonGyu-Kim 7adb833609 test(team-mode): add red tests for ambiguous delivery loss (BUG-A + BUG-B)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 12:28:40 +09:00
YeonGyu-Kim 847a8db2dc fix(runtime-fallback): preserve accepted pending retries 2026-05-20 11:42:46 +09:00
YeonGyu-Kim 6df148f0f6 fix(team-mode): close peer message delivery races 2026-05-20 11:42:38 +09:00
YeonGyu-Kim d3e218f912 fix(prompt): treat post-dispatch failures as accepted 2026-05-20 11:42:32 +09:00
YeonGyu-Kim b2918fd4db fix(team-mode): close peer message delivery races 2026-05-19 19:18:13 +09:00
YeonGyu-Kim bcea4a9d28 fix(prompt-gate): harden sync and team prompt dispatch 2026-05-19 19:18:13 +09:00
YeonGyu-Kim 1492bffd20 fix(prompt-gate): harden internal prompt dispatch 2026-05-19 19:18:13 +09:00
lang-911 8b097f2c3b fix(model-heuristics): register Grok family with reasoningEffort support
Grok model IDs (e.g. `grok-4.3`, `grok-3-mini`) were missing from `HEURISTIC_MODEL_FAMILY_REGISTRY`, so `resolveCompatibleModelSettings` returned an "unknown family" result for them.

The `chat.params` hook treats unknown families as "no reasoning support" and deletes `output.options.reasoningEffort` before the request leaves the plugin, so users routing Grok via OpenAI-compatible endpoints never saw their reasoning effort forwarded — even with `forceReasoning: true`.

Add a `grok` family entry that includes any model ID containing "grok", exposes `low | medium | high` variants, and sets `reasoningEfforts` so the heuristic surfaces the same capability flag used by the `chat.params` hook. Extend the family table-driven test in `model-settings-compatibility.test.ts` to cover `grok-4.3`.
2026-05-19 02:44:38 -07:00
Claude Agent 9b151a2551 fix(delegate-task): address Oracle review on PR #4121 — preserve explicit-null reject + rewrite continuation test
Two blockers from the maintainer's Oracle review on PR #4121:

Blocker 1 — load_skills=null should still throw, omitted should default

The previous PR collapsed both `loadSkills === undefined` and
`loadSkills === null` into a silent default of `[]`. The closing
rationale of PR #1663 (which reverted PR #1493) and the maintainer's
review both call out the importance of preserving the distinct
"omitted -> default, explicit invalid -> throw" contract. `null`
strongly signals "I tried to pass something and it was wrong";
silently coercing it hides bugs upstream.

Restored the split: `undefined` -> default `[]` + log,
`null` -> throw with the historical error string.

Blocker 2 — task_id continuation test rewritten, not deleted

The original PR removed the `task_id without run_in_background ->
throws` test entirely. The behavior IS preserved (default false ->
`isExplicitSyncRun` true -> `executeSyncContinuation`), but with the
test gone the new contract was unprotected.

Added a regression test that asserts the new contract: when
`task_id` is present and `run_in_background` is omitted,
`tool.execute` must route through sync continuation without throwing
the legacy required-parameter error. Mocks include `session.abort`
because the sync poller calls it during shutdown.

Also flipped the existing `load_skills=null` regression test from
"normalizes to []" back to "throws with the legacy error string" to
match the restored contract.

Tests:
- bun test src/tools/delegate-task/tools.test.ts -> 132/132 pass
- bun test src/tools/delegate-task/ -> 406/406 pass
- bun run typecheck -> clean
2026-05-19 09:13:08 +02:00
Claude Agent 2f16a7da9f fix(delegate-task): default run_in_background and load_skills instead of throwing (fixes #4119)
Sisyphus and other delegators occasionally invoke the task() tool without
an explicit run_in_background or load_skills argument. The runtime
validators in tool-argument-preparation.ts threw a hard Error in that
case, which short-circuited tool.execute() entirely. Because OpenCode's
tool.execute.after hook only runs on returned results, the
delegate-task-retry hook never had a chance to attach corrective
guidance — so the model saw a raw failure and either burned several
retries or fell back to a synchronous Explore call, silently losing
parallel execution.

Behavior change:
- run_in_background omitted -> defaults to false (sync delegation), with
  a log entry for observability.
- load_skills omitted or null -> normalized to [] with a log entry on
  the explicit-null path.
- The Zod schema entries are now .optional() and their .describe()
  strings declare the defaults honestly; the markdown tool description
  was updated to match (no more 'REQUIRED' lie).

The orthogonal validation 'Must provide either category or
subagent_type.' is unchanged and still surfaces as a returned error.

Tests:
- The five throw-on-missing tests in tools.test.ts are rewritten to
  assert the new default-and-proceed contract.
- The 'no category, no subagent_type' test now asserts the
  missing-target error remains intact.

Refs the workaround the reporter validated in the original issue body;
matches the design from PR #2375 which was previously reverted by
566031f4.
2026-05-19 09:13:08 +02:00
YeonGyu-Kim 3dd414226b fix(rules): drop legacy sisyphus rule sources 2026-05-19 14:27:48 +09:00
YeonGyu-Kim 7db3a7f933 fix(team-mode): preserve live delivery holds after ambiguous prompt failure 2026-05-19 13:49:01 +09:00
YeonGyu-Kim bb75751410 fix(babysitter): avoid double prompt gate 2026-05-19 13:48:55 +09:00