Commit Graph

4659 Commits

Author SHA1 Message Date
YeonGyu-Kim aade99ee04 Merge pull request #3183 from code-yeongyu/fix/issue-2932
fix: prevent background agent race condition in session prompt (#2932)
2026-04-07 15:33:34 +09:00
YeonGyu-Kim d64cd66c7a Merge pull request #3182 from code-yeongyu/fix/issue-2964
fix: inject agent identity into system prompt for built-in agents (#2964)
2026-04-07 15:33:17 +09:00
YeonGyu-Kim 5622d154fd fix: prevent background agent race condition in session prompt (#2932)
Added await for session ready state before sending prompt in
background-agent/manager.ts. Also improved image resizer error handling.

132 tests pass, tsc clean.

Closes #2932
2026-04-07 15:29:11 +09:00
YeonGyu-Kim b2e7ddfb73 fix: inject agent identity into system prompt for built-in agents (#2964)
Built-in agents (Sisyphus, Hephaestus, Atlas) now include explicit
identity section in their system prompts, matching custom agent behavior.

12 agent identity tests pass, 266 total pass, tsc clean.

Closes #2964
2026-04-07 15:29:10 +09:00
YeonGyu-Kim be562905d6 Merge pull request #3179 from code-yeongyu/fix/issue-3066
fix(start-work): add CHECKED_CHECKBOX_PATTERN for plan progress (#3066)
2026-04-07 15:16:18 +09:00
YeonGyu-Kim b4b9aea849 Merge pull request #3177 from code-yeongyu/fix/issue-3168
fix(mcp): bypass env var allowlist for trusted skill MCP configs (#3168)
2026-04-07 15:15:55 +09:00
YeonGyu-Kim 062b8cd718 Merge pull request #3169 from code-yeongyu/fix/sisyphus-junior-model
fix(model-fallback): respect user model override for sisyphus-junior category sessions (#2941)
2026-04-07 15:14:09 +09:00
YeonGyu-Kim 6ebe1bf1ab Merge pull request #3176 from code-yeongyu/fix/issue-3113
fix(keyword-detector): start ralph-loop when ulw keyword detected (#3113)
2026-04-07 15:14:07 +09:00
YeonGyu-Kim 5b53f6fdc7 Merge pull request #3175 from code-yeongyu/fix/issue-3129
fix(auto-update): align PACKAGE_NAME with published package name (#3129)
2026-04-07 15:14:04 +09:00
YeonGyu-Kim 5db6bfd97d Merge pull request #3174 from code-yeongyu/fix/issue-3033
fix(look-at): make multimodal-looker prompt conditional on Read availability (#3033)
2026-04-07 15:14:01 +09:00
YeonGyu-Kim b4baec75d3 Merge pull request #3173 from code-yeongyu/fix/issue-3081
fix(prompt): propagate variant field in all promptAsync continuation paths (#3081)
2026-04-07 15:13:58 +09:00
YeonGyu-Kim 0ab2370d4e fix(start-work): add CHECKED_CHECKBOX_PATTERN for plan progress tracking (#3066)
Plan progress now correctly counts checked checkboxes when determining
current task vs completed tasks.

TDD verified. tsc clean.

Closes #3066
2026-04-07 15:11:50 +09:00
YeonGyu-Kim 73d407fe73 fix(mcp): bypass env var allowlist for trusted skill MCP configs (#3168)
Added 'trusted' option to expandEnvVars. Skill MCPs are user-controlled
and now bypass the security allowlist. 3 files changed.

TDD verified. tsc clean.

Closes #3168
2026-04-07 15:11:47 +09:00
YeonGyu-Kim 717c976c66 fix(keyword-detector): start ralph-loop when ulw keyword detected (#3113)
Plain 'ulw' keyword now starts the continuation loop via
ralphLoop.startLoop(), matching README promise. Wired through
create-core-hooks.ts and create-transform-hooks.ts.

TDD: 40 keyword-detector tests pass, 1239 hook tests pass, tsc clean.

Closes #3113
2026-04-07 15:11:29 +09:00
YeonGyu-Kim eb8d7191ff fix(auto-update): align PACKAGE_NAME with published package name (#3129)
Changed PACKAGE_NAME from 'oh-my-openagent' to 'oh-my-opencode' in
auto-update-checker/constants.ts to match package.json. This fixes
getCachedVersion() returning null, causing 'unknown' in version toast.

TDD: red-green confirmed. 39 tests pass, tsc clean.

Closes #3129
2026-04-07 15:11:28 +09:00
YeonGyu-Kim b1c536ddd8 fix(look-at): make multimodal-looker prompt conditional on Read availability (#3033)
When Read tool is disabled (attachment mode), the agent prompt now
instructs to analyze the attached content directly instead of
trying to use Read. 3 new tests, 55 total pass.

Closes #3033
2026-04-07 15:11:26 +09:00
YeonGyu-Kim aa528e42c0 fix: propagate variant field in all promptAsync continuation paths (#3081)
All 5 continuation paths now send variant as top-level body field:
- boulder-continuation-injector.ts
- ralph-loop/continuation-prompt-injector.ts
- todo-continuation-enforcer/continuation-injection.ts
- unstable-agent-babysitter-hook.ts
- session-recovery/resume.ts

Plus type/helper updates in atlas, todo-continuation-enforcer,
unstable-agent-babysitter, and session-recovery.

TDD: 18 regression tests added, all pass. tsc clean.
2026-04-07 15:10:38 +09:00
YeonGyu-Kim bf2c104c9e Merge pull request #3172 from code-yeongyu/fix/bom-strip-jsonc
fix(jsonc-parser): strip UTF-8 BOM before parsing
2026-04-07 14:51:00 +09:00
YeonGyu-Kim daae6ed05b fix(jsonc-parser): strip UTF-8 BOM before parsing to fix Windows "InvalidSymbol at offset 0" errors
Windows editors often save UTF-8 files with a BOM (Byte Order Mark: \uFEFF).
When this is present, jsonc-parser reports InvalidSymbol at offset 0 because
the BOM is not valid JSON/JSONC syntax.

This commit strips the BOM before parsing, fixing issues #3164 where Windows
users report their opencode.jsonc file fails to parse even though it appears
to start with a valid '{' character.

Fixes: #3164
Co-authored-by: Jobdori <agent@yeongyu.kim>
2026-04-07 14:48:30 +09:00
YeonGyu-Kim 889294a5fd fix(model-fallback): respect user model override for sisyphus-junior category sessions (#2941)
When users configure agents.sisyphus-junior.model, category sessions
should use that model without falling back to hardcoded
AGENT_MODEL_REQUIREMENTS. Two leaks existed:

1. Launch-time: category-resolver.ts did not check overrideModel when
   deciding whether to use the hardcoded fallbackChain. Fixed by adding
   overrideModel to the suppression condition.

2. Runtime retry: model-fallback hook.ts treated undefined fallbackChain
   (from setSessionFallbackChain(id, undefined)) as 'no override' and
   fell through to AGENT_MODEL_REQUIREMENTS on session.error/status
   retry. Fixed by storing explicit empty array and checking .has()
   instead of truthiness.

Tests added:
- hook.test.ts: explicit empty session fallback suppresses agent chain
- event.model-fallback-2941.test.ts: session.error does not arm retry
- category-resolver.test.ts: overrideModel suppresses fallbackChain
- tools.test.ts: sisyphusJuniorModel override assertion
2026-04-07 11:20:42 +09:00
YeonGyu-Kim 12106ffccc Merge pull request #3167 from code-yeongyu/fix/agent-header-validation
fix(agent-names): use HTTP-header-safe display names and config keys for API calls
2026-04-07 10:13:44 +09:00
YeonGyu-Kim f8c626086e fix(agent-names): use HTTP-header-safe display names and config keys for API calls (#3138)
Display names with parentheses like 'Atlas (Plan Executor)' cause HTTP
header validation errors in x-opencode-agent-name. This was blocking
Atlas/Prometheus from working via /start-work and auto-retry.

Changes:
- Display names: parens -> dashes ('Atlas - Plan Executor')
- Hooks (start-work, no-hephaestus-non-gpt, no-sisyphus-gpt): use
  config keys ('atlas', 'sisyphus', 'hephaestus') for agent API fields
- auto-retry: use config key instead of display name for promptAsync
- agent-override-protection: handle dash-suffix normalization
- Updated all test expectations to match new format

Closes #3138
2026-04-07 10:08:04 +09:00
YeonGyu-Kim ebfd4a41ee Merge pull request #3166 from code-yeongyu/fix/delegate-description-optional
fix(delegate-task): make description optional with auto-generation from prompt
2026-04-07 09:39:29 +09:00
YeonGyu-Kim bd37e6676a fix(delegate-task): make description optional with auto-generation from prompt (#3162)
When weaker models (GLM-5, MiniMax) omit the description parameter on
delegate_task, the tool now auto-generates it from the first 4 words of
the prompt instead of throwing an error.

Changes:
- Schema: description is now optional (tool.schema.string().optional())
- Runtime: auto-generates from prompt when missing/empty/whitespace
- DelegateTaskArgs.description type stays as string (guaranteed by auto-gen)
- Tests: 3 new cases - missing/empty/explicit description handling
- Metadata title set after description resolution (correct ordering)
2026-04-07 09:30:22 +09:00
github-actions[bot] 10eb8b9acf @Melivo has signed the CLA in code-yeongyu/oh-my-openagent#3160 2026-04-06 15:38:07 +00:00
YeonGyu-Kim 3e8fd5ff18 fix(start-work): always hand off to atlas regardless of current session agent (#3155)
/start-work is the "execute this plan with atlas" command.
Previously, if the user's current session agent was sisyphus (or any
non-prometheus/non-atlas agent), the hook would keep that agent instead
of switching to atlas. This caused sisyphus to execute the plan.

Fix: unconditionally select atlas (when registered) or sisyphus (fallback).
The current session agent is irrelevant to /start-work's intent.

Adds regression test: running /start-work from a sisyphus session must
always hand off to atlas when atlas is available.
2026-04-06 19:55:04 +09:00
YeonGyu-Kim 23180c6ba6 fix(schema): use zodToJsonSchema instead of z.toJSONSchema for zod v3 compat
z.toJSONSchema is a zod v4 API. We pin zod to ^3.24.0 for opencode
compatibility, so use zodToJsonSchema from zod-to-json-schema package.
2026-04-06 18:51:56 +09:00
YeonGyu-Kim b7c8a0005c fix(tests): isolate atlas background launch client setup
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 18:45:33 +09:00
YeonGyu-Kim 19280979a4 fix(tests): stabilize prometheus md-only state
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 18:45:33 +09:00
YeonGyu-Kim e2d73f482a ci: run pure bun test in workflows
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 18:45:33 +09:00
YeonGyu-Kim 41af547fc7 fix(schema): use Zod native JSON schema output
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 18:45:33 +09:00
YeonGyu-Kim 03409938ec fix(tests): inject plugin loader dependencies
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 18:45:33 +09:00
YeonGyu-Kim 320dc0248e fix(tests): inject create-managers dependencies
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 18:45:33 +09:00
YeonGyu-Kim 0de7453349 fix(tests): fix globalThis.fetch pollution between test files
- install.test.ts: save and restore globalThis.fetch in beforeEach/afterEach
  to prevent leaking a mock fetch (without .preconnect) into subsequent test files
- provider.test.ts: guard against originalFetch missing .preconnect when captured
  from a leaked mock (defensive null-safe binding)
- discovery.test.ts: add writable:true to all Object.defineProperty fetch assignments
  so downstream plain assignments (globalThis.fetch = ...) are not silently ignored

Root cause: install.test.ts set globalThis.fetch = mock(...) inside test bodies
without restoring it, leaving a mock fetch (no .preconnect method) that caused
provider.test.ts refresh tests to throw TypeError at the fetchMock construction
2026-04-06 18:20:37 +09:00
YeonGyu-Kim e62d5d7a22 fix(agents): strip ZWSP ordering prefixes in session state, config lookups, and override protection
Prevent ZWSP sort prefixes from leaking into stored agent names, config
key lookups, and override-protection normalization. Ensures prefixed
list-display names resolve correctly throughout the pipeline.

🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
2026-04-06 18:07:26 +09:00
YeonGyu-Kim 178b635d72 feat(agents): add ZWSP stable-sort prefixes for core agent list ordering
Populate AGENT_LIST_SORT_PREFIXES for sisyphus/hephaestus/prometheus/atlas
so the TUI agent list renders in canonical order. Update dependent tests
to use getAgentListDisplayName() instead of hardcoded display strings.

🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
2026-04-06 18:07:07 +09:00
YeonGyu-Kim 88280d0e4d fix(agents): keep prometheus and atlas in canonical core order 2026-04-06 18:02:09 +09:00
YeonGyu-Kim 0c1202e480 fix(tests): resolve CI test isolation failures in OAuth refresh and ralph-loop
- provider.test.ts: reset discovery cache before/after refresh tests to prevent
  cross-test contamination via module-level discoveryCache singleton
- completion-promise-session-negative.test.ts: update negative test case to use
  non-oracle agent (hephaestus) since oracle tool_result VERIFIED detection was
  intentionally added in 56f2a9df
2026-04-06 17:48:38 +09:00
YeonGyu-Kim 61083d499d fix(oauth+errors): OAuth silent refresh, quota STOP patterns, compaction loop cap
Bug fixes:
1. OAuth token refresh (#3149): buildHttpRequestInit() now attempts silent refresh
   via refresh_token before triggering full browser re-auth. Added refresh() method
   to McpOAuthProvider. Includes test isolation fix for discovery mock.

2. Quota error STOP (#3126): Added STOP_MESSAGE_PATTERNS in model-error-classifier
   that take precedence over RETRYABLE_MESSAGE_PATTERNS. Message-only quota errors
   now non-retryable. Runtime-fallback: quota_exceeded with 'retrying in' signal
   still triggers fallback (provider-managed auto-retry). Restored removed patterns.

3. Compaction loop (#3127): MAX_RECOVERY_ATTEMPTS=3 cap + additional suppression
   guard from opencode session in degradation monitor.

Also: refactored extractAutoRetrySignal to auto-retry-signal.ts, new regression
tests for quota classifier and compaction degradation monitor.
2026-04-06 17:40:12 +09:00
YeonGyu-Kim 6c4e0b69a5 fix(agents): enforce Sisyphus->Hephaestus->Prometheus->Atlas assembly order
Extract hephaestus into agentConfig before prometheus so the config
handler naturally assembles agents in the canonical order instead of
relying solely on reorderAgentsByPriority to fix the wrong intermediate
order. Also fix test data that had atlas/prometheus swapped and add
missing hephaestus to agent-config-integration test lists.
2026-04-06 17:18:47 +09:00
YeonGyu-Kim 56f2a9df3a fix(ralph-loop): detect oracle VERIFIED tool results in session messages
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 17:18:47 +09:00
YeonGyu-Kim 137c2459f7 fix(prompt): prevent immediate BackgroundOutput polling after background task launch
Tool return values contained CTAs ("Use background_output to check") that
caused models to immediately poll instead of waiting for <system-reminder>
notifications. Unified all 5 tool return messages with explicit "Do NOT call
background_output now" guard, added pre-notification warning to BackgroundOutput
tool description, and strengthened Background Result Collection sections across
all 3 Sisyphus prompt variants (default, gpt-5-4, main) with BLOCKING
anti-pattern enforcement.

🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2026-04-06 17:18:47 +09:00
YeonGyu-Kim 5ad011de32 fix(compaction): cap recovery attempts to prevent infinite compaction loop (#3127)
Add MAX_RECOVERY_ATTEMPTS (3) guard to post-compaction degradation recovery.
On models like Kimi/Minimax that repeatedly generate no-text responses,
the recovery loop would trigger indefinitely as each compaction reset the
recovery counter via onSessionCompacted.

The recovery count now persists across compaction cycles per session and
is only reset on session deletion (clear()), not on every compaction.
2026-04-06 17:01:10 +09:00
YeonGyu-Kim f69234ab7e fix(error-classifier): quota/billing errors are non-retryable STOP (fixes #3126)
Add STOP_MESSAGE_PATTERNS that take precedence over RETRYABLE_MESSAGE_PATTERNS.
Message-only quota errors (no error name) now correctly return false from
isRetryableModelError, preventing unnecessary fallback retries on exhausted quotas.

- quota will reset after...
- quota exceeded
- usage limit has been reached
- free usage limit / billing limit / plan limit / subscription limit
- out of credits / credits exhausted / insufficient credits / insufficient balance

Also add 4 regression tests covering message-only quota STOP cases.
2026-04-06 16:56:17 +09:00
YeonGyu-Kim 9438c89c1c Merge pull request #3148 from MoerAI/fix/remove-installer-subscription-upsell
fix(cli): replace subscription upsell with informational note (fixes #3069)
2026-04-06 16:43:35 +09:00
YeonGyu-Kim bd723b5163 fix(tests): repair test regressions from zod v3 downgrade
- Fix zod/v4 imports in background-task schema tests
- Remove ZWSP prefix from agent-key-remapper test (fixed in #3136)
- Use toMatchObject for openai-only catalog tests (fallback_models added by #3144)
- Replace z.toJSONSchema (zod v4) with zodToJsonSchema (zod v3 compat)
- Fix task-list.ts type narrowing for zod v3 inferred types
2026-04-06 14:43:19 +09:00
YeonGyu-Kim 4659f14ce3 fix(tests): update model-fallback snapshots after installer fallback chain fix 2026-04-06 14:21:32 +09:00
YeonGyu-Kim 213cee27cc fix(types): resolve zod v3 type inference differences in task tools
zod v3 infers .default([]) fields as string[] | undefined in z.infer
output type (unlike v4 which marks them as string[]). Add nullish
coalescing guards and use any[] for the readJsonSafe result array
to avoid the type mismatch in task-list and task-update.
2026-04-06 14:20:30 +09:00
YeonGyu-Kim 205269421d fix(deps): downgrade zod to v3 for opencode compatibility (#3151)
opencode 1.3.16 bundles zod v3 internally and accesses _zod.def in
toJsonSchema. When oh-my-openagent installed zod v4, schemas from our
plugin caused a TypeError crash on any tool execution.

We only use basic z.* APIs with no v4-specific features, so pinning
to ^3.24.0 is safe and restores full compatibility.
2026-04-06 14:11:29 +09:00
YeonGyu-Kim 22d0895992 Merge pull request #3136 from andrescera/fix/atlas-zwsp-header-leak
fix: remove ZWSP sort prefix that leaks into x-opencode-agent-name header
2026-04-06 13:55:08 +09:00