Commit Graph

4270 Commits

Author SHA1 Message Date
YeonGyu-Kim 39cf5a89bf fix(test): update model-fallback snapshots after metis switch to claude-sonnet-4-6
Commit 2dfa6336f changed Metis primary model from claude-opus-4-7 max
to claude-sonnet-4-6 in src/shared/model-requirements.ts but only
updated the unit test in model-requirements.test.ts. The CLI installer
end-to-end snapshot test (src/cli/model-fallback.test.ts) generates
configs from those same fallback chains via generateModelConfig and
captures them as snapshots, so 17 snapshot assertions broke.

Snapshots regenerated with `bun test src/cli/model-fallback.test.ts -u`.
Verified 86/86 pass across model-requirements + model-fallback +
openai-only-model-catalog test files.

The change is a no-op for the web import that this PR is primarily
about — including it here to unblock CI on dev (where the breakage
landed) rather than spinning up a separate hotfix PR.
2026-05-08 13:41:14 +09:00
YeonGyu-Kim c7d6a4a2ce fix: remove dead-code files accidentally resurrected by previous commit
The previous commit (2dfa6336f) used 'git add -A' which swept up files that
prior commits had intentionally deleted but were still present untracked in
the local workspace. This commit re-deletes them to match the upstream intent.

Files removed (each was previously deleted in the cited commit):

- drafts/gpt-5-5/{README,deep,hephaestus,oracle,sisyphus-junior,sisyphus}.md
  (deleted in 40ded422c chore(drafts): remove stale gpt-5.5 prompt drafts)
- src/plugin-dispose.{ts,test.ts}
  (deleted in e2f5c0d36 refactor(plugin): remove orphaned createPluginDispose)
- src/features/tmux-subagent/{cleanup,session-created-handler,session-deleted-handler}.ts
  (deleted in 7a7926f22 chore(tmux-subagent): remove dead event-handler modules)
- src/tools/delegate-task/{model-string-parser,resolve-call-id,resolve-call-id.test}.ts
  (model-string-parser deleted in db056346d; resolve-call-id was scratch)
- src/__debug-test.test.ts (debug scratch never intended for git)

Typecheck + model-requirements tests still pass. The legitimate metis +
AGENTS.md edits from the previous commit remain on dev.
2026-05-08 13:08:16 +09:00
YeonGyu-Kim 2dfa6336f5 fix(metis): switch primary model to claude-sonnet-4-6 + correct AGENTS.md inaccuracies
Source code change:
- src/shared/model-requirements.ts: prepend claude-sonnet-4-6 to metis fallback
  chain so Sonnet becomes the default. Opus 4.7 max remains as the immediate
  fallback for callers who want extra reasoning.
- src/shared/model-requirements.test.ts: update assertion to expect Sonnet
  primary + Opus secondary.

AGENTS.md accuracy fixes (verified against source):
- Agent modes: Sisyphus/Hephaestus are 'primary' (not 'all'); Sisyphus-Junior
  is 'subagent' (not 'all'). Confirmed via 'const MODE: AgentMode = ...' in
  each agent file. Also clarified Prometheus has no agentSources factory and
  is built via buildPrometheusAgentConfig.
- Sisyphus fallback chain: corrected order to kimi-k2.6 → k2p5 → kimi-k2.5
  → gpt-5.5 medium → glm-5 → big-pickle (was missing kimi-k2.5).
- Librarian/Explore: added missing minimax-m2.7 step between -highspeed and
  claude-haiku-4-5.
- Metis chain: removed fictitious gemini-3.1-pro entry.
- Sisyphus-Junior chain: spelled out the actual fallback (was 'user-configurable').
- Temperatures: Sisyphus/Hephaestus do not set explicit temperature (model
  default); Sisyphus-Junior is 0.1 via SISYPHUS_JUNIOR_DEFAULTS.
- Quick category default: gpt-5.4-mini (not gpt-5.4-mini-fast).

Team-mode corrections:
- Eligibility registry has 3 verdicts: eligible (sisyphus, atlas, sisyphus-junior),
  conditional (hephaestus — needs D-36 teammate permission), hard-reject
  (oracle, librarian, explore, multimodal-looker, metis, momus, prometheus).
- Schema has 11 fields, not 4: added max_messages_per_run, max_wall_clock_minutes,
  max_member_turns, base_dir, message_payload_max_bytes, recipient_unread_max_bytes,
  mailbox_poll_interval_ms.
- Hooks: 'team-session-events' is 4 sub-handlers in src/plugin/event.ts
  (team-idle-wake-hint, team-lead-orphan-handler, team-member-error-handler,
  team-member-status-handler), not a single Continuation-tier hook.
- Tier counts now show base + team-mode: ToolGuard 14/15, Transform 5/7.
- Total: 52 base hooks, 59 with team-mode.

Doc cascade for the Metis change:
- docs/guide/orchestration.md, agent-model-matching.md, installation.md
- docs/reference/configuration.md, features.md
2026-05-08 13:06:34 +09:00
YeonGyu-Kim 838b5ae216 docs(agents): refresh hierarchical AGENTS.md with team-mode coverage
Update root + 43 directory-level AGENTS.md files to reflect current state:
- Root AGENTS.md rewritten with accurate counts (1967 TS files, 1304 source +
  663 test, 278k LOC, 120 barrel index.ts), 7-step init flow, 5-tier hook
  composition, and full Team Mode section (12 team_* tools, eligibility,
  storage layout, config gate)
- src/AGENTS.md adds team-mode init step, current per-subdir file/LOC table
- src/tools/AGENTS.md documents conditional gates (team-mode +12, task
  system +4, hashline +1, interactive_bash +1, look_at +1) with always-on
  baseline of 20
- src/hooks/AGENTS.md splits into 5 tiers + 4 conditional team-mode hooks
- src/features/team-mode/AGENTS.md surfaces 12 tools, eligible agents,
  spawn-race-safe invariants, and integration points
- src/features/builtin-skills/AGENTS.md tracks 10 skills incl. team-mode
- src/agents/AGENTS.md, src/plugin/AGENTS.md, src/config/AGENTS.md updated
  for team-mode awareness, accurate counts, and current schema field list
- All other AGENTS.md files refreshed to 2026-05-08 generation date
2026-05-08 12:08:42 +09:00
herjarsa adc6d92a8e fix(agents): copy factory mode to agent config for Desktop 1.14.x compat
OpenCode Desktop 1.14.x filters agents by `mode` field. The `mode` was
only present on the factory function as a static property, but not copied
to the generated AgentConfig object.

This fix copies `source.mode` to `base.mode` in `buildAgent()` when:
- source is a factory function (has `mode` static property)
- the generated config doesn't already define `mode`

Test: agent-builder.test.ts (4 pass)

Closes: #3835
Related: #3762, #3812, #3794, #3475, #3474, #3829, #3831, #3824, #3826, #3721, #3806, #3188
2026-05-07 16:18:41 +02:00
YeonGyu-Kim 6b49e3bddc test agent runtime sort behavior 2026-05-07 18:52:44 +09:00
YeonGyu-Kim ee938aa097 fix full-suite isolation regressions 2026-05-07 18:36:03 +09:00
YeonGyu-Kim 102b5f96e7 fix(delegate-task): require one goal per deep call
The caller-facing description told orchestrators WHAT `deep` is but
never specified goal cardinality, so they bundled multiple goals into
one call (e.g. "fix X + merge Y + deploy Z"). The deep agent's own
prompt was already configured to refuse such bundles, but only after
they arrived. The rule now lives on the caller side: ONE goal + ONE
deliverable per call; multiple goals must fan out as parallel `deep`
calls.
2026-05-07 18:36:03 +09:00
YeonGyu-Kim 788fbec0d7 fix desktop plugin startup without Bun 2026-05-07 18:36:03 +09:00
YeonGyu-Kim 4bcbbdd966 Merge pull request #3832 from herjarsa/fix/desktop-electron-bun-protocol-compat
fix(desktop): hide bun:sqlite import from Node.js/Electron ESM loader
2026-05-07 18:35:11 +09:00
herjarsa 3a93a40e68 fix(desktop): hide bun:sqlite import from Node.js/Electron ESM loader
Uses new Function() to prevent the static ESM loader from seeing
the bun: protocol import at parse time. In Electron/Node.js, the
import() call is evaluated at runtime and gracefully returns null
when bun:sqlite is unavailable.

Fixes #3829, likely fixes #3762
2026-05-07 10:38:31 +02:00
YeonGyu-Kim 8586cb8965 fix(posthog): disable feature flags, remove plugin_loaded event for billing optimization
- Remove plugin_loaded telemetry from index.ts (was 46.5% of all events, ~2.83M/month)
- Add enableLocalEvaluation: false to prevent feature flag polling/decide calls
- Add strictLocalEvaluation: true to prevent server fallback requests
- Add disableRemoteConfig: true to prevent remote config network requests
- Remove 'plugin_loaded' from PostHogActivityReason type
- Update tests: remove stale mocks, add SDK options verification test
- enableExceptionAutocapture: false already present (kept)

Estimated billing reduction: ~$960+/month from feature flag requests,
plus ~2.83M fewer events/month from plugin_loaded removal.
2026-05-07 16:44:05 +09:00
YeonGyu-Kim 10f9559ccc Merge pull request #3810 from code-yeongyu/fix/ralph-loop-retry-runtime-errors-v2
fix(continuation): retry runtime errors immediately
2026-05-07 12:03:40 +09:00
YeonGyu-Kim dfc7dfae2e feat(delegate-task): add GPT-5.3-codex specialized deep category prompt
- DEEP_CATEGORY_PROMPT_APPEND_GPT_5_3_CODEX preserving all DEEP knowledge (atomic task treatment, root cause bias, ambition scaled, completion bar, status sparse) plus codex-specific additions: bias to action, parallel-batch exploration, code implementation discipline, worktree safety, plan closure, pragmatic final-message format\n- resolveDeepCategoryPromptAppend now routes codex first, then 5.5, else legacy (preserves existing 5.5 and 5.4 test invariants)\n- Tests: assert codex no longer falls back to legacy, content tests mirroring the 5.5 pattern (style markers, knowledge preservation, parallel-batch framing, materially different from siblings)

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-07 11:56:01 +09:00
YeonGyu-Kim 5eea7024d5 feat(agents): add GPT-5.2 specialized prompts for oracle and momus
- Add isGpt5_2Model type guard\n- ORACLE_GPT_5_2_PROMPT consolidating all knowledge from Claude default, GPT-5.4 generic, and GPT-5.5 variants (XML-tagged blocks, concrete verbosity clamps, long-context re-grounding, anti-narration tool rules, high-risk self-check)\n- MOMUS_GPT_5_2_PROMPT preserving blocker-finder philosophy with new tool_usage_rules block for parallel reference verification\n- Momus GPT-5.2 reasoningEffort set to xhigh per evaluation rigor needs

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-07 11:55:54 +09:00
YeonGyu-Kim ebe26eab17 fix(ralph-loop): guard runtime error retries 2026-05-07 11:50:44 +09:00
YeonGyu-Kim 83ec352899 merge dev into continuation runtime retry
# Conflicts:
#	src/hooks/ralph-loop/non-abort-error-continuation.test.ts
2026-05-07 11:34:33 +09:00
YeonGyu-Kim 2c70938d81 test(ralph-loop): cover ultrawork runtime retry 2026-05-07 11:27:46 +09:00
YeonGyu-Kim 6a2d19d605 fix(atlas): retry boulder after runtime errors 2026-05-07 11:27:44 +09:00
YeonGyu-Kim 1ad0fd4ac8 Merge pull request #3748 from code-yeongyu/fix/simple-github-bugs-1948-3564
fix: resolve simple triaged GitHub bugs
2026-05-06 18:43:58 +09:00
YeonGyu-Kim ef66516ea4 Merge pull request #3801 from code-yeongyu/fix/directory-agents-non-string-output
fix(directory-agents-injector): guard against non-string output.output (#3800)
2026-05-06 18:17:36 +09:00
YeonGyu-Kim 7bd863b214 Merge pull request #3813 from code-yeongyu/fix/agent-name-backslash-sanitize
fix(agent): sanitize backslash/quote from agent name
2026-05-06 18:14:39 +09:00
YeonGyu-Kim d9ef03f1a5 test(agent): guard queueItem assertion against empty queue race 2026-05-06 17:50:11 +09:00
YeonGyu-Kim 25d183fbe8 fix(agent): sanitize backslash/quote from agent name in launch() and background-executor
Agent names like \hephaestus\ cause 'Agent not found' errors because
sanitizeSubagentType() was only called in subagent-resolver.ts but not
in the direct manager.launch() path or background-executor.ts.

- manager.ts: strip leading/trailing backslash/quote chars from input.agent
  before validation so \hephaestus\ → hephaestus
- background-executor.ts: call sanitizeSubagentType(args.subagent_type)
  instead of passing raw value to manager.launch()
- agent-display-names.ts: reuse sanitizeSubagentType in stripAgentListSortPrefix
- Add unit tests for all three fix points

Fixes: sessions dying with 'Agent not found: \hephaestus\'
2026-05-06 17:41:41 +09:00
YeonGyu-Kim 66a6f42d73 fix(todo-continuation-enforcer): preserve overload countdown 2026-05-06 17:36:03 +09:00
YeonGyu-Kim 89c959955a fix(team-mode): gate tmux layout cleanup by config
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 17:36:03 +09:00
YeonGyu-Kim b4791c85ca fix(team-mode): keep tmux visualization in caller window
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 17:36:03 +09:00
YeonGyu-Kim 675f7880fe fix(team-mode): resolve caller tmux window target
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 17:36:03 +09:00
YeonGyu-Kim 9dd0e9fb0e Merge pull request #3622 from MoerAI/fix/truncate-tool-error-output
fix(tool-execute-after): cap excessively long tool output to prevent TUI flooding (fixes #3586)
2026-05-06 17:22:53 +09:00
YeonGyu-Kim 44948872eb Merge pull request #3612 from MoerAI/fix/doctor-exit-137-handling
fix(doctor): catch unexpected failures and provide actionable diagnostics (fixes #3345)
2026-05-06 17:22:47 +09:00
MoerAI 2971322952 fix(doctor): catch unexpected failures and provide actionable diagnostics (fixes #3345) 2026-05-06 17:17:56 +09:00
MoerAI a22416d270 fix(error-classifier): classify credit balance too low as quota_exceeded for fallback (fixes #3571) 2026-05-06 17:17:23 +09:00
YeonGyu-Kim 7ac1109611 Merge pull request #3636 from lucasyounger/codex/fix-3629-worktree-plan-path
fix(boulder): resolve continuation progress from worktree plan
2026-05-06 17:15:21 +09:00
YeonGyu-Kim 37d981ef1f Merge pull request #3634 from auyua9/fix/ast-grep-pattern-hints
fix(ast-grep): restore pattern hints in tools
2026-05-06 17:15:17 +09:00
YeonGyu-Kim 0a7306c6c1 Merge pull request #3637 from ihoooohi/fix/claude-thinking-legacy-alias-collision
fix(aliases): stop rewriting canonical claude-opus-4-6-thinking
2026-05-06 17:15:09 +09:00
YeonGyu-Kim 7e43beaa9e Merge pull request #3620 from MoerAI/fix/sisyphus-prompt-plan-reference
fix(agents): reference prometheus instead of conditional plan alias in prompts (fixes #3596)
2026-05-06 17:15:05 +09:00
YeonGyu-Kim 62a7356de3 Merge pull request #3621 from MoerAI/fix/skill-tool-respects-plugins-config
fix(tool-registry): pass plugins config to skill tool for proper command filtering (fixes #3582)
2026-05-06 17:15:01 +09:00
YeonGyu-Kim 9b87fd5019 Merge pull request #3744 from Arcadi4/dev
Allow "max" option for "reasoningEffort" field in config schema
2026-05-06 17:14:57 +09:00
Samuele Domenico Ruffino 467a4a5eed fix(test): use toContain instead of providers[0].toBe for multi-provider entries
Restore consistent assertion style in librarian and explore tests.
Multi-provider entries like ["opencode-go", "vercel"] should use
toContain() not providers[0].toBe() to match the established pattern.
2026-05-06 16:51:59 +09:00
Samuele Domenico Ruffino b7d77da88f fix(capabilities): add kimi-k2.6 to supplemental model entries
kimi-k2.6 is referenced in fallback chains but missing from the bundled snapshot (which only has kimi-k2.5). Added supplemental entry with specs matching models.dev data.
2026-05-06 16:51:59 +09:00
Samuele Domenico Ruffino 1e93d37df6 docs(opencode-go): update docs and fallback chain tables to reflect glm-5.1, kimi-k2.6, qwen3.5-plus 2026-05-06 16:50:33 +09:00
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
Samuele Domenico Ruffino 0727d9a1a3 fix(opencode-go): replace non-existent minimax-m2.7-highspeed with qwen3.5-plus 2026-05-06 16:45:30 +09:00
YeonGyu-Kim d1a7c8f17a Merge pull request #3096 from s2mr/fix/git-master-language-agnostic-support
docs(git-master): make language handling generic (incl. Japanese examples)
2026-05-06 16:40:56 +09:00
YeonGyu-Kim abba70cb1e Merge pull request #3691 from islee23520/chore/gpt-5.5-followup-cleanup
docs: align GPT-5.5 model references
2026-05-06 16:39:03 +09:00
YeonGyu-Kim 5624393367 Merge pull request #3783 from matchai/feat/walk-up-config-discovery
feat(config): walk up directory tree to merge ancestor plugin configs
2026-05-06 16:37:01 +09:00
ilseob lee 766cdaf893 docs: align GPT-5.5 model references 2026-05-06 16:33:07 +09:00
Matan Kushner eb1e104742 refactor(config): tighten walk-up config discovery from oracle review
Stop the walk at the start directory when it sits outside $HOME so the
walker never falls through to filesystem root. Without this guard a
project at /tmp/x or /opt/projects/foo would surface unrelated configs
in /tmp, /opt, or / itself.

Also clean up reviewer-flagged friction:

- Rename ancestor path/override variables to *NearestFirst /
  *FarthestFirst so the merge order is self-documenting and the
  mid-flight `.slice().reverse()` is no longer surprising.
- Rename `migrateLegacyAndResolveCanonicalPath` to
  `resolveConfigPathAfterLegacyMigration` to reflect that the helper
  returns the path to load, which may still be the legacy path when
  migration could not run.
- Replace `Object.assign({}, ...overrides)` with a named accumulator
  loop so the closer-wins ordering is obvious from the code instead of
  relying on a comment.

Tests added:

- start directory outside $HOME does not walk above itself
- multi-ancestor git_master merge order (closer wins, distant fields
  still flow through)
- agent_definitions in an ancestor resolves against that ancestor's own
  .opencode/ base path, not the start directory's
2026-05-06 16:29:06 +09:00
Matan Kushner cc1d9cf030 feat(config): walk up directory tree to merge ancestor plugin configs
Closes #417.

The user config (`~/.config/opencode/oh-my-openagent.json[c]`) is no
longer the only level above the project. `loadPluginConfig` now walks
from the working directory up to `$HOME` (inclusive), collecting every
`.opencode/oh-my-openagent.json[c]` it finds along the way. Configs
closer to the working directory override configs farther up, allowing
per-tree setups like:

    ~/work/.opencode/oh-my-openagent.json     # work credentials
    ~/dev/.opencode/oh-my-openagent.json      # personal credentials
    ~/.config/opencode/oh-my-openagent.json   # global fallback

This subsumes the previous single project-config load: the project's
own config is just the closest hit of the walk. `agent_definitions`
relative paths resolve against each ancestor's own `.opencode/` base,
`git_master` overrides accumulate across the walk (closer wins), and
legacy basenames are migrated wherever they appear.

`mcp_env_allowlist` is intentionally NOT extensible from walked
ancestors. It remains user-only as a security boundary so a malicious
or untrusted parent directory cannot extend the env var allowlist used
during ${VAR} expansion in `.mcp.json` files. The existing test that
pins this behaviour is extended to cover the multi-ancestor case.

`os.homedir()` caches in Bun, so the stop directory is resolved by
reading `process.env.HOME` directly. Production behaviour is unchanged
because the OS sets HOME at startup; tests can now redirect the walk
boundary by setting HOME to a temp directory before each call.
2026-05-06 16:28:11 +09:00
YeonGyu-Kim 47b5c56660 fix(ralph-loop): retry runtime errors immediately
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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