Skip to content

fix(server): take omo from the program a pane runs, not from an argument that names it - #249

Merged
devswha merged 2 commits into
mainfrom
fix/omo-cards-real-omo
Oct 1, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/omo-cards-real-omo

Conversation

@devswha

@devswha devswha commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Change

isOmoProcess took a foreground process for omo when any word of its argv was an omo path, so grep -q …/omo-ai/x, cat …/bin/omo or node watch.js …/omo-ai/plugin counted as omo. The sidebar then named the pane omo, the transcript lookup counted it as a second omo in the cwd, and startShellAgent could report a start.

Now only the program counts: argv[0], or, when argv[0] is node/nodejs/bun, the script it runs (the first word after it that is not a flag). The word must still be one path (no :), as #243 required.

Shapes kept, the first two exactly as herdr 0.9.0's pane.process_info reported them for omo 5.1.7 in a test pane:

  • /home/u/.bun/bin/bun …/omo-ai/node_modules/@code-yeongyu/senpi/dist/bundle/cli.js --extension …/omo-ai/plugin
  • /home/u/.bun/bin/bun …/omo-ai/plugin/runtime/ast-grep-mcp/cli.js mcp (omo's MCP child, same process group)
  • node …/bin/omo, node --flag …/omo-ai/bin/omo.js, a native omo, and the SDK child …/omo-ai/…/claude

The change is confined to isOmoProcess and one regex above it in server/omo.ts; Windows paths (#234) are untouched.

Closes #248

Also checked: the omo question cards against real omo 5.1.7 (no defect found, no code change)

In the isolated herdr-web-ui-test session (herdr 0.9.0), a server from this branch, and a real omo asked for a two-question ask_user_question form:

  • The card appeared with the form's title, options and step chips (Question 1 of 2, Red/Green/Blue, chips Color/Fruits), identical at 120, 60 and 40 columns.
  • Single choice, multiple choice, a typed answer, reopening an answer from the review, and Submit each moved omo on; omo reported 2 answered; 0 unanswered with the answers sent. A stale answer got 409 prompt_changed.
  • The footer was 2 lines under exactly one rule at all three widths.
  • Backspace cleared an earlier multiple choice (Apple, Cherry -> Banana) and an earlier typed answer (Purple -> Teal).
  • Options 10 and above cannot occur in omo 5.1.7: its tool refuses with options must contain 2 to 4 items when present.
  • herdr reported the pane as pi before the first turn and claude with status idle (not blocked) while the form showed; the card still came from the session's pending call.

Validation

  • bun run typecheck passes.
  • bun run test:unit: 673 pass, 0 fail (two new tests in server/omo.test.ts, one per direction).
  • bun test ./server/omo.contract.test.ts ./server/omo-prompt.contract.test.ts ./server/prompt.contract.test.ts: 10 pass.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: c1cf128b-f5ac-4971-b966-953f8be1eb88

📥 Commits

Reviewing files that changed from the base of the PR and between 261b88d and c66d204.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • server/omo.test.ts
  • server/omo.ts
 _______________________________________________
< Your code has more branches than a windstorm. >
 -----------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@devswha
devswha merged commit 7ff5174 into main Oct 1, 2026
10 of 11 checks passed
@devswha
devswha deleted the fix/omo-cards-real-omo branch October 1, 2026 09:56
devswha added a commit that referenced this pull request Oct 1, 2026
Release v0.3.40: moves the Unreleased notes under 0.3.40 and bumps
`package.json` and `herdr-plugin.toml`.

What's in it:
- Fixes from #249, #251, #252, #263, #264, #265, #267.
- The iPhone CJK and text-symbol fix (#272).
- Emoji cell widths matching herdr (#273).

Every changelog entry already ends with its PR link. All these PRs are
by @devswha, so no credits to add.

No remote bundle change: `REMOTE_BUNDLE_VERSION` stays 9. The Windows PC
part of #264 and #265 reaches a PC with the next remote bundle, as its
changelog entry says.
devswha added a commit that referenced this pull request Oct 1, 2026
…ts next to omo-ai (#278)

## Change

Since #249, `isOmoProcess` identifies OmO only from the program a pane
runs: `argv[0]`, or the script that `node`/`bun` runs. That covers an
npm install, where OmO's engine sits inside omo-ai (`bun
…/omo-ai/node_modules/@code-yeongyu/senpi/dist/bundle/cli.js --extension
…/omo-ai/plugin`).

A global bun install (`bun add -g omo-ai`) hoists the engine next to
omo-ai instead, and omo's launcher execs it. The pane's foreground
process is then:

```
bun ~/.bun/install/global/node_modules/@code-yeongyu/senpi/dist/bundle/cli.js --extension ~/.bun/install/global/node_modules/omo-ai/plugin
```

Here the script is senpi's own entry, and `omo-ai` appears only as the
extension it loads. As a result, 0.3.40 no longer recognizes the pane as
OmO:

- the chat never looks up the transcript and shows only "Conversation
unavailable — show terminal output";
- the sidebar loses the OmO mark;
- New session does not see OmO start.

With this change, the engine entry (`@code-yeongyu/senpi/dist/cli.js` or
`dist/bundle/cli.js`, run by a JS runtime) counts as OmO when an
`--extension` argument names omo-ai's plugin. These are the entries `omo
doctor` treats as the engine. Everything #249 ruled out stays out:

- senpi alone, or senpi with another extension;
- an omo-ai plugin path passed to any other script;
- the plugin path given without `--extension`;
- the entry run without a JS runtime.

## Validation

- Reproduced on a fresh clone of `main` (ef90055), unchanged, on macOS
with omo-ai 5.1.6 installed by `bun add -g omo-ai` and two OmO panes:
- `isOmoProcess` on each pane's argv as `ps` reports it returned `false`
for both; `true` was expected.
- The v0.3.40 server's `GET /api/pane/conversation?pane_id=<OmO pane>`
returned `{"source":"scrollback","turns":[]}`, and the chat showed only
"Conversation unavailable — show terminal output".
- On this branch, `isOmoProcess` returns `true` for both, and
`paneConversation` for the same panes returns `source: "omo-transcript"`
with their turns.
- A new test covers both argv shapes (bundled and unbundled entry) plus
five near-misses that stay `false`. It fails on `main`. The #249 cases
are unchanged.
- `bun run generate:types --check`, `bun run typecheck`, `bun run
build`: pass.
- `bun run test:unit`: 726 pass, 1 skip, 0 fail (`main`: 725 pass, 1
skip, 0 fail).

---------

Co-authored-by: Hako <devswha@gmail.com>
devswha added a commit that referenced this pull request Oct 1, 2026
Fixes #256.

Raises `REMOTE_BUNDLE_VERSION` from 9 to 10, so that remote PCs (Windows
PCs included) get the bridge-side fixes merged since `remote-v9`: #235,
#243, #249, #251, #264, #265, #267, #278, #281 and the rest of `git log
remote-v9..main -- server shared`.

`server/machines.test.ts` named the `remote-v9` directory literally and
failed on the new number; it now reads the constant.

## Order, from docs/remote-pcs.md
1. Merge this.
2. Push the `remote-v10` tag on `main`: the Remote PC bundles workflow
builds, smoke-tests and publishes the five archives and `manifest.json`.
3. Only then release the app: an app that carries the new number finds
no `remote-v10` manifest before step 2, and every connected PC's bridge
counts as incompatible until it is updated.

## Checked
`bun run typecheck`, `bun run test:unit` (734 pass). The bundle build
and smoke run in this PR's Remote PC bundles checks.
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.

A command that is given an omo path as an argument is taken for omo

1 participant