[Bug][LazyCodex] $omo:ulw-plan also triggers full Ultrawork mode, compounding planning and subagent stalls
Summary
Invoking the planning-only Codex skill $omo:ulw-plan also activates the generic Ultrawork UserPromptSubmit hook. The hook searches the entire current prompt with /(?:ultrawork|ulw)/i, so the ulw inside the skill name causes a second, full <ultrawork-mode> directive to be injected.
The result is two overlapping contracts in one turn:
ulw-plan: planning consultant, stop at a decision-complete plan, never implement.ultrawork: open a goal/notepad, create exhaustiveupdate_planstate, fan out subagents, wait on dependent child barriers, verify, and continue until completion.
In the observed run, a bounded RCA-and-plan request remained active for about six hours with very little user-visible progress. Long Codex tool calls were a contributing trigger, but the deterministic LazyCodex routing collision caused a planning-only request to inherit the heavier execution workflow and its unbounded wait rules.
Environment
- OS: Windows 11 Pro
10.0.26200(build26200) - Codex Desktop:
26.707.3748.0 - Codex CLI:
0.142.4 - Active plugin:
omo@sisyphuslabs 4.16.2 - Also verified against current LazyCodex
mainatbb8764ca1754148ca56478d433c42b91c550e0f4(marketplace4.16.3sync) - Node.js used for the packaged-hook probe:
24.11.1
Repository Decision
This report belongs in code-yeongyu/lazycodex because the confirmed defect is in the Codex-specific Ultrawork UserPromptSubmit hook shipped by LazyCodex. Upstream Codex issues may explain individual long tool calls or child-result loss, but upstream Codex does not decide that $omo:ulw-plan should receive <ultrawork-mode>.
Related but not duplicate:
- oh-my-openagent#5021 covers general Codex planner/reviewer wait liveness, not this trigger collision.
- oh-my-openagent#1501 covered an older OpenCode ULW/continuation planning loop.
- openai/codex#24951 covers multi-agent tool calls exceeding their timeout on Windows.
- openai/codex#26728 covers child completion loss after parent compaction.
- openai/codex#24206 covers Codex Desktop file-edit tool hangs.
Reproduction
From plugins/omo/components/ultrawork in either the installed 4.16.2 payload or current 4.16.3 source:
printf '%s\n' '{"hook_event_name":"UserPromptSubmit","prompt":"$omo:ulw-plan RCA and improvement plan only"}' \
| node dist/cli.js hook user-prompt-submit \
| rg -o '<ultrawork-mode>'
Actual output:
<ultrawork-mode>
Control prompt without ulw returns zero bytes:
printf '%s\n' '{"hook_event_name":"UserPromptSubmit","prompt":"RCA and improvement plan only"}' \
| node dist/cli.js hook user-prompt-submit \
| wc -c
0
The same detector also injects Ultrawork for non-activation substrings such as refactor ulw_helper.ts. Current tests explicitly pin 하이ulw and ulw_helper.ts as positive triggers.
Expected
- An explicit
$omo:ulw-planinvocation should load the selected planning skill without also injecting the generic full Ultrawork execution contract. - Explicit skill routing should take precedence over substring keyword routing.
- Identifiers such as
ulw_helper.tsshould not activate Ultrawork. - A user should be able to request planning only and reliably reach the approval/plan handoff stop condition.
Actual
$omo:ulw-plandeterministically receives<ultrawork-mode>in addition to the planning skill.- The two contracts add separate state, delegation, wait, and review requirements.
- The planning request can become dominated by subagent barriers and continuation work instead of reaching the concise plan handoff.
- In the observed run, continuation occurred after long waits and previously active child deliverables were not all available to the resumed parent, causing more discovery and orchestration.
Evidence
Deterministic source evidence
codex-hook.tsdefines the unbounded substring detector and injects additional context when it matches.isUltraworkPromptis only the regex test.codex-hook-trigger-policy.test.tscurrently requires embeddedulwsubstrings to activate the hook and has noulw-planexclusion test.ulw-plan/SKILL.mdsays to stop at sufficiency but also blocks dependent planning/final handoff until child lanes terminate or are recorded inconclusive.ultrawork/SKILL.mdadds a durable notepad andupdate_plantransition protocol; its child barrier adds further wait/respawn requirements.- In
4.16.3,full-workflow.mdexplicitly says elapsed time alone never justifies cancelling, replacing, or failing the high-accuracy reviewer.
Runtime evidence from the affected run
- Planning-only request remained active for approximately six hours.
- One small
apply_patchexecution reported974.6 secondswall time before yielding a running cell. - A later wait on another patch execution reported
375.7 secondswall time. - A focused test invocation reported
249.7 secondsbefore yielding, while the same targeted tests later completed in0.001and0.015seconds. This refutes the target tests themselves as the main delay. - After continuation/interruption, only the root agent remained visible; final deliverables from several previously active child lanes were unavailable.
- The packaged hook probe above reproduces on both installed
4.16.2and current4.16.3.
Root Cause
The confirmed LazyCodex root cause is prompt-routing collision:
ULTRAWORK_CURRENT_PROMPT_PATTERNmatchesulwanywhere, without token boundaries or exclusions for explicitulw-*skill names.$omo:ulw-plantherefore activates both the selected planner and the generic Ultrawork hook.- The injected full workflow compounds the planning skill's own delegation and wait rules.
- When Codex has a slow tool call or loses a child completion across continuation, the combined contracts lack a progress-aware bounded degradation path, so the workflow can keep waiting or re-orchestrating for hours.
Competing hypotheses were checked:
- Upstream Codex tool/control-plane stalls are a real contributing trigger, supported by the related upstream reports, but they do not explain the deterministic extra LazyCodex directive.
- Slow target tests were ruled out by direct millisecond test runtimes.
Proposed Fix
- Give explicit LazyCodex skill invocations precedence over the generic keyword detector. At minimum,
$omo:ulw-plan,$omo:ulw-loop, and$omo:ulw-researchshould not implicitly activate full Ultrawork unless a separate explicit Ultrawork activation is also present. - Replace arbitrary substring matching with an activation parser or a Unicode-aware standalone-token rule that excludes hyphenated skill names, identifiers, and filenames.
- Add a liveness backstop for combined planner/reviewer workflows: track last meaningful progress, persist child IDs/status/results before waiting, warn on staleness, and allow a lane to become durably inconclusive after a bounded recovery sequence.
- Reconcile continuation from the exact recorded phase instead of re-running completed research or respawning equivalent lanes.
Verification Plan
- Hook unit tests must return no additional context for:
$omo:ulw-plan RCA and improvement plan only[$omo:ulw-plan](...)refactor ulw_helper.ts하이ulw
- Existing intended activation forms such as
ulw fix thisandplease ulw this changemust still inject<ultrawork-mode>. - Add a precedence test where
$omo:ulw-planplus a separate explicit Ultrawork activation follows the documented intended behavior. - Run the packaged CLI smoke probe against the marketplace payload, not only source imports.
- Add an integration fixture that invokes
$omo:ulw-planand verifies that the planner reaches its approval/plan stop condition without a second Ultrawork state machine. - Simulate a slow child/tool plus continuation and verify bounded, durable recovery without losing completed child evidence or re-running completed research.
This issue or PR was generated by LazyCodex. Tag: lazycodex-generated
New runtime evidence: 22h34m Birkin session
This session adds a second, larger reproduction of the liveness failure described here and confirms that the uncapped dual-review rule is independently sufficient to keep planning active for hours.
Environment
- Session ID:
019f5913-0c8e-7103-8a70-12d6a3675a6d - Codex CLI:
0.144.1 - OMO/LazyCodex plugin:
4.17.0 - OS: Windows
- Latest source checked: LazyCodex
3d7416bff3e6c80ebf5542b4dd12f5c76298d46d; upstream Codex7f3eb8a2233aceba3e7962123da84379ee305bb2
Observed runtime
- First WebUI request to verified push: 22h34m41.669s.
- Session usage: 8,917,030 tokens.
- Before implementation, the session ran at least 14 numbered paired Momus + independent CLI review rounds (
R4throughR17), plus earlier unnumbered plan reviews. - Repeated findings were mostly orchestration-contract refinements: immutable plan receipts, Windows process-broker identity, patch/index recovery, screenshot freshness, and goal-completion versus push ordering.
- The user explicitly intervened after 22 hours: "finish and push now; stop repeating regression checks."
- After the workflow abandoned the exhaustive review state machine and switched to a minimal implementation plan, backend and frontend implementation began within about 2.5 minutes.
- The product then completed successfully: commit
f8aa6b8d2d0c938853487271b89f979e8df2dd2e,SOURCE_HEAD == origin/main, exactly eight requested files, full suite755 passed, final focused suite33 passed. - Raw transcript:
%CODEX_HOME%/sessions/2026/07/13/rollout-2026-07-13T10-24-08-019f5913-0c8e-7103-8a70-12d6a3675a6d.jsonl.
Confirmed source mechanism
- The current canonical
ulw-planfull workflow requires a fresh Momus + CLI round and says toresubmit both fresh until each approves; it defines no round, elapsed-time, or no-progress cap. - This is packaged LazyCodex policy, not an upstream Codex rule. Upstream Codex continues while a goal remains Active, but it does not define Momus, independent CLI review, or retry policy.
- LazyCodex already has bounded precedents: the ULW final re-review is capped at two, and review-work warns against repeated wait/follow-up cycles. The uncapped
ulw-planrule is therefore an inconsistent policy gap.
Root-cause refinement
The prompt-routing collision in the issue body remains valid, but this run shows an additional deterministic liveness defect: once high-accuracy planning is active, ulw-plan itself requires fresh full dual-review rounds until unanimous approval. Each reviewer can discover another orchestration invariant, so progress can remain technically active while product implementation never starts. An unlimited goal amplifies this because there is no budget or timeout boundary that returns control to the user.
Proposed fix
- Run one full dual-plan review, then allow at most two cited-delta re-review rounds.
- After the cap, persist remaining blockers and return control to the user instead of silently starting another full round.
- Treat an explicit user instruction such as
finish,start work,stop reviewing, orpushas an exit from plan-review retry mode; carry unresolved findings into execution/review TODOs. - Add a contract test that rejects unbounded wording such as
until each approvesunless a numeric retry/no-progress cap is present. - Apply the same affected-lane retry cap to the start-work global review gate.
Verification
- A permanently dissenting reviewer terminates after the documented cap and produces a resumable blocker report.
- A user
stop reviewing and startinstruction prevents another review round. - A normal plan that converges in one or two repair rounds still receives both required approvals.
- Goal continuation does not restart completed plan-review rounds.
This issue or PR was generated by LazyCodex. Tag: lazycodex-generated
Fixed on dev by code-yeongyu/oh-my-openagent#6279 (merge commit).
The Codex ultrawork UserPromptSubmit trigger pattern is now /(?:ultrawork|ulw(?!-(?:plan|research)))/i, so invoking $omo:ulw-plan (or ulw-research) no longer injects the full <ultrawork-mode> directive on top of the planning contract. Bare ultrawork, standalone ulw, and ulw-loop still trigger as before. Locked with given/when/then tests covering both the carve-out and the preserved triggers. Thanks for the deterministic root-cause and repro, @ameforce. Ships in the next stable lazycodex release; closing as fixed on dev.