Commit Graph

1637 Commits

Author SHA1 Message Date
YeonGyu-Kim a6e4691fcc fix: remove duplicate local isRecord declaration (conflicts with import) 2026-05-21 03:17:52 +09:00
YeonGyu-Kim 97c73b41bf Merge pull request #3147 from EZotoff/fix/notepad-directive-scope
fix(sisyphus-junior-notepad): scope plan directive to delegated workers
2026-05-21 00:59:10 +09:00
YeonGyu-Kim 70da8ad695 Merge pull request #3600 from hackerh3/hackerh3/start-work-session-affinity
fix(start-work): prefer current session plan
2026-05-21 00:55:57 +09:00
YeonGyu-Kim f5de4bf7be Merge pull request #3498 from Disaster-Terminator/fix/task-id-prompt-surface
fix(prompts): prefer task_id in continuation guidance
2026-05-21 00:54:47 +09:00
YeonGyu-Kim 467aa13e9f Merge pull request #4064 from PeterPonyu/fix/3923-team-error-propagation
fix(team-mode): surface member error to main agent (#3923)
2026-05-21 00:42:11 +09:00
YeonGyu-Kim b76e8d2e86 Merge pull request #4077 from PeterPonyu/fix/4013-todo-continuation-enforcer-loop
fix(todo-continuation-enforcer): stop looping after all todos complete (#4013)
2026-05-21 00:38:41 +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 aa3187bfbb Merge pull request #4180 from JacobZyy/fix/plugin-hooks-merge 2026-05-21 00:14:58 +09:00
YeonGyu-Kim 3ee0209a41 Merge pull request #4113 from PeterPonyu/fix/3937-runtime-fallback-quota-patterns
fix(runtime-fallback): classify more provider quota error names
2026-05-21 00:07:08 +09:00
YeonGyu-Kim f35bb95634 Merge pull request #4114 from PeterPonyu/fix/3607-detect-shell-windows-msystem
fix(non-interactive-env): use powershell syntax on Windows regardless of SHELL/MSYSTEM (#3607)
2026-05-21 00:04:45 +09:00
JacobZyy 33f121b113 fix: add PATH to restricted hook env, protect HOME/CLAUDE_PROJECT_DIR from allowlist override, reset plugin hooks state in tests
- P1: When allowedEnvVars is provided, PATH was missing from the base
  restricted env, causing non-builtin commands to fail at exec time
- P2: Allowlisted HOME/CLAUDE_PROJECT_DIR could overwrite normalized
  values from getHomeDirectory()/cwd with ambient process.env values
- P2: Test suite mutated shared pluginHooksState singleton without
  resetting it in afterEach, causing cross-test state leaks
2026-05-20 22:49:05 +08:00
JacobZyy 0a20844bd4 fix: address PR #4180 review - security, typing, and test coverage
- Apply mcp_env_allowlist to plugin hooks: intersect HTTP allowedEnvVars
  with MCP allowlist, set command allowedEnvVars to full MCP allowlist
- Scrub process.env in executeHookCommand when allowedEnvVars provided
- Add PluginHooksState class with per-directory Map storage
- Add PluginHooksConfig interface for typed boundary layer
- Pass directory context through hook-config-handler
- Add 16 tests across 4 files (40 assertions) covering allowlist
  filtering, env scrubbing, directory isolation, and edge cases
- Remove unnecessary 'as' type assertions, use discriminated union
  narrowing instead
2026-05-20 22:30:25 +08: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 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 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 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 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 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 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 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
Evgeny Zotov 342954ca15 fix(sisyphus-junior-notepad): scope plan directive to delegated workers 2026-05-19 13:41:40 +02: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
JacobZyy 4d105d0559 fix(hooks): merge marketplace plugin hooksConfigs into claude-code-hooks at config time
Previously, loadPluginHooksConfigs() loaded plugin hooks from marketplace
plugins (hookify, superpowers, zzcommon, zzfe, etc.) into
pluginComponents.hooksConfigs, but config-handler.ts never consumed them.
This meant plugin hooks were discovered but never merged into the runtime
hooks dispatch system.

Changes:
- Extend ClaudeHookEvent and ClaudeHooksConfig to support all 12 event
  types (PostToolUseFailure, PermissionRequest, Notification,
  SubagentStart, SubagentStop, SessionStart, SessionEnd) in addition to
  the existing 5
- Add ALL_HOOK_EVENT_TYPES constant as single source of truth for event
  type iteration
- Add mergePluginHooksConfigs() to unwrap plugin HooksConfig (with hooks
  wrapper) into flat ClaudeHooksConfig, filtering out unsupported
  prompt/agent hook types
- Add setPluginHooksConfigs() to store pending plugin configs and
  invalidate the config cache
- Create applyHookConfig() handler following existing applyXxxConfig
  pattern, wired into config-handler after loadPluginComponents()
- Extend DisabledHooksConfig and mergeDisabledHooks for all 12 events

Closes #4179
2026-05-19 14:03:13 +08:00
YeonGyu-Kim 3dd414226b fix(rules): drop legacy sisyphus rule sources 2026-05-19 14:27:48 +09:00
YeonGyu-Kim 44ef5dec1d fix(runtime-events): honor OpenCode progress shapes 2026-05-19 13:48:45 +09:00
YeonGyu-Kim 38462aa9d2 fix(recovery): avoid duplicate continuation prompts 2026-05-19 13:48:39 +09:00
YeonGyu-Kim 67bd324987 fix(runtime-fallback): keep pending retry state on gate skip 2026-05-19 13:16:39 +09:00
YeonGyu-Kim 98c3fee181 fix(prompt-gate): detect finish-only tool waits 2026-05-19 13:16:39 +09:00
YeonGyu-Kim f5f358ab9d fix(prompt-gate): ignore internal user tails in tool waits 2026-05-19 13:16:39 +09:00
YeonGyu-Kim 6915f15299 fix(todo-continuation): cancel stale ULW countdown
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-19 09:18:00 +09:00
YeonGyu-Kim 4ea29e2c94 refactor(rules): delegate injectors to rules-core
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 450c1f9e50 fix(runtime-fallback): ignore stale assistant errors during fallback wait
When OpenCode reports the original assistant error after a fallback retry has already been accepted, keep waiting for the pending fallback model instead of clearing the awaiting flag.

This prevents a duplicate stale session.error from advancing the fallback chain and dispatching a second assistant retry prompt.
2026-05-18 17:48:04 +09:00
YeonGyu-Kim b9707b8469 Fix paused boulder session resolution 2026-05-18 17:18:46 +09:00
YeonGyu-Kim 881e990c42 fix(test/session-recovery): replace mock.calls[0][0] with typed accessor
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:53:43 +09:00
YeonGyu-Kim 9ddf13107d fix(test/runtime-fallback): add git_master to config fixture
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:53:13 +09:00
YeonGyu-Kim e9061731c6 fix(ralph-loop): guard verification retry ownership
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:05:36 +09:00