Commit Graph

5081 Commits

Author SHA1 Message Date
soshymking aa97341cc9 Add support for OpenCode 1.15 DB 2026-05-25 20:12:22 +09:00
YeonGyu-Kim 28efc4e81f fix(continuation): resolve registered agent name before dispatching prompt (#4417)
/start-work was unresponsive under Atlas because ralph-loop and todo-continuation-enforcer normalized the inherited agent to a config key (e.g. 'atlas') while OpenCode only accepts the registered display name (e.g. 'Atlas (Plan Executor)'), producing 'Agent not found' on dispatch.

Prefer resolveRegisteredAgentName(agent) and fall back to normalizeAgentForPromptKey only when no registration exists, mirroring the start-work hook's resolution chain.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 17:48:32 +09:00
YeonGyu-Kim a5cee76961 fix(prompt-async-gate): retry object-form path on runtime type error (#4417)
Atlas task() with run_in_background=false crashed with 'The "path" property must be of type string, got object' from Node's path.isAbsolute validation upstream of the SDK.

All callers (sync-prompt-sender, boulder-continuation-injector, idle-event, session-route, model-suggestion-retry) already route through dispatchInternalPrompt, so centralizing the compatibility shim in prompt-async-gate.ts covers every Bug 1 site without touching individual hooks.

On TypeError matching the object-path signature, retry once with path collapsed to its id string. Types broaden PromptSessionPath to string | { id }.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 17:48:14 +09:00
YeonGyu-Kim 94d9d93212 Merge pull request #4453 from code-yeongyu/fix-4419-atlas-subagent-fallback
fix(background-agent): atlas subagent fallback retry on retryable model errors (#4419)
2026-05-25 17:33:03 +09:00
YeonGyu-Kim 0d0be4352d Merge pull request #4452 from code-yeongyu/fix-4449-tool-execute-after-stall
fix(tool-execute-after): prevent session stall on metadata recovery failure (#4449)
2026-05-25 17:27:54 +09:00
YeonGyu-Kim f57532cbdb fix(tool-execute-after): narrow metadata warning tools
Remove non-store tool names from the metadata recovery warning gate so call_omo_agent and dead aliases fail open without warning spam. Keep warnings for tools backed by the recovery store: background_output, edit, and task.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 17:17:11 +09:00
YeonGyu-Kim 6551f3893c fix(background-agent): retry Atlas subagents on usage limits
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 17:09:52 +09:00
YeonGyu-Kim 4a68db029d fix(tool-execute-after): gate metadata recovery warnings
Root cause: tool.execute.after attempted metadata recovery for every tool, including built-in tools that never publish recoverable OMO metadata. On Windows this produced repeated recovery warnings across read/bash/glob/grep/todowrite/lsp/apply_patch and amplified stalled-session diagnostics, while metadata-linked tools still needed diagnostic visibility when their linkage was stale.

Limit the warning to tools expected to publish recoverable metadata and keep all other built-in tools fail-open after missing metadata.

Fixes #4449

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 17:06:22 +09:00
YeonGyu-Kim 75d1ff4c87 fix(plugin-handlers): deny task for read-only subagents
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 16:55:21 +09:00
YeonGyu-Kim 9be97de641 Merge pull request #4435 from code-yeongyu/fix/issue-4429-team-mode-model-override
fix(agents): preserve user model overrides when team_mode enabled
2026-05-25 11:18:18 +09:00
YeonGyu-Kim eed88e4181 feat(help): #689 acp help JSON schema 2026-05-25 11:11:52 +09:00
YeonGyu-Kim 1fdb88a355 feat(help): #688 sandbox help JSON schema 2026-05-25 11:09:56 +09:00
YeonGyu-Kim 36e394a53d feat(help): #687 status help JSON schema 2026-05-25 11:08:15 +09:00
YeonGyu-Kim 21713dcd86 fix(agents): preserve model overrides with team mode
Filter host config agent aliases with the same protected builtin-name rules used for external agent sources so stale display-name entries cannot replace resolved user-configured models when team mode is enabled.

Fixes #4429

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 11:06:37 +09:00
YeonGyu-Kim 776da68e8b feat(help): #686 doctor help JSON schema 2026-05-25 11:05:41 +09:00
YeonGyu-Kim ce4b11b0d3 fix(cli): add explicit helpOption configuration for consistent help-flag ordering
Add explicit .helpOption('-h, --help') call to the Commander program configuration so the help option is explicitly defined rather than relying on Commander.js lazy initialization. Add corresponding test to pin the behavior.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 11:00:37 +09:00
YeonGyu-Kim 222adeb606 fix(runtime-fallback): honor retryable signal 2026-05-25 00:03:29 +09:00
YeonGyu-Kim de7f1d887d Merge pull request #4400 from code-yeongyu/refactor/prompts-core-oracle-cleanup
refactor(prompts-core): address Oracle caveats — stale AGENTS.md docs + byte-exact characterization tests
2026-05-24 19:22:49 +09:00
YeonGyu-Kim 8f09c02cc0 docs: scrub remaining references to migrated files
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 19:16:03 +09:00
YeonGyu-Kim d18cadb1ab test(ultrawork): add byte-exact characterization test
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 19:16:03 +09:00
YeonGyu-Kim e0b37b46d5 test(prometheus): add byte-exact characterization test
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 19:16:03 +09:00
YeonGyu-Kim 9d204250ee docs(keyword-detector): rewrite AGENTS.md for prompts-core migration
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 19:16:02 +09:00
YeonGyu-Kim 87e28d2607 docs(prometheus): rewrite AGENTS.md for thin-loader structure
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 19:16:02 +09:00
YeonGyu-Kim 3d0b4c4aac fix(parent-wake): block unfinished assistant wakes 2026-05-24 19:02:13 +09:00
YeonGyu-Kim 1f32b885d8 refactor(prometheus): remove migrated section TypeScript files 2026-05-24 18:44:46 +09:00
YeonGyu-Kim 8fc429a5de refactor(prometheus): load prompt variants from prompts-core 2026-05-24 18:44:24 +09:00
YeonGyu-Kim 803f030b5b Merge remote-tracking branch 'origin/dev' into refactor/mode-prompts-to-prompts-core
# Conflicts:
#	packages/prompts-core/src/index.ts
2026-05-24 18:35:36 +09:00
YeonGyu-Kim 528f083f5a Merge pull request #4388 from code-yeongyu/refactor/atlas-to-prompts-core
refactor(atlas): extract agent prompt variants to packages/prompts-core with runtime injection (PR5)
2026-05-24 18:33:07 +09:00
YeonGyu-Kim 80361c05ab chore(prompts-core): wire markdown prompt packaging
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:32:53 +09:00
YeonGyu-Kim 2c8e2dac41 refactor(mode-prompts): migrate hyperplan prompt
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:32:45 +09:00
YeonGyu-Kim e79baf5910 refactor(mode-prompts): migrate team prompt
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:32:35 +09:00
YeonGyu-Kim 3b7f51d568 refactor(mode-prompts): migrate analyze prompt
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:32:19 +09:00
YeonGyu-Kim 5cefbdbb6d refactor(mode-prompts): migrate search prompt
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:31:17 +09:00
YeonGyu-Kim c187dba56b test(keyword-detector): capture mode prompt baselines
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:30:53 +09:00
YeonGyu-Kim 8451ecd15e docs(atlas): document prompts-core prompt ownership
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:29:36 +09:00
YeonGyu-Kim 582c768b94 refactor(atlas): remove migrated TypeScript prompts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:29:25 +09:00
YeonGyu-Kim 4975c354b2 refactor(atlas): load prompt variants from prompts-core
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:29:12 +09:00
YeonGyu-Kim 96a9365044 build(prompts-core): bundle markdown prompt variants
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:29:05 +09:00
YeonGyu-Kim a92e25a196 test(atlas): add prompt byte preservation baselines
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:28:35 +09:00
YeonGyu-Kim d217efc195 build(prompts): inline markdown prompt imports
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:20:27 +09:00
YeonGyu-Kim e772c46819 refactor(ultrawork): move planner prompt to prompts-core
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:20:18 +09:00
YeonGyu-Kim e51acd0ad3 refactor(ultrawork): move gemini prompt to prompts-core
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:20:11 +09:00
YeonGyu-Kim a818bbd99c refactor(ultrawork): move gpt prompt to prompts-core
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:20:04 +09:00
YeonGyu-Kim 9c366cce3a refactor(ultrawork): move default prompt to prompts-core
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 18:19:56 +09:00
YeonGyu-Kim 87de056308 refactor(model-core): move model family detectors
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-24 17:16:40 +09:00
YeonGyu-Kim e1e9f348f0 Merge pull request #4382 from code-yeongyu/feat/ultrawork-prompt-tdd-evidence-tightening
feat(ultrawork): enforce TDD, scenario contract, durable notepad, reviewer gate
2026-05-24 15:55:43 +09:00
YeonGyu-Kim d073bf1bdf feat(ultrawork): enforce TDD, scenario contract, durable notepad, reviewer gate
Closes five gaps in the ultrawork prompt versus codex-plugins' parallel
directive, applied to all three model variants (default/Claude, GPT, Gemini)
with prompt-engineering entropy gate (each addition encodes a distinct
binding boolean, not narrative reinforcement):

1. TDD-MANDATORY (was conditional "when test infrastructure exists"):
   every production change follows RED -> GREEN -> SURFACE. Failing test
   first, capture assertion msg, smallest change to flip green, exercise
   real surface, capture artifact. Exemption whitelist: formatting /
   comment-only / version bump / rename-only, each must be justified
   in writing; unjustified exemption = rejection.

2. Scenario contract (was free-form Test Plan Template): require 3+
   scenarios upfront covering happy path, edge (boundary / empty /
   malformed / concurrent), adjacent-surface regression. Each scenario
   binds a binary pass condition, a real-surface artifact source, and
   a test file + test id written test-first.

3. RED->GREEN evidence capture (was "all tests pass"): every scenario
   requires TWO captured artifacts -- RED assertion msg before the
   change AND GREEN assertion msg after -- alongside the real-surface
   artifact (tmux / curl / browser / Playwright / computer-use /
   CLI stdout / parsed config / DB diff). Tests are the floor (always
   required); surface artifact is the ceiling (also required).

4. Durable notepad: mktemp -t ulw-*.md with append-only sections
   (Plan, Scenarios, Now, Todo, Findings, Learnings). Survives context
   loss; resume by re-reading.

5. Reviewer gate: trigger when user said strictly / rigorously /
   "deeply", or task touches 3+ files / 20+ turns / 30+ min, or it is
   refactor / migration / perf / security work. Reviewer verdict is
   binding ("looks good but..." = rejection). Loop until unconditional
   approval.

Plus: TODO format upgraded from vague "track every step" to atomic
`path: <action> for <scenario-id> -- verify by <check>` with a GOOD
test-first / impl pair example and a BAD list including
"production code before its failing test".

Per-variant adaptation:
- default.ts (Claude): full structured sections.
- gpt.ts (GPT-5.x): outcome-first prose, shorter prose per gpt-5.5 guide.
- gemini.ts: explicit enforcement framing + anti-optimism checkpoint
  upgraded with a TDD-violation question (#7).

Verified by:
- bun test src/hooks/keyword-detector/ (119 pass / 0 fail).
- lsp_diagnostics clean on all three files.
- Module-load smoke test confirms each exported message string parses
  and contains the new section anchors (TDD MANDATORY, SCENARIO
  CONTRACT, DURABLE NOTEPAD, REVIEWER GATE).

Char deltas (directive body only):
- default 13646 -> 17144 (+26%)
- gpt     6740  -> 9215  (+37%, was the leanest start)
- gemini  14196 -> 16136 (+14%)

Existing tests only assert presence of "ULTRAWORK MODE ENABLED!" which
is preserved verbatim in every variant.
2026-05-24 15:48:59 +09:00
YeonGyu-Kim 39a549a3df Merge pull request #4381 from code-yeongyu/fix/team-mode-closure-prompts
fix(team-mode): make lead close teams on its own initiative
2026-05-24 15:37:28 +09:00
YeonGyu-Kim 5f1fb0c52a fix(team-mode): make lead close teams on its own initiative
The lead currently leaves teams alive after the task list drains because
none of the prompt surfaces tell it WHEN to close or HOW. omx-style
'self-closing' behavior was missing for four reasons (diagnosed via
prompt-engineering A/B/C: wrong / misframed / missing):

1. builtin team-mode skill 'Lifecycle' (B+C): 'phase ends / shape
   outgrown' is qualitative, so the model maps it to 'wait for user'.
   Step 6 jumped to team_delete without the request/approve pair the
   tool contract requires. Replaced with a 'Closure Contract' (a
   computable predicate over team_task_list + team_status) and an
   explicit 'Closure Sequence' (request -> approve -> delete, with
   force=true reserved for unrecoverable paths only).

2. TEAM_MESSAGE keyword injection (C): spent 100%% of its one-shot
   budget on routing ('do not substitute delegate_task'), 0%% on
   closure. Added the same closure rule in compressed form. Kept the
   'NEVER substitute with delegate_task' literal that
   keyword-detector/index.test.ts depends on.

3. team-mode-status-injector body (C): the only per-session injection
   for team mode had no closure obligation. Replaced the optional
   'load the team-mode skill ... otherwise use the team_* tools'
   sentence with a 'Closure invariant' clause that ties the check to
   every team_task_update.

4. member-guidance Wrap-up (A+B): step 3 said 'so the lead can decide
   whether to request shutdown', but team_shutdown_request is
   lead-only - members cannot initiate it. Step ordering also placed
   the completion message before team_task_update, so the lead's
   closable check would see stale data. Reordered to
   task_update -> check task_list for new work -> if nothing left,
   send a single 'closure-ready' message and idle. Test assertion
   updated to match the new accurate contract.

Also: stripped Korean alternation from TEAM_PATTERN per directive
('절대로 코드 내에 한국어 적지 마라'). Pattern is now
/\\bteam[\\s_-]?mode\\b/i. Removed 4 Korean test cases
(2 positive triggers + 2 false-positive guards) that the pattern no
longer needs to defend, and updated the keyword-detector AGENTS.md
row.

Net: -71 lines across prompt surfaces. The Closure Contract is the
only addition; everything else tightened.

Tests: 428/428 pass across src/features/team-mode/,
src/features/builtin-skills/, src/hooks/keyword-detector/,
src/hooks/team-mode-status-injector/, src/hooks/team-mailbox-injector/,
src/hooks/team-tool-gating/, src/hooks/team-session-events/.
LSP: no errors introduced (one pre-existing error in
keyword-detector/index.test.ts confirmed pre-existing on dev).
2026-05-24 15:21:24 +09:00
YeonGyu-Kim 9a1dd75608 fix(ralph-loop): skip handleFailedVerification when oracle dispatch is in flight (#4256)
When verification_pending is true and the agent has dispatched an Oracle
verification (verification_attempt_id is set), session.idle events that
arrive before tool-execute-after stores the Oracle session ID
(verification_session_id still undefined) caused handlePendingVerification
to fall through to handleFailedVerification. This injected a duplicate
'verification failed' continuation prompt, spawning a second Oracle.

The fix adds a guard in handlePendingVerification: when
verification_attempt_id is set but verification_session_id is not, Oracle
dispatch is in flight and the handler returns early instead of declaring
failure. The pending wake will retry on the next session.idle.

Regression test added in given/when/then style proving the race sequence:
  1. ULW loop detects DONE, enters verification_pending
  2. Oracle dispatch stamps verification_attempt_id (tool-execute-before)
  3. Second session.idle fires before tool-execute-after stores session ID
  4. Handler must NOT call handleFailedVerification

RED (before fix): 2 prompt injections (duplicate Oracle)
GREEN (after fix): 1 prompt injection (correct)

Fixes #4256
Fixes #4019
2026-05-24 15:00:26 +09:00