Commit Graph

375 Commits

Author SHA1 Message Date
YeonGyu-Kim 821ee92c2f Merge pull request #2965 from sjawhar/fix/chat-message-session-cache
fix(chat-message): refresh stale session-agent cache from explicit input.agent
2026-05-21 00:58:20 +09:00
YeonGyu-Kim 5eabeb80f9 Merge pull request #4082 from PeterPonyu/fix/3685-notepad-no-write-fallback
fix(notepad-guard): refuse Write tool for .sisyphus/notepads files (#3685)
2026-05-21 00:37:27 +09:00
YeonGyu-Kim aa5eeaf892 Merge pull request #4102 from sjawhar/fix/skill-directory-param
fix(skill): pass directory to getAllSkills + fix async test timing
2026-05-21 00:08:40 +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 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 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 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 d3e218f912 fix(prompt): treat post-dispatch failures as accepted 2026-05-20 11:42:32 +09:00
Sami Jawhar 696682e953 fix(chat-message): refresh stale session-agent cache from explicit input.agent 2026-05-19 12:24:59 +00:00
Sami Jawhar d2d1541377 fix(skill): pass directory to getAllSkills and fix async test timing 2026-05-19 12:24:59 +00: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
YeonGyu-Kim bb75751410 fix(babysitter): avoid double prompt gate 2026-05-19 13:48:55 +09:00
YeonGyu-Kim 44ef5dec1d fix(runtime-events): honor OpenCode progress shapes 2026-05-19 13:48:45 +09:00
YeonGyu-Kim 5f0e037dae fix(plugin): cover Anthropic-family prefill guard
Include Vertex Anthropic in the assistant-tail prefill guard after Cubic flagged the strict provider check. Keep the non-Anthropic opencode negative control covered by tests.

Plan: plans/fix-anthropic-assistant-prefill-tail.md
2026-05-19 12:33:22 +09:00
YeonGyu-Kim 45d670a7dc fix(plugin): constrain Anthropic prefill guard
Tighten the assistant-tail repair after review so only the Anthropic provider is treated as prefill-rejecting, and so assistant-tail model metadata is evaluated independently from the last user model.

Add regression coverage for an allowed user model followed by a rejecting Anthropic assistant tail, plus a non-Anthropic provider carrying a Claude-looking model id.

Plan: plans/fix-anthropic-assistant-prefill-tail.md
2026-05-19 12:24:37 +09:00
YeonGyu-Kim 3509bf47ae fix(plugin): guard Anthropic assistant prefill tails
Claude Opus 4.7 rejects requests whose final message is an assistant turn, because Anthropic treats that as unsupported assistant prefill. Add a transform guard that appends the existing synthetic user recovery turn only for Anthropic prefill-rejecting model IDs, while preserving assistant-prefill behavior for supported and unknown models.

Tests cover Opus 4.7, Opus 4.6 assistant metadata fallback, direct Sonnet 4.6 model fields, allowed OpenAI/Sonnet 4.5 tails, missing metadata, and compaction continuation compatibility.

Plan: plans/fix-anthropic-assistant-prefill-tail.md
2026-05-19 12:17:32 +09:00
YeonGyu-Kim d8f6d59dc2 docs: update rules and MCP inventories
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:28:12 +09:00
YeonGyu-Kim 90b3f4ac96 test: harden workspace package assumptions
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:28:12 +09:00
YeonGyu-Kim a86cc6af18 refactor(tools): remove native ast-grep tool
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:27:36 +09:00
YeonGyu-Kim c9a3c34a29 test: stabilize dependency verification
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 20:55:33 +09:00
MoerAI ed44466f33 fix(plugin): wire tool.definition handler so todo-description-override actually fires (fixes #3705)
The bundled createTodoDescriptionOverrideHook returns { 'tool.definition': fn }, but plugin-interface.ts never exposes 'tool.definition' as an OpenCode hook handler. Result: the hook is constructed by createToolGuardHooks (line 132-134 of src/plugin/hooks/create-tool-guard-hooks.ts) but the function is never invoked, so todowrite keeps using OpenCode's core 7 KB description instead of the 1.4 KB TODOWRITE_DESCRIPTION. User-defined plugins under ~/.config/opencode/plugin/*.js use the same hook contract and work fine, confirming the contract itself is functional in opencode 1.14.28+.

Fix: add src/plugin/tool-definition.ts (createToolDefinitionHandler) that forwards the OpenCode 'tool.definition' input/output pair into hooks.todoDescriptionOverride. Wire it into plugin-interface.ts alongside tool.execute.before/after.

Regression coverage: src/plugin/tool-definition.test.ts covers (a) todowrite override applied, (b) other tools left untouched, (c) null hook is a no-op.
2026-05-18 19:50:16 +09:00
YeonGyu-Kim ca3ea0bbe2 fix(messages-transform): narrow assistant-tail recovery trigger
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 15:50:23 +09:00
YeonGyu-Kim 44ee5e6ae7 test(messages-transform): lock assistant-tail continuation guard
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 15:49:09 +09:00
YeonGyu-Kim fdf7ba2e6f Merge pull request #4129 from code-yeongyu/feature/stage-c-lsp-mcp
Extract LSP tools into Tier-1 MCP server via lsp-tools-mcp submodule
2026-05-18 13:39:17 +09:00
YeonGyu-Kim 21b782de93 test(plugin): cover fresh install team mode tools
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 13:24:08 +09:00
YeonGyu-Kim 9bae873395 fix(plugin): log team tool registry state
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 13:24:08 +09:00
YeonGyu-Kim b20e2c9c55 fix: refactor 5 additional aliased output.args mutations + strengthen audit test
Address Oracle review feedback: refactor 4 aliased mutations via argsObject
in plugin/tool-execute-before.ts and 1 via toolOutput in atlas/tool-execute-before.ts.
Strengthen audit test regex to catch Output.args mutations regardless of the
variable name prefix (toolOutput, argsObject aliases).

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 13:04:10 +09:00
YeonGyu-Kim 13d8857415 refactor(hooks): replace direct output.args mutation with replaceToolArgs (question/webfetch/null-byte)
Replace Object.assign(output.args, truncatedArgs), output.args.url = resolution.url,
and output.args.command = ... .replace(/\x00/g, "") with replaceToolArgs() calls
in question-label-truncator, webfetch-redirect-guard, and plugin/tool-execute-before.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 12:46:52 +09:00
YeonGyu-Kim b149ce5331 docs: update AGENTS docs for MCP-backed LSP architecture 2026-05-18 12:24:44 +09:00
YeonGyu-Kim 48c827ffc0 test: update plugin tests for MCP-backed LSP 2026-05-18 12:22:54 +09:00
YeonGyu-Kim 8716ef458c refactor(plugin): drop lspManager lifecycle wiring 2026-05-18 12:22:54 +09:00
YeonGyu-Kim ca51f613ca refactor(tools): remove native LSP tool registry wiring 2026-05-18 12:22:54 +09:00
YeonGyu-Kim dd3fecaf40 refactor(plugin): use unified internal prompt dispatch
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-17 17:01:50 +09:00
YeonGyu-Kim 55312cc4b6 fix(session-recovery): preflight idle recovery fanout 2026-05-17 16:17:36 +09:00
YeonGyu-Kim a7b7ace7ed fix(prompt-gate): block prompts into pending tool turns 2026-05-17 15:42:58 +09:00
YeonGyu-Kim f43effb842 fix(session-recovery): recover interrupted idle tool turns 2026-05-17 15:08:39 +09:00
YeonGyu-Kim a43215f24e fix(plugin/event): bind team-idle-wake-hint client methods to SDK Session
The team-mode wiring at `createEventHandler` extracted
`pluginContext.client.session.promptAsync` and `.status` into a fresh
wrapper object. The methods were copied by reference, so the prompt-async
gate's `session.promptAsync.bind(session)` was binding to that plain
wrapper rather than the underlying SDK `Session` instance. The opencode
SDK's `promptAsync` reads `this._client.post(...)`, so production calls
threw `TypeError: undefined is not an object (evaluating 'this._client')`
on the very first dispatch — fingerprinted in /tmp/oh-my-opencode.log as
688 `background-agent-parent-wake`, 47 `model-suggestion-retry`, and 4
`team-idle-wake-hint` failures over the past three days.

Move the wrapper construction into `buildTeamIdleWakeHintClient`, which
preserves the narrow factory contract while binding both methods back to
the SDK `Session` so `_client` survives the dispatch. Cover the contract
with four BDD-style tests including the historical destructure-only
failure mode so any future regression is caught at unit-test time.
2026-05-17 02:06:52 +09:00
ZeyuFu 572c3c248e fix(notepad-guard): refuse Write tool for .sisyphus/notepads files (#3685)
Adds a new `notepad-write-guard` hook that intercepts Write tool calls
whose target path matches `**/.sisyphus/notepads/**` and throws an
actionable error instead of allowing the write to proceed.

Without this guard, an agent that hits an Edit hash-mismatch failure
could silently fall back to Write, destroying the entire history of an
append-only notepad file (decisions.md, issues.md, etc.).  The file
carries an explicit "NEVER overwrite" warning that the agent ignores
under context pressure.

The guard is path-based so it works regardless of plan name or nesting
depth.  Non-notepad `.sisyphus/**` paths (e.g. plan files) are
unaffected.  The hook is wired into `create-tool-guard-hooks` under the
hook name `notepad-write-guard` and follows the same safeCreateHook +
HookName schema pattern as every other tool-guard hook.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 06:52:43 -04:00
YeonGyu-Kim 36e373cdbb feat(workspace): point planning guardrails at omo 2026-05-16 17:41:35 +09:00
Enoch d11613999a fix tool execute after hook boundary 2026-05-15 23:37:45 +09:00
YeonGyu-Kim c580b8f2ce fix(session): ignore internal synthetic turns 2026-05-15 23:16:05 +09:00
YeonGyu-Kim 2bd4944bad fix(prompt-gate): scope reservation releases 2026-05-15 21:52:29 +09:00
rshks b504fb1deb fix(tool-pair-validator): emit schema-compatible synthetic tool results 2026-05-15 21:04:03 +09:00
YeonGyu-Kim 8dcbccf063 fix(tmux): inject pane action dependencies 2026-05-15 17:54:43 +09:00
YeonGyu-Kim 462b55efc7 Merge pull request #4040 from code-yeongyu/cleanup/typescript-ai-slop-20260515
Refactor TypeScript cleanup patterns
2026-05-15 16:42:10 +09:00
YeonGyu-Kim a9886ccbb7 refactor(plugin): remove metadata assertions
Guard optional plugin metadata and pane identifiers before passing them to cleanup and warning paths.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 16:31:13 +09:00
YeonGyu-Kim d8f52aae7f test: run suite without split runner 2026-05-15 16:26:57 +09:00