Commit Graph

4045 Commits

Author SHA1 Message Date
YeonGyu-Kim bcaae1037d fix(directory-agents-injector): guard against non-string output.output
MCP tool responses (e.g. Serena via mcpm) can deliver output.output as
undefined or a non-string at runtime despite the TypeScript interface
declaring it as string. Add the same typeof guard already used in
tool-output-truncator and other hooks, preventing a TypeError crash.

Fixes #3800
2026-05-06 03:49:37 +09:00
YeonGyu-Kim 32fab88d68 fix(process-cleanup): add test seam to prevent process.exitCode contaminating bun runner
scheduleForcedExit() sets process.exitCode which taints the bun test runner's
own exit code for the entire suite. This caused CI to fail even though all
tests passed individually.

Fix:
- Add __disableScheduledForcedExitForTesting / __enableScheduledForcedExitForTesting
  seams to skip scheduleForcedExit() during tests
- beforeEach disables forced exit; afterEach re-enables
- The 'fallback exit timer' test explicitly re-enables to verify setTimeout/clearTimeout
- Remove process.exitCode and exitSpy assertions that required forced exit to be active
  (shutdown call counts are sufficient to verify behavior)
2026-05-05 19:04:40 +09:00
YeonGyu-Kim ad535cd29d fix(process-cleanup): isolate test and avoid checking process.exitCode directly
The test file modifies process.exitCode and emits process signals which can
leak into bun test's exit code. Add:
1. mock.module() sentinel to route to isolated batch (following abort-with-timeout.test.ts pattern)
2. Global afterAll() hook that resets process.exitCode = 0 before test runner checks it
3. Remove direct checks of process.exitCode in assertions - only check that process.exit() was called with the right code via spy

This ensures bun test exits with code 0 even after tests verify process.exit behavior.

Fixes #3792
2026-05-05 05:15:59 +09:00
YeonGyu-Kim 45452a039c Merge pull request #3731 from yizhifengye/fix/process-cleanup-infinite-loop-epipe
fix(background-agent): detach error listener before running body to s…
2026-05-05 04:24:01 +09:00
YeonGyu-Kim fd62f5b072 Merge pull request #3639 from auyua9/fix/fatal-cleanup-exit
fix(background): exit after fatal cleanup
2026-05-05 04:15:50 +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 6323fa8ef9 fix(background-agent): fix parentSessionID -> parentSessionId typo causing TS build failure
Property 'parentSessionID' does not exist on type 'LaunchInput' / 'BackgroundTask'.
The correct casing is 'parentSessionId' (camelCase with lowercase 'd').
Fixes CI build failure on dev branch.
2026-05-05 03:53:44 +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 8c8522ee72 Merge pull request #3415 from lightrabbit/fix/skill-mcp-stdio-cwd
fix(skill-mcp): pass workspace directory as cwd to stdio MCP processes
2026-05-04 23:58:22 +09:00
YeonGyu-Kim 7b28298b2a Merge pull request #3414 from garnetlyx/fix/sandbox-cache-availability-check
fix: use in-process flag instead of existsSync for cache availability
2026-05-04 23:58:19 +09:00
YeonGyu-Kim fa255e14c6 test(create-managers): align openclaw mock with refactored BackgroundManager config object
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 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 ce5bcd1d9b test(call-omo-agent): align background task fixtures with normalized field names
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 63170f4dd8 test(lsp): use named tmpdir import to avoid node:os mock leak
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 4e763fb0cb test(team-mode/team-worktree): use named tmpdir import to avoid mock leak
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 65c1b50946 test(background-agent): align manager test fixtures with normalized field names
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 3ae9f5f104 fix(background-agent): prevent false task completion on status API outage
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 4f32ecd7de test(deps): avoid Bun-specific path metadata
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-04 02:10:57 +09:00
YeonGyu-Kim 1045354776 test(deps): cover picomatch security floor
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-04 02:09:45 +09:00
YeonGyu-Kim 1a881b374e test(agents): cover OpenCode Agent.list sort with runtime-name prefixes
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2026-05-04 01:44:07 +09:00
YeonGyu-Kim 81d36ae749 test(cli-installer): cover telemetry shutdown failure isolation
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2026-05-04 01:44:04 +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
YeonGyu-Kim 6a8bdcaa25 feat(team-mode): add resolveCallerTeamLead helper
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2026-05-04 01:43:55 +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 92dab9285c refactor(telemetry): narrow PostHog client and mark omo_daily_active anonymous 2026-05-02 00:11:01 +09:00
YeonGyu-Kim b8a5f27dee refactor(telemetry): drop plugin_loaded capture from plugin entry 2026-05-02 00:10:59 +09:00
YeonGyu-Kim 14568db278 refactor(telemetry): drop run lifecycle events and captureException from runner 2026-05-02 00:10:57 +09:00
YeonGyu-Kim be2eee6306 refactor(telemetry): drop install events from cli-installer 2026-05-02 00:10:54 +09:00
YeonGyu-Kim bae62ab582 fix(agents): allow Momus and Metis delegation
Keep Momus and Metis read-only for file edits while allowing task-based invocation for planning review workflows.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-01 19:27:25 +09:00
YeonGyu-Kim b88e32cbdd Merge pull request #3678 from MoerAI/fix/spawn-windows-hide-env
fix(bun-install): forward process.env so child bun install inherits proxy settings (fixes #3528)
2026-05-01 19:18:46 +09:00
YeonGyu-Kim c7da46ea5a Merge pull request #3679 from MoerAI/fix/file-uri-rejection-explanation
fix(resolve-file-uri): explain project boundary restriction in rejection warning (fixes #3554)
2026-05-01 19:18:43 +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 793f24a62f Merge pull request #3715 from mrosnerr/fix/messages-transform-hook-isolation
fix(messages-transform): isolate hook failures so tool-pair-validator always runs
2026-05-01 19:18:31 +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
auyua9 875fffb7d1 fix(background): exit after fatal cleanup 2026-05-01 16:04:03 +08:00
YeonGyu-Kim f7270a0f97 fix(model-error-classifier): scope forbidden-provider retry to specific phrase
Bare "403" and "forbidden" substring patterns (added in 034744cb to
retry the "Selected provider is forbidden" case from PR #3706) matched
any error message containing those tokens — tool-level 403s, file-perm
"forbidden" messages, unrelated upstream errors that happened to spell
"forbidden". The legacy model-fallback path then armed setPendingModelFallback
on those unrelated errors, jumping Sisyphus to claude-opus-4-7 (first
entry of its fallback chain) regardless of the user's configured model.

Replace the bare patterns with the specific phrases PR #3706 actually
targeted, and add regression tests asserting unrelated 403/forbidden
messages stay non-retryable.

Reported-by: ilove_borshch on Discord (#omo-help)
2026-05-01 01:25:01 +09:00
YeonGyu-Kim 1a64060cc2 feat(agents): strengthen gpt-5.5 prompts with manual QA gate, dig-deeper trio, anti-fallback
- Add Manual QA Gate as a non-negotiable surface-tool mapping
  (interactive_bash for TUI, playwright for browser, curl for HTTP,
  driver script for library) to Hephaestus, Sisyphus-Junior, and
  Sisyphus' direct-execution mode.
- Restore the dig-deeper trio (tool persistence / dig deeper /
  dependency checks) as orthogonal paragraphs so each carries its
  own cognitive trigger instead of a fused single statement.
- Harden investigate-before-acting from a soft phrase to a dedicated
  block: never speculate about unread code, re-read on every
  task hand-off, the worktree may have changed.
- Add 'Parallelize aggressively' as its own block. Reads, searches,
  diagnostics, and background sub-agents all batch into a single
  response by default.
- Add 'No defensive code, no speculative legacy' to discourage
  speculative backward-compatibility branches and unrequested
  defensive validation.
- Absorb review-intent and frontend anti-slop coverage so the
  prompt stays self-sufficient when the omo agent prompt replaces
  the provider prompt.
- Replace literal apply_patch instructions with GPT_APPLY_PATCH_GUIDANCE
  (use edit/write tools) so the prompt no longer contradicts the
  apply_patch deny that the agent permission applies on GPT models.
- Sisyphus-Junior gains a Review tasks block and a default-behavior
  fallback for when the runtime category context is missing or sparse.
- Sisyphus gains an explicit Hard invariants block listing type-
  suppression bans, destructive-git bans, and Oracle-completion gating.
- Restore dynamic injections that round out the orchestrator/worker
  context: category+skills delegation guide, delegation table,
  Oracle dynamic guidance, key triggers, non-Claude planner
  reminder. Hephaestus regains optional category delegation while
  keeping direct execution as the default.
- Drop em dashes; search guidance points at rg directly throughout.
2026-04-30 20:30:57 +09:00
yizhifengye 49c2a40251 fix(background-agent): detach error listener before running body to stop re-entrant log loop
When shutdown() itself emitted uncaughtException (e.g. EPIPE while closing
a broken pipe), the error listener re-entered itself, re-logged, re-ran
cleanup, and threw EPIPE again. The 6 s forced-exit timer could not fire
because every re-entry stalled the event loop with fresh synchronous work.

Users hit this after v3.17.5 and observed 100+ GB of log lines written to
disk within minutes, with one confirmed report of a 157 GB log file filling
the filesystem.

Detaching the listener with process.off() before running log() + handler()
breaks the loop at the first re-emit: the second event has no listener to
invoke, and the first invocation's scheduleForcedExit() proceeds normally.
2026-04-30 14:47:09 +08: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 d65bc8730c feat(agents): add gpt-5.5 native deep category prompt
Hephaestus 5.5 was rewritten as an outcome-first delegation contract in c3fabaaf. The deep category (spawned as sisyphus-junior under gpt-5.5) now receives a matching prose-driven category context lifted from drafts/gpt-5-5/deep.md instead of the legacy gpt-5.4-era threat-frame version.

Selection happens via a new model-aware resolvePromptAppend hook on BuiltinCategoryDefinition. When the resolved category model is gpt-5.5 the new DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5 is used; older models keep the legacy DEEP_CATEGORY_PROMPT_APPEND. User prompt_append remains preserved on top of either base.
2026-04-29 15:49:27 +09: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 69a4b2f49c fix(messages-transform): isolate hook failures so tool-pair-validator always runs
Previously each transform hook was awaited sequentially without per-hook
error handling. If contextInjectorMessagesTransform or thinkingBlockValidator
threw, toolPairValidator was silently skipped, leaving orphaned tool_use
blocks in the post-compaction API payload and producing
"messages.N: tool_use ids were found without tool_result blocks immediately
after" 400s from Anthropic.

Wraps each hook in runHookSafely so an upstream throw is logged but the
chain continues. Adds regression tests covering the isolation contract and
the consecutive-assistants compaction tail case (ses_22bd806).
2026-04-28 17:38:28 -04:00