Commit Graph

4997 Commits

Author SHA1 Message Date
李冠辰 d788c3d1a9 fix(migration): stop rewriting explicit gpt-5.3-codex to gpt-5.4 (#3777)
`openai/gpt-5.3-codex` is the codex-series powerhouse still recommended
in docs/guide/agent-model-matching.md and listed in the default
fallback chain in docs/reference/configuration.md, not a deprecated
alias for `gpt-5.4`. The migration entry silently rewrote any user
config that picked `gpt-5.3-codex` for its token efficiency, sending
agents to a non-codex model on every startup.

Drop the bogus mapping from MODEL_VERSION_MAP and add a regression
test that explicit `gpt-5.3-codex` selections (including in nested
fallback_models) survive `migrateModelVersions`. Users already
auto-migrated previously can revert to `gpt-5.3-codex` by hand and it
will now stick on subsequent loads regardless of the sidecar history.
2026-05-22 11:36:22 +08:00
YeonGyu-Kim 11c3da752c fix(default-mode,multimodal-looker,delegate-task): preserve user-expected behavior
default-mode (system-transform):
- e5463e2db introduced auto-activation of ultrawork+ralph-loop, and
  dc2e082ac then skipped the ultrawork system prompt whenever ralph_loop
  was also enabled. Net effect: the keyword-detector still showed
  'Default ultrawork mode enabled' to the user, but the first turn had
  none of the ultrawork behavior. Loop continuation kept the ultrawork
  prefix, so the contract was honored only on later iterations.
- Drop the skip so the initial turn matches what the toast advertises.
  New matrix test pins all four (ultrawork, ralph_loop) combinations.

multimodal-looker:
- Prompt claimed 'read' and 'call_omo_agent' were available, but the
  look_at invocation runtime explicitly disables both via READ_ENABLED
  and createAgentToolAllowlist([]). Small VL models trusted the prompt
  and looped on rejected tool calls (#4116).
- Rewrite the agent prompt to describe direct-attachment analysis and
  forbid tool/agent calls. Add a consistency test that extracts the
  prompt's 'available tools' claim and compares it against the
  configured allowlist.

delegate-task (skill-resolver):
- 088693697 filtered per-agent restricted skills at the skill tool and
  builtin agent prompt layers, but delegate-task itself happily injected
  whatever skill name a caller passed. A target agent could be force-fed
  a skill marked agent: oracle just by listing it in load_skills.
- Thread the target agent through resolveSkills and silently filter
  skills whose definition.agent does not include it. Public skills with
  no restriction are unaffected. Regression test pins the bypass.
2026-05-22 00:07:46 +09:00
YeonGyu-Kim 7cce0ad230 fix(notepad-guard,start-work): wire dispatch and match .omo paths
notepad-write-guard:
- The hook was created by create-tool-guard-hooks but tool-execute-before
  never invoked it, so the guard was inert.
- It also only matched .sisyphus/notepads, missing the current
  .omo/notepads layout introduced by the workspace migration.
- Add the dispatch call alongside writeExistingFileGuard, and extend
  NOTEPAD_ROOTS to cover both paths via normalize() + sep. New
  integration test pins the wire and the .omo block; the existing unit
  test now asserts both paths.

start-work session-plan-affinity:
- PLAN_PATH_PATTERN only matched .sisyphus/plans, so sessions referring
  to plans under .omo/plans returned null and start-work missed the
  current session's own plan.
- Extend the regex to .(sisyphus|omo)/plans and add findPrometheusPlans
  in packages/boulder-state to scan both directories during the
  transition. New regression test pins .omo/plans matching; legacy
  .sisyphus/plans coverage preserved.
2026-05-22 00:07:46 +09:00
YeonGyu-Kim 3f44b45fa2 feat(i18n): wire initI18n into production plugin startup
6ffea1bc3 added i18n with en/zh locales and plugin config support, but
the initI18n() call lived in the original src/index.ts. When src/index.ts
became an 18-line wrapper that delegates to
src/testing/create-plugin-module.ts createPluginModule(), the call site
was dropped on the floor. Result: i18n.locale config and LANG env both
ignored at runtime, every toast stayed English regardless of user
setting.

Inject initI18n as a managed dependency and call it in
createPluginModule() immediately after loadPluginConfig(), passing
pluginConfig.i18n?.locale through. Add an integration test that boots
the plugin with i18n.locale='zh' and asserts getLocale() returns 'zh'
and t('toast.task_completed') returns the Chinese string. Regression
locked - subsequent moves of the startup path will fail loudly.
2026-05-22 00:07:46 +09:00
YeonGyu-Kim 2e2e33cfc0 test: fix stale imports after prompt-async-gate and model-core refactors
- prompt-async-gate.test.ts: refactor ced36bffc removed
  promptAsyncAfterSessionIdle in favor of the unified
  dispatchInternalPrompt({ mode: 'async', ... }). One call site at
  line 1441 was left behind. Replace it with the current API and pass
  the explicit dispatchTimeoutMs so the status-timeout semantics are
  preserved. Also switch the surrounding tests to the third-argument
  timeout form so Bun's typings stay happy.
- runtime-model-readers.test.ts: implementation moved to
  packages/model-core during the layering refactor; the orphaned test
  still pointed at './runtime-model-readers'. Switch to the package
  export via getModelCapabilities and keep the modality-reader
  coverage by deriving keys through the package API.
2026-05-22 00:07:46 +09:00
YeonGyu-Kim 9624914c25 test(disabled-providers): drop logger mock to fix global mock-module leakage
mock.restore() in afterAll is global in Bun, so the previous attempt to
satisfy mock-module-lifecycle-audit by pairing mock.module('./logger')
with afterAll(() => mock.restore()) tore down mocks owned by other
tests. Concretely, running this file before src/hooks/runtime-fallback
produced 42 cascading fallback test failures.

The logger mock was decorative - tests do not assert log calls, and the
real logger only writes to oh-my-opencode.log in the OS temp dir. Drop
the mock entirely so the audit has nothing to score and other tests
keep their mocks intact.
2026-05-22 00:07:46 +09:00
YeonGyu-Kim bc0da0fad3 test: fix prometheus-prompt syntax + sync display name casing to lowercase
- prometheus-prompt.test.ts: close missing }) on the OpenSpec expanded
  commands describe block (introduced by d66b6bcbf, parse error).
- agent-sort-shim/agent-config-integration/continuation-injection/
  unstable-agent-babysitter/subagent-resolver/sync-executor/
  resolve-caller-team-lead tests: expect 'Sisyphus - ultraworker'
  (lowercase) to match production after cd39f8858, which lowercased the
  display name to dodge a TUI ZWSP rendering glitch. Legacy uppercase
  inputs that exercise the normalization path are preserved.
- sync-executor.ts + resolve-caller-team-lead.ts: route legacy display
  name inputs through normalizeAgentForPrompt so prompt agent names and
  caller team lead lookups produce the canonical lowercase form.
2026-05-22 00:07:46 +09:00
YeonGyu-Kim f1bf61efb9 fix: resolve duplicate ANALYZE_MESSAGE/ANALYZE_PATTERN identifiers in keyword-detector constants 2026-05-21 17:26:19 +09:00
YeonGyu-Kim 8a5811bf84 chore(comment-checker): drop dead apply-patch-edits re-export shim
src/hooks/comment-checker/apply-patch-edits.ts was already a pure re-export over @oh-my-opencode/comment-checker-core after the core extraction landed. Every importer now reaches into the package directly, so the shim has no remaining call sites and can be removed.

Verified: rg "comment-checker/apply-patch-edits" src/ packages/ returns no matches.
2026-05-21 16:19:38 +09:00
YeonGyu-Kim 7c66aae0b8 refactor(rules-engine): centralize rule constants and AGENTS.md walk-up
Promote the project-rule constants (PROJECT_MARKERS, PROJECT_RULE_SUBDIRS, PROJECT_RULE_FILES, OPENCODE_USER_RULE_DIRS, USER_RULE_DIR, GITHUB_INSTRUCTIONS_PATTERN, RULE_EXTENSIONS, AGENTS_FILENAME, etc.) and the findAgentsMdUp walk-up helper out of the agents-md-core and rules-injector adapters and into @oh-my-opencode/rules-engine, the single owner of rule discovery.

- packages/agents-md-core/ drops the findAgentsMdUp/AgentsMdDiscoveryInput wrappers (now sourced directly from rules-engine) and its constants module re-exports AGENTS_FILENAME from rules-engine instead of duplicating it.
- src/hooks/directory-agents-injector/finder.ts pulls findAgentsMdUp from rules-engine directly while still re-exporting resolveFilePath from agents-md-core.
- src/hooks/rules-injector/constants.ts becomes a pure re-export shim over the rules-engine constants.

Add packages/agents-md-core/src/injector.test.ts to lock the root-skipping AGENTS.md injection order so future changes to findAgentsMdUp cannot silently regress the [Directory Context: ...] block format the injector emits.

Tests: bun test packages/agents-md-core packages/rules-engine src/hooks/directory-agents-injector src/hooks/rules-injector
2026-05-21 16:19:38 +09:00
YeonGyu-Kim edaa95fec0 refactor(model-core): host snapshot fetcher, suggestion parser, and context-limit resolver
Move three pure helpers from src/shared/ into @oh-my-opencode/model-core so the package can stand alone without depending on plugin internals:

- buildModelCapabilitiesSnapshotFromModelsDev + fetchModelCapabilitiesSnapshot (models.dev normalization)
- parseModelSuggestion (cross-provider ProviderModelNotFoundError suggestion extraction)
- resolveActualContextLimit (Anthropic GA 1M context override)

Split provider-model-id-transform into two variants exposed by model-core:

- transformModelForProvider keeps the runtime dash to dot Anthropic rewrite used by the SDK
- transformModelForProviderDisplay preserves hyphenated Anthropic IDs so the installer writes registry-compatible model strings, fixing the ProviderModelNotFoundError fresh installs hit when the dotted form leaks into the config

src/shared/* and src/cli/provider-model-id-transform.ts collapse to re-export shims that point at the new core modules. Stale src/shared/{known-variants,model-capability-aliases,model-capability-guardrails,model-capability-heuristics}.ts re-export files plus the duplicated context-limit-resolver test are removed in favor of the canonical model-core copies.

Tests: bun test packages/model-core src/shared/model-capabilities-cache.test.ts src/cli/provider-model-id-transform.test.ts
2026-05-21 16:19:38 +09:00
YeonGyu-Kim 4ea76365cd refactor(packages): extract hashline-core package
Move the hash-anchored edit core (hash computation, validation, edit operations, text normalization, chunk formatter, diff utilities, and a runtime-aware xxHash32 binding) into a new @oh-my-opencode/hashline-core workspace package.

The src/tools/hashline-edit/ surface becomes a set of thin re-export shims, so existing import paths in the plugin keep working while the pure logic lives behind a stable package boundary that has no opencode runtime dependencies.

Tests: bun test packages/hashline-core src/tools/hashline-edit
2026-05-21 16:19:38 +09:00
YeonGyu-Kim f29411a689 Merge pull request #4235 from code-yeongyu/fix/subagent-timeout-active-output
fix(background-agent): track active subagent output
2026-05-21 16:15:53 +09:00
YeonGyu-Kim dbfde0b056 fix(background-agent): ignore metadata stream output 2026-05-21 16:12:53 +09:00
YeonGyu-Kim 282010f97d fix(background-agent): gate stale timeout on abort success 2026-05-21 15:59:50 +09:00
YeonGyu-Kim 6d15ab86ab fix(background-agent): fail cancellation when abort fails 2026-05-21 15:50:28 +09:00
YeonGyu-Kim bd1a6e3d3b fix(background-agent): forward session stream activity 2026-05-21 15:49:58 +09:00
YeonGyu-Kim 90c38d16b4 Merge remote-tracking branch 'origin/dev' into fix/subagent-timeout-active-output 2026-05-21 15:23:59 +09:00
YeonGyu-Kim 0bf8a9df25 fix(background-agent): fail abort on SDK errors
Treat resolved abort responses with a non-null error payload the same as rejected aborts. This prevents stale-timeout cancellation bookkeeping from reporting success when the child session was not actually aborted.

Plan: .omo/plans/subagent-timeout-active-output.md
2026-05-21 15:23:52 +09:00
YeonGyu-Kim a562d5367f fix: strip mcp_ prefix from tool names before dispatch
The model emits tool names like mcp_background_output but the runtime
registry has them as background_output. While transformToolName already
handles the prefix for display purposes, the tool dispatch path in
tool-execute-before was not stripping it, causing 'unavailable tool' errors.

This adds mcp_ prefix stripping at the earliest point in the tool
execution pipeline, fixing background_output, background_cancel, and
all nocturne-memory_* tools.

Closes #2697
2026-05-21 15:23:28 +09:00
YeonGyu-Kim b68af25e41 fix(background-agent): track session.next activity
Convert OpenCode v2 session.next stream events into the existing message part activity path so child sessions that are still producing text, reasoning, or tool output refresh lastUpdate before stale polling runs.

This keeps the timeout poller from cancelling active subagents and preserves tool-call progress for session.next.tool.called events.

Plan: .omo/plans/subagent-timeout-active-output.md
2026-05-21 15:23:26 +09:00
YeonGyu-Kim 6c0252fae4 Merge pull request #3742 from mrosnerr/fix/schema-preserve-custom-agent-overrides
fix(schema): preserve custom agent overrides
2026-05-21 15:14:04 +09:00
YeonGyu-Kim 6e1e01ebe0 Merge pull request #4219 from sjawhar/fix/skill-discovery-opencode-config
fix(skill-discovery): load native OpenCode skills in task delegation
2026-05-21 15:07:39 +09:00
MoerAI 61b812ffa9 fix(keyword-detector): stop hyperplan firing on '.hpp' C++ header paths (fixes #4215)
The hyperplan trigger \b(hyperplan|hpp)\b/i matched 'hpp' inside common C++ header references like 'check interface.hpp' or 'open buffer.hpp'. The leading '.' is a non-word character, so \b is already satisfied and the false positive fires the hyperplan-mode prompt on routine code questions.

Split the alternation so 'hpp' additionally requires that the preceding character is neither a word character nor a '.'. This preserves every existing trigger ('hpp do this', '/hpp ...', mid-sentence usage, mixed case) while rejecting filename uses of the .hpp extension. The longer 'hyperplan' keyword keeps the original \b boundary semantics.

Reproduction (added regression tests):
- 'please help to check interface.hpp' must NOT fire
- 'open src/include/audio/buffer.hpp and fix the leak' must NOT fire

All 14 cases in hyperplan.test.ts pass (12 existing + 2 new), broader keyword-detector suite stays green (92 pass), typecheck clean.
2026-05-21 13:39:34 +09:00
YeonGyu-Kim 0feb125079 fix(background-agent): preserve missed polls on lookup errors 2026-05-21 13:13:14 +09:00
YeonGyu-Kim 98d475f95e test(agent): align remapper fallback display name 2026-05-21 13:12:57 +09:00
YeonGyu-Kim 7e8a61aed8 Merge pull request #2307 from SwiggitySwerve/feat/prometheus-spec-awareness
feat(prometheus): add spec-driven development framework awareness
2026-05-21 13:07:33 +09:00
YeonGyu-Kim b2971a6ac3 Merge pull request #2827 from z-traveler/feat/per-agent-skill-filtering
feat: filter agent-restricted skills from prompts and tool description
2026-05-21 13:07:30 +09:00
YeonGyu-Kim 3d40264456 Merge pull request #4228 from code-yeongyu/fix/delegate-stale-activity
Fix delegate stale timeout activity checks
2026-05-21 12:59:11 +09:00
YeonGyu-Kim deb13d8e86 Merge pull request #3241 from cpkt9762/fix/configurable-task-cleanup-delay
feat(background-task): make taskCleanupDelayMs configurable
2026-05-21 12:58:54 +09:00
YeonGyu-Kim 4b6877cb4a Merge pull request #3294 from kilhyeonjun/fix/doctor-custom-provider-regression
test(doctor): cover custom provider config regression
2026-05-21 12:58:51 +09:00
YeonGyu-Kim d78ebc1280 Merge pull request #3370 from Zireael/fix/git-bash-shell-detection-on-windows
fix: detect Git Bash/WSL/MSYS2 shell on Windows (non-interactive-env hook)
2026-05-21 12:58:48 +09:00
YeonGyu-Kim 6678c2ae04 Merge pull request #3884 from leeyazhou/i18n
feat(i18n): add toast i18n with en/zh locale and plugin config support
2026-05-21 12:58:45 +09:00
YeonGyu-Kim c5f8fd4060 Merge pull request #4031 from PeterPonyu/feat/config-disabled-providers
feat(config): add disabled_providers schema + helper
2026-05-21 12:58:42 +09:00
YeonGyu-Kim e4a60b8cd2 Merge pull request #4048 from PeterPonyu/feat/doctor-check-tui-plugin
feat(doctor): warn when oh-my-openagent/tui is missing from tui.json
2026-05-21 12:58:39 +09:00
YeonGyu-Kim 735b4d2997 Merge pull request #4070 from PeterPonyu/fix/4036-prompt-shield-system-directive-marker
fix(prometheus-md-only): replace SYSTEM DIRECTIVE marker with XML tag in external prompts (#4036)
2026-05-21 12:58:36 +09:00
YeonGyu-Kim 45e5d5ddfc Merge pull request #4071 from PeterPonyu/fix/4027-role-coordinator-subagent-selection
fix(team-mode): reject coordinator agents as subagent targets (#4027)
2026-05-21 12:58:33 +09:00
YeonGyu-Kim d7d023bf27 Merge pull request #4072 from PeterPonyu/fix/3645-runtime-fallback-git-silent-fail
fix(runtime-fallback): fall back to synthetic continuation when session messages are empty (#3645)
2026-05-21 12:58:30 +09:00
YeonGyu-Kim 689ad9970b Merge pull request #4079 from PeterPonyu/refactor/3694-extract-analyze-constants
refactor(keyword-detector): consolidate analyze pattern/message into analyze/default and document delegate_task params (#3694)
2026-05-21 12:58:27 +09:00
YeonGyu-Kim 9cca6848c9 Merge pull request #4081 from PeterPonyu/feat/4004-agent-display-name-i18n
feat(agents): support per-agent displayName for i18n (#4004)
2026-05-21 12:58:21 +09:00
YeonGyu-Kim acedacc5e7 Merge pull request #4084 from pizzav-xyz/feature/keyword-detector-enabled-expansions
feat(keyword-detector): add enabled_expansions config for allowlist control
2026-05-21 12:58:18 +09:00
YeonGyu-Kim ba5bc0ef4f Merge pull request #4092 from code-yeongyu/fix/status-timeout-hang
fix(shared): add timeout to isSessionActive to prevent infinite hang
2026-05-21 12:58:14 +09:00
YeonGyu-Kim a7401a34ac Merge pull request #4157 from ririnto/docs/config-reference-alignment
docs: align config reference with implementation
2026-05-21 12:58:11 +09:00
YeonGyu-Kim b40426ca1b Merge pull request #4190 from herjarsa/feat/default-mode
feat(default-mode): auto-activate ultrawork and ralph loop without commands
2026-05-21 12:58:04 +09:00
YeonGyu-Kim d502900201 Merge pull request #4221 from heunghingwan/feat/plan-format-validator
Add plan format validator hook to detect malformed task labels
2026-05-21 12:58:01 +09:00
YeonGyu-Kim e4049b7ab3 Merge pull request #4222 from andomeder/wip/pr1-skip-disconnected-explicit-provider-fallbacks
fix(background-agent): skip disconnected explicit-provider fallbacks
2026-05-21 12:57:58 +09:00
YeonGyu-Kim bd55396266 fix(look-at): avoid empty stable idle completion 2026-05-21 12:54:56 +09:00
YeonGyu-Kim bd61479315 Merge pull request #4227 from code-yeongyu/fix/post-4106-cleanup-20260521
fix: clean up post-4106 prompt gate artifacts
2026-05-21 12:53:17 +09:00
YeonGyu-Kim f6a2ff3541 test(coupling-audit): allowlist dual-runtime spawn shims 2026-05-21 12:50:10 +09:00
YeonGyu-Kim e15461febc refactor(model-core): inject bundled capabilities snapshot from harness
- remove bundled snapshot dependency on src/generated in model-core

- make shared harness provide runtime bundled snapshot

- update guardrail and capability tests to pass explicit snapshot

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-21 12:50:10 +09:00