Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Each Telegram topic maps to one tmux window. With Herdr, it maps instead to one
## What You Can Do

- **Start from one line** — `codex ccgram fix the hook timeout` creates the session, binds the topic, and forwards the instruction; `/bind` adopts an already-running window
- **Auto-detect providers** — Supports Claude Code, Codex, Gemini, Pi, and Shell simultaneously
- **Auto-detect providers** — Supports Claude Code, Codex, Gemini, Pi, omo, and Shell simultaneously
- **Monitor live** — Terminal screenshots on demand or auto-refresh every 5 seconds
- **Topic-aware command panels** — Four safe General controls; session-specific CCGram actions and original agent command names in each topic
- **Send commands** — Slash commands, voice messages (transcribed via Whisper), or raw shell input
Expand Down
38 changes: 38 additions & 0 deletions docs/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,44 @@ The automatic menu above is the primary control; the toolbar remains a fallback:

Override with a `[providers.pi]` block in `~/.ccgram/toolbar.toml`.

## omo

[omo](https://github.com/) is an omo-ai distribution built on
`@code-yeongyu/senpi`, a Pi fork. Its sessions, TUI parser and Telegram command
list are shared with Pi, so CCGram serves both through the same code path.

Unlike Pi, omo ships no `cc-thingz` hook runner: CCGram marks the provider as
hook-less (`ccgram doctor` reports "hook check skipped") and relies on transcript
scanning only. State lives under `~/.omo/agent`; the agent directory is resolved
from `OMO_CODING_AGENT_DIR`, then `SENPI_CODING_AGENT_DIR`, then
`PI_CODING_AGENT_DIR`, matching omo's own resolution order.

### Launch

The default command is `omo`; override it with `CCGRAM_OMO_COMMAND`. YOLO mode
appends `--permission-preset full-access`, which omo needs to run unattended -
without it the agent waits on approval prompts Telegram cannot answer.

### Detection

The omo launcher is a JS entry point, so tmux reports `bun` as the pane command.
CCGram therefore asks for the pane title on `bun`/`node` panes and matches omo's
window title (`OmO - <project>`); a process literally named `omo`, and the
`@code-yeongyu/senpi` path markers used by the agterm backend, are recognised as
well.

### Transcript

`~/.omo/agent/sessions/--<encoded-cwd>--/<timestamp>_<uuid>.jsonl`, with the same
JSONL v3 header as Pi. Resume uses `--session <path-or-uuid>`, and `--continue`
serves the Continue button.

### Model selection

`/model` in omo prints the model list into the transcript instead of opening a
modal selector, so it is not advertised as a TUI picker; pin the model in the
launch command when a specific one is required.

## Shell

The shell provider opens a plain shell session in tmux. It has no hooks, no transcript, and no resume/continue support — shell sessions are ephemeral.
Expand Down
1 change: 1 addition & 0 deletions src/ccgram/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"antigravity",
"claude",
"codex",
"omo",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

"pi",
"shell",
)
Expand Down
2 changes: 1 addition & 1 deletion src/ccgram/handlers/agent_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
_BUTTONS_PER_ROW = 3

# Stable order also defines the provider-button layout; labels stay in one place.
_PROVIDER_ORDER = ("antigravity", "claude", "codex", "gemini", "pi", "shell")
_PROVIDER_ORDER = ("antigravity", "claude", "codex", "gemini", "omo", "pi", "shell")
_VALID_NAMES = frozenset(_PROVIDER_ORDER) | {"auto"}


Expand Down
10 changes: 7 additions & 3 deletions src/ccgram/handlers/commands/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
get_provider_for_window,
)
from ... import window_query
from ...providers.pi import PI_LIKE_PROVIDERS
from ...telegram_client import PTBTelegramClient
from ...window_state_store import window_store
from ...thread_router import thread_router
Expand Down Expand Up @@ -99,7 +100,10 @@ def _default_command_args(cc_name: str, args: str, display: str) -> str:

def _provider_command_name(provider_name: str, cc_name: str) -> str:
"""Apply provider-specific compatibility aliases before forwarding."""
if provider_name == "pi" and cc_name.lower() == _PI_CLEAR_ALIAS_COMMAND:
if (
provider_name in PI_LIKE_PROVIDERS
and cc_name.lower() == _PI_CLEAR_ALIAS_COMMAND
):
return _PI_NEW_COMMAND
return cc_name

Expand All @@ -111,7 +115,7 @@ def _is_session_reset_command(provider_name: str, cc_slash: str) -> bool:
if len(parts) > 1:
return False
return command == _PI_CLEAR_ALIAS_COMMAND or (
provider_name == "pi" and command == _PI_NEW_COMMAND
provider_name in PI_LIKE_PROVIDERS and command == _PI_NEW_COMMAND
)


Expand Down Expand Up @@ -327,7 +331,7 @@ async def forward_command_handler(
cc_slash = f"/{cc_name} {args}".rstrip() if args else f"/{cc_name}"
status_like = cc_name.lower() in {"status", "stats"}

if provider_name == "pi" and cc_name.lower() == _PI_FOLLOWUP_COMMAND:
if provider_name in PI_LIKE_PROVIDERS and cc_name.lower() == _PI_FOLLOWUP_COMMAND:
await _handle_pi_followup_command(
update.message,
user.id,
Expand Down
17 changes: 14 additions & 3 deletions src/ccgram/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"claude": "--dangerously-skip-permissions",
"codex": "--dangerously-bypass-approvals-and-sandbox",
"gemini": "--yolo",
# ccgram launches in yolo mode by default; without this flag omo would
# stop on approval prompts nobody can answer from Telegram.
"omo": "--permission-preset full-access",
}


Expand Down Expand Up @@ -125,6 +128,9 @@ def _ensure_registered() -> None:
# Lazy: provider classes register against the registry at import; defer until the registry factory runs
from ccgram.providers.gemini import GeminiProvider

# Lazy: provider classes register against the registry at import; defer until the registry factory runs
from ccgram.providers.omo import OmoProvider

# Lazy: provider classes register against the registry at import; defer until the registry factory runs
from ccgram.providers.pi import PiProvider

Expand All @@ -135,6 +141,7 @@ def _ensure_registered() -> None:
registry.register("claude", ClaudeProvider)
registry.register("codex", CodexProvider)
registry.register("gemini", GeminiProvider)
registry.register("omo", OmoProvider)
registry.register("pi", PiProvider)
registry.register("shell", ShellProvider)
_registered = True
Expand Down Expand Up @@ -249,7 +256,7 @@ def detect_provider_from_command(pane_current_command: str) -> str:
# Match basename only (first token) to avoid false positives
# from paths like /home/claude/bin/vim
basename = os.path.basename(cmd.split()[0])
for name in ("antigravity", "claude", "codex", "gemini", "pi"):
for name in ("antigravity", "claude", "codex", "gemini", "omo", "pi"):
if (
basename == name
or (name == "antigravity" and basename == "agy")
Expand Down Expand Up @@ -300,8 +307,12 @@ def detect_provider_from_transcript_path(transcript_path: str) -> str:
return "claude"
if "/.gemini/" in normalized and "/chats/" in normalized:
return "gemini"
if "/.pi/agent/sessions/" in normalized:
return "pi"
for marker, provider in (
("/.omo/agent/sessions/", "omo"),
("/.pi/agent/sessions/", "pi"),
):
if marker in normalized:
return provider
Comment on lines +310 to +315

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

return ""


Expand Down
Loading