Commit Graph

29 Commits

Author SHA1 Message Date
Samuele Domenico Ruffino 6cd40df4cb feat(opencode-go): upgrade glm-5 → glm-5.1 and kimi-k2.5 → kimi-k2.6 in fallback chains 2026-05-06 16:45:30 +09: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
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 70ddc01e10 refactor: remove AI slop from refactored files
Behavior-preserving cleanup of AI-generated code smells in 5 files authored/moved by this PR:

- src/hooks/model-fallback/fallback-state-controller.ts (-47/+47 net reorganization, redundant defensiveness removed)
- src/shared/model-string-parser.ts (-4 LOC obvious-comment cleanup)
- src/shared/ripgrep-cli.ts (-13 LOC obvious comments + redundant defensive checks)
- src/tools/delegate-task/tool-description.ts (-6 LOC)
- src/tools/look-at/look-at-input-preparer.ts (-6 LOC)

Targets: obvious comments that restate code, over-defensive null checks on guaranteed values, redundant existence checks. No public API signatures changed, no type hints removed, no new abstractions introduced. Full test suite still passes.
2026-04-18 03:01:51 +09:00
YeonGyu-Kim 5e4102566c refactor(model-fallback): fully encapsulate session state in factory closure
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 02:35:46 +09:00
YeonGyu-Kim 81b68d828c refactor(model-fallback): move fallback state into factory closure and split hook.ts
Move the pending fallback, toast, and session-chain maps behind a shared controller initialized from the hook factory. This preserves the existing singleton semantics because exported helpers and hook instances still resolve the same lazily initialized controller while hook.ts stays under the 200-line limit.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 01:53:03 +09:00
YeonGyu-Kim def44338ff refactor(models): bump claude-opus-4-6 to claude-opus-4-7 across fallback chains, categories, and hooks
Updates the canonical Anthropic Opus model in every fallback chain
(sisyphus, oracle, prometheus, metis, momus, visual-engineering,
ultrabrain, deep, artistry, unspecified-high), the unspecified-high
category default, the think-mode HIGH_VARIANT_MAP, the Claude Code
alias map, the claude-thinking legacy alias, the context-limit GA
regex, and event.ts fallback strings.

Widens supportsCachedAnthropicLimit to accept both claude-*-4-6 and
claude-*-4-7 so the 1M context cache still applies across the bump.

Regenerates the bundled model-capabilities snapshot from models.dev
and the model-fallback snapshot to match the new source output.
2026-04-17 14:51:52 +09:00
YeonGyu-Kim c5c5bc36bc fix(delegate-task): consume fallback chain on sendSyncPrompt failure (#2691)
setSessionFallbackChain stored the fallback chain but the sync path
never consumed it when sendSyncPrompt returned an error. Added a
retry loop that iterates getNextFallback() until the prompt succeeds
or the chain is exhausted, preserving the finally-block cleanup.

🤖 Generated with OhMyOpenCode assistance
https://github.com/code-yeongyu/oh-my-opencode
2026-04-12 02:30:32 +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 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 a4db240d47 test: localize mock.module setup to fresh imports 2026-04-04 19:49:25 +09:00
YeonGyu-Kim e860108b60 refactor: replace em dashes with hyphens in test files and docs
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-04 14:35:49 +09:00
YeonGyu-Kim 6acca09bd0 fix(ci): resolve mock.module() cross-file leakage in test suite
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-04 02:35:23 +09:00
YeonGyu-Kim 53eeac3f31 fix(ci): simplify test runner to plain bun test by fixing mock.module() leakage
- Add afterAll(() => { mock.restore() }) to 52 test files missing cleanup
- Rewrite create-tool-guard-hooks.test.ts to use spyOn instead of barrel mock
- Fix skill-mcp-manager OAuth tests with missing mockTokens/mockLogin definitions
- Fix start-work hook: show worktree active block on resume with existing worktree_path
- Extract createWorktreeActiveBlock to worktree-block.ts to avoid circular import
- Replace 80-line isolated test runner CI config with single `bun test` command
2026-04-04 00:34:03 +09:00
YeonGyu-Kim 5c7299830d refactor(hooks): fix empty catches and remove AI slop from code comments 2026-04-03 21:37:16 +09:00
YeonGyu-Kim 7895361f42 fix(tests): resolve 5 cross-file test isolation failures
- model-fallback hook: mock selectFallbackProvider and add _resetForTesting()
  to test-setup.ts to clear module-level state between files
- fallback-retry-handler: add afterAll(mock.restore) and use mockReturnValueOnce
  to prevent connected-providers mock leaking to subsequent test files
- opencode-config-dir: use win32.join for Windows APPDATA path construction
  so tests pass on macOS (path.join uses POSIX semantics regardless of
  process.platform override)
- system-loaded-version: use resolveSymlink from file-utils instead of
  realpathSync to handle macOS /var -> /private/var symlink consistently

All 4456 tests pass (0 failures) on full bun test suite.
2026-03-26 09:30:34 +09:00
YeonGyu-Kim bff74f4237 Merge pull request #2695 from MoerAI/fix/provider-agnostic-fallback
fix(runtime-fallback): make fallback provider selection provider-agnostic (fixes #2303)
2026-03-25 11:36:50 +09:00
YeonGyu-Kim 535ecee318 fix(models): remove stale Gemini 3 Pro references
Keep repo-owned CLI, docs, and test fixtures aligned with current Gemini 3.1 naming while leaving upstream catalog behavior untouched.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-24 23:53:56 +09:00
MoerAI 0e610a72bc fix(runtime-fallback): make fallback provider selection provider-agnostic (fixes #2303) 2026-03-20 09:53:24 +09:00
YeonGyu-Kim 38938508fa test(model-fallback): update snapshots and kimi model expectations for opencode-go integration 2026-03-13 10:48:05 +09:00
Ravi Tharuma eab5be666d Fix cooldown fallback switching across model/runtime fallback hooks 2026-03-09 12:43:01 +09:00
YeonGyu-Kim 60bc9a7609 feat(model-requirements): add k2p5, kimi-k2.5, gpt-5.4 medium to Sisyphus fallback chain
Sisyphus can now fall back through Kimi and OpenAI models when Claude
is unavailable, enabling OpenAI-only users to use Sisyphus directly
instead of being redirected to Hephaestus.

Runtime chain: claude-opus-4-6 max → k2p5 → kimi-k2.5 → gpt-5.4 medium → glm-5 → big-pickle
CLI chain: claude-opus-4-6 max → k2p5 → gpt-5.4 medium → glm-5
2026-03-08 01:41:45 +09:00
YeonGyu-Kim 85690b69a8 test: update snapshots and assertions for kimi-k2.5-free removal 2026-03-04 11:33:11 +09:00
YeonGyu-Kim 95fe698817 fix(model-fallback): correct transform expectations and hermetic test isolation 2026-03-03 00:38:45 +09:00
east-shine 94ff673d40 test(model-fallback): google provider 모델명 변환 테스트 추가
google provider에서 gemini-3-pro → gemini-3-pro-preview 변환이
getNextFallback를 통해 정상 적용되는지 검증하는 테스트 추가.
기존 github-copilot 테스트와 동일한 패턴으로 작성.
2026-02-25 21:40:28 +09:00
Jaden f6d5f6f79f fix(model-fallback): apply transformModelForProvider in getNextFallback
The getNextFallback function returned raw model names from the
hardcoded fallback chain without transforming them for the target
provider. For example, github-copilot requires dot notation
(claude-sonnet-4.6) but the fallback chain stores hyphen notation
(claude-sonnet-4-6).

The background-agent retry handler already calls
transformModelForProvider correctly, but the sync chat.message
hook in model-fallback was missing it — a copy-paste omission.

Add transformModelForProvider call in getNextFallback and a test
verifying github-copilot model name transformation.
2026-02-25 17:15:13 +09:00
YeonGyu-Kim 9059a4fdbc fix(model-requirements): remove custom quotio provider, restore standard providers 2026-02-21 03:03:57 +09:00
VespianRex bf51919a79 Address review feedback for fallback fixes 2026-02-20 17:46:12 +02:00
VespianRex f5f1d1d4c2 Fix model fallback across main/background/sync agents 2026-02-20 17:45:53 +02:00