Skip to content

fix(omo): keep silent subagents alive#106

Closed
YLongger wants to merge 1 commit into
code-yeongyu:mainfrom
YLongger:lazycodex/fix-subagent-liveness
Closed

fix(omo): keep silent subagents alive#106
YLongger wants to merge 1 commit into
code-yeongyu:mainfrom
YLongger:lazycodex/fix-subagent-liveness

Conversation

@YLongger

@YLongger YLongger commented Jul 3, 2026

Copy link
Copy Markdown

Summary

Fixes a Codex/OMO subagent liveness policy contradiction that could cause long-running child agents to be treated as stale when wait_agent simply returned no new mailbox update.

Problem

The ultrawork / ulw-loop Codex directives already describe multi_agent_v1.wait_agent timeouts as mailbox-only signals: a timeout means no new child message arrived, not that the child stopped working.

Later in the same directive, the subagent transition barrier contradicted that by instructing the parent to:

  • send TASK STILL ACTIVE after two silent waits
  • close the lane as inconclusive after four silent or ack-only checks
  • respawn a smaller child if the deliverable was still required

That matches the observed failure mode: a child agent can be doing a long read/test/review pass, but the parent sees silent waits and interrupts or replaces it even though it is still running.

Fix

  • Treat silent waits as non-state transitions.
  • Do not let a silent wait_agent result trigger TASK STILL ACTIVE, close_agent, or respawn.
  • Only send follow-up / close / respawn when there is an actual non-delivering state:
    • child completed without the deliverable
    • child answered ack-only after a targeted follow-up
    • child explicitly reported BLOCKED:
    • child is no longer running
  • Keep ulw-loop's bundled ultrawork directive synchronized with ultrawork.
  • Add a regression test so the generated Codex hook output cannot reintroduce the old silent-wait counters.

Verification

Passing targeted checks:

npm --prefix plugins/omo/components/ultrawork test -- test/codex-hook.test.ts
# 1 file passed, 14 tests passed

npm --prefix plugins/omo/components/ulw-loop test -- test/ultrawork-directive.test.ts
# 1 file passed, 4 tests passed

git diff --cached --check
# passed

Broader test notes from this Windows temp clone:

npm --prefix plugins/omo/components/ultrawork test
# 3 files / 25 tests passed
# fails only test/directive-source.test.ts because @oh-my-opencode/prompts-core is not present in this generated LazyCodex checkout

npm --prefix plugins/omo/components/ulw-loop test
# 28 files / 317 tests passed, 5 skipped
# remaining failures are existing Windows environment/path assumptions:
# - spawn npm ENOENT
# - spawn /bin/sh ENOENT
# - POSIX path expectations in test/paths.test.ts

Summary by cubic

Prevents long-running subagents from being closed or respawned due to silent wait_agent timeouts. Updates ultrawork and ulw-loop directives and adds a regression test to keep silent subagents alive.

  • Bug Fixes
    • Treat silent multi_agent_v1.wait_agent timeouts as non-transitions; do not trigger TASK STILL ACTIVE, close_agent, or respawn on silence.
    • Only follow up, close, or respawn when the child finishes without the deliverable, replies ack-only after a targeted follow-up, reports BLOCKED:, or stops running.
    • Kept ulw-loop in sync with ultrawork.
    • Added a regression test to prevent reintroducing silent-wait counters.

Written for commit 91f72d3. Summary will update on new commits.

Review in cubic

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR! Changes to LazyCodex land through oh-my-openagent — could you open this against omo-codex over there instead? PRs in this repository can't be merged.

If you're working with a coding agent, prompt it like this:

I opened #106 ("fix(omo): keep silent subagents alive") against code-yeongyu/lazycodex, but changes there land through code-yeongyu/oh-my-openagent, where the Codex implementation lives under packages/omo-codex. Read my original PR, then open an equivalent PR against code-yeongyu/oh-my-openagent. In the new PR body, link the original PR (#106), explain that it was first opened against lazycodex, and describe in detail what that PR changed and why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant