Repository navigation
Conversation
omo is an omo-ai distribution built on the @code-yeongyu/senpi fork of pi: sessions use the same JSONL v3 format and the TUI parser is compatible, so the provider subclasses PiProvider and only overrides identity, state location and detection hints. Highlights: agent dir resolution OMO_CODING_AGENT_DIR > SENPI_CODING_AGENT_DIR > PI_CODING_AGENT_DIR; no hook runner so doctor skips hook checks; yolo mode maps to --permission-preset full-access; pane-title detection for bun/node panes because the launcher is a JS entry point; pi-family transcript parsing, follow-up, replay and /agent surfaces.
|
✓ change → ● check
|
[Medium impact] The changes extend provider selection and session workflows to omo. Do not merge yet: the new backend call breaks the type check, and the typed-launch and shared-directory findings remain unresolved. Findings
|
| "antigravity", | ||
| "claude", | ||
| "codex", | ||
| "omo", |
There was a problem hiding this comment.
Typed omo requests launch incorrectly
Adding omo to the enabled providers does not add it to AGENT_ALIASES. In an unbound topic, omo /repo fix this is treated as an instruction for the default provider, not an omo launch. With a remembered project, CCGram can launch the wrong agent and send it the entire line. Add omo to the typed-plan aliases so this entry point recognizes the new provider.
| for marker, provider in ( | ||
| ("/.omo/agent/sessions/", "omo"), | ||
| ("/.pi/agent/sessions/", "pi"), | ||
| ): | ||
| if marker in normalized: | ||
| return provider |
There was a problem hiding this comment.
Shared paths mislabel omo sessions
If PI_CODING_AGENT_DIR points to ~/.pi/agent and the omo-specific overrides are unset, omo uses Pi's session directory. This function always identifies that path as pi, and SessionMapSync replaces the correct omo claim with pi. The mismatch can hide history while omo runs and make Resume launch pi after it exits. Keep an explicit Pi-family provider claim when both providers can use the same store.
| class OmoProvider(PiProvider): | ||
| """AgentProvider implementation for the omo coding agent CLI.""" | ||
|
|
||
| def _sessions_dir(self) -> Path: | ||
| return provider_sessions_dir( | ||
| (_AGENT_DIR_ENV, *_AGENT_DIR_FALLBACKS), (".omo", "agent") |
There was a problem hiding this comment.
The new provider has no automated tests. Existing Pi tests do not cover omo's directory precedence, interpreter-title detection, capability overrides, or registration. Add focused omo tests, including negative title matches and shared-directory behavior, so these new branches cannot regress unnoticed.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Newest-file discovery misbinds when another omo process writes into the same cwd (probes, cron runs, a second window): the topic then tracks a file that never grows and deliveries stall with a frozen watermark. omo records ownership as session-holders/<session-id>/<pid>.json, so resolve the window through its pane pids instead: map holder pid to session id, walk parents up to 8 hops, and reject stale holders by comparing processStartedAtMs with the live process start (5s tolerance for pid reuse). Fall back to the inherited newest-file scan when no holder matches. Verified: local verify.py ALL CHECKS PASSED incl. 7 new pid-binding checks; providers suite 847 passed; session_protocol+doctor+config 637 passed; ruff format --check and ruff check clean.
| # Lazy: the multiplexer is wired by bootstrap and absent in imports. | ||
| from ccgram.multiplexer import get_multiplexer | ||
|
|
||
| session = get_multiplexer("tmux").get_session() |
There was a problem hiding this comment.
_pane_pids calls get_session() on the result of get_multiplexer(), whose declared return type is Multiplexer. That interface has no get_session() method, so this call fails the required Pyright check and blocks CI. Expose the lookup through a typed interface, or narrow the backend type before calling its extra methods.
| """ | ||
| holders: dict[int, str] = {} | ||
| try: | ||
| entries = sessions_dir.glob("*/session-holders/*/*.json") |
There was a problem hiding this comment.
_holder_pid_map scans holder files for every project before checking which process belongs to this window. Discovery repeats on every poll, even after the session is already bound. With a large session history or several omo windows, these repeated reads delay updates for later windows, which are polled in order. Limit the scan to the relevant project and cache or bound the repeated work.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Adds omo (omo-ai on top of
@code-yeongyu/senpi, a Pi fork) as a first-class provider alongside Pi.omo keeps Pi's JSONL v3 session format and TUI behaviour, so the provider
subclasses
PiProviderand only overrides identity, state location and thedetection hints a JS launcher needs. Pi itself is untouched: its tests and the
_pi_sessions_dirmodule seam still behave exactly as before (tests monkeypatchthat seam, and they pass unchanged).
What changes
providers/omo.py— newOmoProvider: state dir, capability overrides, titledetection.
providers/pi.py— session scanning factored into_scan_sessions, aprovider_sessions_dirhelper for forks, and the module seam preserved;PI_LIKE_PROVIDERSis the single authority for the pi-family rule.providers/__init__.py— registration,omoin the basename table, transcriptpath inference, and the YOLO flag.
providers/process_detection.py—omobasename and@code-yeongyu/senpipath markers (agterm path).
session_protocol/messages.py— pi-family transcript parsing.session_protocol/backend.py— structured history for the family, familyfollow-up, guarded history set.
session_protocol/actions.py,handlers/commands/forward.py,session_map.py— family follow-up validation,
/clear+/followupaliases, replay.config.py,handlers/agent_command.py,toolbar_config.py— default enabledproviders,
/agentkeyboard, explicit toolbar layout mirroring Pi.README.md,docs/providers.md— documented.Behaviour notes
OMO_CODING_AGENT_DIR→SENPI_CODING_AGENT_DIR→PI_CODING_AGENT_DIR→~/.omo/agent, matching omo's own resolution order(
omo-ai/bin/lib/agent-dir.js).pane_current_command=bun. The provider therefore requests the pane title onbun/nodepanes and matches omo's window title (OmO - <project>). A processnamed
omoand the@code-yeongyu/senpiargv markers are recognised too.--permission-preset full-access. CCGram launches in YOLO bydefault; without the flag the agent would stop on approval prompts that cannot
be answered from Telegram.
supports_hook=Falseandccgram doctorreports “hook check skipped”./modelprints the model list into the transcript rather thanopening a modal, so
modelis not advertised intui_picker_commands.Testing
uv run ruff format --check src/ tests/— cleanuv run ruff check src/ tests/— cleanuv run pyright src/ccgram/— 0 errorsuv run deptry src— no issuesuv run pytest tests/ -m "not integration and not e2e"— 8595 passed, 25 skippeddetect_provider_from_paneand
detect_provider_from_runtimeboth returnomo, while a real pi argv stillreturns
pi; discovery resolves omo sessions from~/.omo/agent/sessions.Update: exact window → session binding (2nd commit)
Newest-file discovery misbinds whenever another omo process writes into the
same cwd (probes, cron runs, a second window): the topic then tracks a file
that never grows and deliveries stall with a frozen watermark. omo records
ownership as
session-holders/<session-id>/<pid>.json, so the provider nowresolves the window through its pane process tree instead: holder pid →
session id, parents walked up to 8 hops, stale holders rejected by comparing
processStartedAtMswith the live process start (5 s tolerance for pidreuse). Falls back to the inherited newest-file scan when no holder matches.
Only
src/ccgram/providers/omo.pychanged in this commit (+153/-1); thefirst commit is untouched.
Testing (2nd commit)
verify.py(local behavioural suite) — ALL CHECKS PASSED, incl. 7 newpid-binding checks (holder map, exact resolve, stale-holder rejection,
foreign-pane rejection)
uv run pytest tests/ccgram/providers -m "not integration and not e2e"—847 passed, 23 skipped
uv run pytest tests/ccgram/session_protocol tests/ccgram/test_doctor_cmd.py tests/ccgram/test_config.py—637 passed
uv run ruff format --check src/ccgram/providers/omo.py— cleanuv run ruff check src/ccgram/providers/omo.py— cleaninstall.sh --status→applied,verify.pygreen