Commit Graph

1343 Commits

Author SHA1 Message Date
YeonGyu-Kim de88241ff7 feat(hooks): add team lead orphan handler with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim c16c67c26b feat(hooks): add team idle wake hint handler with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim bd768a469b feat(hooks): add team-mode status injector hook with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 7f8034c8e2 feat(hooks): add team mailbox injector hook with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 10684857e3 Merge pull request #3798 from code-yeongyu/fix/node-runtime-compat
fix(bun-spawn-shim): eliminate globalThis.Bun top-level destructures (#3797)
2026-05-06 13:33:11 +09:00
YeonGyu-Kim 4c426a53ba test(hooks): cancel idle notification timer in input-needed test 2026-05-06 11:05:35 +09:00
Paolo Notaro d800fec6b1 fix(runtime-fallback): prevent infinite loop when fallback model equals current model 2026-05-05 21:01:50 +02:00
YeonGyu-Kim e9d7dca604 fix(session-notification): tolerate shell promises without nothrow 2026-05-05 23:06:01 +09:00
YeonGyu-Kim 3ddc757b15 fix(bun-spawn-shim): eliminate globalThis.Bun top-level destructures for Electron/Node compat
Root cause: bun build --target bun inlines top-level
  var { spawn } = globalThis.Bun;
for every file that contains 'import { spawn } from "bun"'. On Node/Electron
where globalThis.Bun is undefined, this crashes with
  Cannot destructure property 'spawn' of 'globalThis.Bun' as it is undefined.
26 source files had this import; the bundled output had 25 top-level destructures.

Fix:
- Add src/shared/bun-spawn-shim.ts: a thin wrapper that
  - delegates to Bun.spawn/spawnSync when globalThis.Bun is present (real Bun)
  - falls back to static ESM imports of node:child_process otherwise
  - uses static 'import { spawn } from "node:child_process"' so Bun bundler
    does NOT emit any globalThis.Bun destructures for this module
- Replace all 26 'from "bun"' spawn/spawnSync imports with relative paths to shim
- Replace 4 direct Bun.spawn() call sites with shim's spawn()
- Remove src/electron-compat.ts and script/prepend-electron-shim.ts (no longer needed)
- Update src/electron-compat.test.ts to assert 0 top-level globalThis.Bun destructures

Verification: grep -c '} = globalThis.Bun;' dist/index.js → 0 (was 25)
All 5921 tests pass (1 pre-existing timeout failure unrelated to this change).

Fixes #3797
2026-05-05 22:41:45 +09:00
YeonGyu-Kim ef7ac52286 Merge pull request #3771 from tw-yshuang/fix/atlas-pending-continuation-race
fix(atlas): block continuation while delegated tasks are pending
2026-05-05 04:15:46 +09:00
YeonGyu-Kim e699f3388d Merge pull request #3455 from CHLK/fix/cli-run-premature-exit-with-background-tasks
fix(cli-run): prevent premature exit when background tasks are active
2026-05-04 23:58:34 +09:00
YeonGyu-Kim 9c8aab9f22 Merge pull request #3420 from grandmaster451/fix-version-comparison
fix(auto-update): use semantic version comparison instead of string e…
2026-05-04 23:58:26 +09:00
YeonGyu-Kim dd4166cb57 test(session-notification): provide chainable Bun shell mock for sender tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-04 16:30:23 +09:00
YeonGyu-Kim 700ba1e541 test(unstable-agent-babysitter): align task fixture with sessionId field
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-04 16:30:06 +09:00
YeonGyu-Kim 7fefb59a06 test(stop-continuation-guard): rename parentSessionId/parentMessageId in task fixture
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-04 16:30:06 +09:00
YeonGyu-Kim e395eadfa4 feat(ralph-loop): add loop session recovery state tracker
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2026-05-04 01:44:01 +09:00
tw-yshuang 56e4044927 fix(atlas): block continuation while delegated tasks are pending
Atlas continuation only treated running background tasks as active work. When a delegated subagent had been launched but was still waiting for session creation, the task remained pending and Atlas could inject another continuation too early.

Treat pending tasks as active background work in the continuation injector and add regression coverage for the pending-session-creation race so delegated work is allowed to acquire a session before Atlas resumes the plan.

Tests: bun test src/hooks/atlas/boulder-continuation-injector.test.ts src/hooks/atlas/index.test.ts; bun run typecheck

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-03 17:24:46 +08:00
YeonGyu-Kim da251c9b30 refactor(background-agent): normalize task ID field naming
Rename BackgroundTask and attempt ID fields to camelCase across background-agent consumers while moving BackgroundManager construction to a single config object.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-02 03:01:03 +09:00
YeonGyu-Kim 6f79968aeb Merge pull request #3701 from MoerAI/fix/context-window-monitor-pct-clamp
fix(context-window-monitor): clamp displayed context status percentages so the directive stays trustworthy (fixes #3655)
2026-05-01 19:18:40 +09:00
YeonGyu-Kim bd41344c26 Merge pull request #3708 from mrosnerr/feat/cmux-notification-provider
feat(notification): add cmux as notification provider
2026-05-01 19:18:37 +09:00
YeonGyu-Kim 586bb3f551 Merge pull request #3711 from mrosnerr/fix/notification-scheduler-platform
fix(notification): session-idle notifications never fire due to stale platform
2026-05-01 19:18:34 +09:00
YeonGyu-Kim 0c39358ebe fix(keyword-detector): require skill evaluation in analyze mode
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-01 17:18:51 +09:00
Ivan Smetanin 5291ee7d3d fix(auto-update-checker): prefer loaded module's package.json over flat-install candidates
The startup toast and `omo --version` were reading from the legacy flat install
at <CACHE_DIR>/node_modules/<pkg>/package.json, but OpenCode actually loads
plugins from a per-plugin sandbox at <CACHE_DIR>/<plugin-entry>/node_modules/
<pkg>/package.json. The two install layers can drift independently when bun
re-resolves "latest" against the flat install while the sandbox's package.json
stays pinned to a literal version baked in at first install.

In practice this means the toast can announce a version the runtime is not
running. Concrete reproduction: with `"oh-my-openagent@latest"` in the plugin
list, the sandbox stayed on 3.17.5 while the parallel flat install advanced to
3.17.6, so the startup toast confidently reported v3.17.6 even though the
loaded plugin code was 3.17.5.

Walking up from `import.meta.url` always reflects the actually-loaded module,
so reorder `getCachedVersion()` to try that first and fall back to the flat-
install candidates and execPath walk-up as before. The fallback chain is
preserved for bundled environments where the module-relative lookup may fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 09:17:21 +01:00
YeonGyu-Kim 05a15f7598 Merge branch 'dev' into fix/retry-recovery-and-observability 2026-04-29 14:54:24 +09:00
YeonGyu-Kim 6850cb6d21 Merge branch 'dev' into fix/fallback-credit-exhaustion 2026-04-29 14:38:42 +09:00
Choi Kijin / 최 기진 / チョイ キジン 7adb725960 Merge remote-tracking branch 'origin/dev' into fix/retry-recovery-and-observability 2026-04-29 12:25:02 +09:00
mrosnerr 384bc53bfd fix(notification): resolve platform in scheduler callbacks instead of using stale init value
The idle notification scheduler was initialized with platform 'unsupported'
before platform detection had run. This stale value was passed to send/playSound
callbacks, causing sendSessionNotification to silently no-op (no switch case for
'unsupported'). Session-idle notifications never fired as a result.

Fix: remove platform from scheduler options entirely. Callbacks now resolve
platform via ensureNotificationPlatform() which is sync, cached, and already
called by each event handler before scheduling.
2026-04-28 10:34:29 -04:00
Choi Kijin / 최 기진 / チョイ キジン 185665707c fix(model-fallback): clone session fallback chains
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-28 21:43:10 +09:00
mrosnerr 763ff7e824 feat(notification): add cmux as notification provider
Add cmux as the highest-priority notification provider on macOS.
cmux delivers notifications via native UNUserNotificationCenter,
properly attributed to the cmux app instead of Script Editor.

Notification priority: cmux > terminal-notifier > osascript

Tests cover the full fallback chain:
- cmux available: uses cmux, skips others
- cmux fails: falls back to terminal-notifier
- cmux + terminal-notifier fail: falls back to osascript
- cmux not available: skips to terminal-notifier

Fixes #3628
2026-04-28 08:35:43 -04:00
YeonGyu-Kim fbaeb032c0 fix(todo-continuation): avoid duplicate progress reset
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-28 18:00:47 +09:00
YeonGyu-Kim ebcd6edf5a perf(hashline): use write metadata line counts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-28 18:00:21 +09:00
YeonGyu-Kim eb722aa977 perf(compaction): reuse message update parts for no-text tails
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-28 17:59:50 +09:00
MoerAI 07064a96f5 fix(context-window-monitor): clamp displayed context status percentages so the directive stays trustworthy (fixes #3655)
Root cause: the context-window-monitor hook computes actualUsagePercentage = (input + cache.read) / actualLimit and renders both 'X% used' and '(1 - X) * 100% remaining' inside a [SYSTEM DIRECTIVE: OH-MY-OPENCODE - CONTEXT WINDOW MONITOR] block that is appended to bash tool output. When resolveActualContextLimit() underestimates the model's real context window (for example a 1M-context Anthropic model that falls back to the 200K default per #3450), totalInputTokens > actualLimit and the rendered numbers go nonsensical (issue #3655 reproduces 144.7% used / -44.7% remaining at 289,370 / 200,000 tokens). Safety-tuned models recognize the >100% / negative-remaining pattern as a tell-tale prompt injection and refuse to follow the directive.

Fix: clamp actualUsagePercentage to [0, 1] before formatting. The 70% threshold check still uses the raw value so the block continues to fire above threshold, and resolveActualContextLimit() is left untouched (the deeper resolver concern is tracked separately as #3450). When totalInputTokens exceeds actualLimit the displayed numbers now read '100.0% used / 0.0% remaining' instead of the impossible >100% / negative pair, and safety-tuned models stop flagging the block as an injection attempt.

Verification: added a regression test (input 289,370, limit 200,000) that asserts usedPct in [0,100] and remainingPct in [0,100]. Test fails before the fix (Received: 144.7) and passes after. Full context-window-monitor.test.ts and context-window-monitor.model-context-limits.test.ts: 15 pass / 0 fail. Typecheck clean.
2026-04-28 16:51:56 +09:00
Choi Kijin / 최 기진 / チョイ キジン 3fc9e6bafd Merge remote-tracking branch 'origin/dev' into opencode/mighty-wolf 2026-04-28 15:47:58 +09:00
Choi Kijin / 최 기진 / チョイ キジン cc3cca7cb7 fix(model-fallback): expose session fallback chains to background tasks
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-28 15:27:34 +09:00
YeonGyu-Kim 84287f1da7 test(todo-continuation): make countdown toast test deterministic
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-28 13:59:52 +09:00
YeonGyu-Kim 557d66fc4c Merge pull request #3675 from code-yeongyu/fix/ralph-loop-remove-recovery-window
fix(ralph-loop): remove redundant recovery window that stalls loop after errors (fixes #3235)
2026-04-27 18:53:02 +09:00
YeonGyu-Kim bde2955f8c fix(ralph-loop): remove stale error recovery window
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 18:22:53 +09:00
YeonGyu-Kim 69c37e3965 test(ralph-loop): cover non-abort error continuation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 18:22:53 +09:00
YeonGyu-Kim c27d52e2b8 fix(atlas): replace single task refusal directive
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 18:18:40 +09:00
YeonGyu-Kim 2e6b3b7f76 Merge pull request #3669 from code-yeongyu/fix/ralph-loop-zwsp-agent
fix(ralph-loop): strip ZWSP from agent name before promptAsync (fixes #3253)
2026-04-27 18:09:35 +09:00
YeonGyu-Kim d0dee70f9d fix(ralph-loop): skip idle continuation during background tasks
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 17:52:45 +09:00
YeonGyu-Kim f429e539fa test(ralph-loop): cover background task idle guard
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 17:52:45 +09:00
YeonGyu-Kim c92f841688 fix(ralph-loop): normalize continuation agent names
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 17:40:46 +09:00
YeonGyu-Kim a696c8a67c fix(hooks): apply Sisyphus GPT-5.5 variant
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 15:37:39 +09:00
YeonGyu-Kim a2c3804b5f test(slashcommand): isolate command discovery mocks
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 13:24:50 +09:00
Jay1 f6b2ce7b6b feat(agents): add gpt-5.5 native sisyphus support
Route GPT-5.5 through the existing GPT-5.4-native Sisyphus and Hephaestus prompt family while keeping one shared model-family helper.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-23 20:49:11 -04:00
MoerAI 328df08162 fix(test): update provider-matrix tests to expect fallback on quota exhaustion 2026-04-22 19:10:49 +09:00
MoerAI 59493002e4 fix(error-classifier): match insufficient balance/funds as quota_exceeded 2026-04-22 18:47:16 +09:00
YeonGyu-Kim a941774e99 chore(cleanup): remove obsolete team-mode workspace artifacts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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