Repository navigation
omp as a third engine: the map's Ask bar works under Oh My Pi - #159
chappie-daemon wants to merge 1 commit into
Conversation
…d Codex
A floorplan built under omp (Oh My Pi) was complete — omp reads the skill's
${CLAUDE_SKILL_DIR} and $ARGUMENTS the way it uses them — but serve.mjs only
knew the Claude Code CLI and Codex, so the map opened saying its Ask bar needed
a CLI that was not installed.
omp is detected from the variables it sets for every command it runs (OMPCODE,
PI_SESSION_ID), recorded on the map like the other two, found on PATH, and asked
through `omp -p --mode=json` with read-only tools, no session written, and no
skills, rules or project context loaded into each question. Follow-ups carry the
last few turns, the way Codex's do. omp has no output-schema flag, so the map
offers Ask and not Change under it.
Tests: a fake omp emitting the real event stream, plus cases for detection, the
recorded agent, the read-only argument shape, follow-ups and an unreachable
model.
|
One note on the full suite for whoever runs CI against this branch: Everything this branch touches passes on its own: |
What this adds
omp(Oh My Pi, https://omp.sh) as a third engine beside the Claude Code CLI and Codex, so a map built in omp can answer questions on itself.A floorplan built under omp was already complete: omp reads the skill's
${CLAUDE_SKILL_DIR}and$ARGUMENTSthe way this skill uses them, and the whole scan → architecture → describe → build pipeline ran unaided (measured on a two-file Express app: full map in 34 s, print mode, no manual step). What did not work was the map's Ask bar:serve.mjsknew onlyclaudeandcodex, so the map opened withWhat changed
scripts/lib/agent.mjs): omp is recognised from the variables it sets for every command it runs —OMPCODE, orPI_SESSION_ID— and gets a label incliLabel. A map built under omp recordsmeta.agent: "omp"and leaves the project notes alone, as Codex's does.assets/serve.mjs):omp -p --mode=jsonwith read-only tools only (read,grep,glob),--no-sessionso nothing lands in the person's history, and--no-skills --no-rules --no-extensions --no-context-filesso each question does not drag a project's CLAUDE.md and every installed skill along with it. The line-delimited JSON stream (message_end,turn_end,agent_end) is read the way the other two are; follow-ups carry the last few turns as Codex's do, because an ephemeral run has no session to resume.cliEnv()now also stripsOMPCODEandPI_SESSION_ID/PI_SESSION_FILE/PI_TOOL_CALL_ID/PI_TERMINAL_OWNER_PID, the way it already stripped the Claude Code and Codex ones.open.mjs:--engine omp,--omp <path>, and a name/site for the "not installed" line.One honest limit: omp has no output-schema flag (
claudehas--json-schema,codexhas--output-schema), so the entry isstructured: falseand the map offers Ask and not Change under it. Change editsplan.jsonfrom the map and needs the answer held to a schema; pretending otherwise would show a button that quietly fails. If omp grows a schema flag, flipping that one field is the whole change.Tests
tests/fixtures/fake-cli/fake-omp.mjsstands in for the CLI the way the Codex and Claude fixtures do: it answers--version, logs what it was given to$FAKE_LOG, and prints the JSON event stream a realomp -p --mode=jsonrun emits — including the preamble-then-answer shape that aturn_end-only reading gets wrong.tests/agents.test.mjs: detection byOMPCODEandPI_SESSION_ID, the label, and a map built with--agent omprecording it and leavingCLAUDE.local.mdalone.tests/ask.test.mjs: with only omp installed the engine isompandchangeisfalse; the arguments are print mode,--no-session,--tools read,grep,glob, no context files and no skills,--cwdat the codebase root; the answer parses to its title and item refs; a follow-up carries the earlier question; an unreachable model reports a failure rather than an empty answer.node --test tests/agents.test.mjs tests/ask.test.mjs→ 19 pass, 1 skipped (the existing Windows-only case), 0 fail.Why I think it belongs here rather than in omp
agent.mjssays "Adding an agent is an entry here", and everything omp-specific is local: oneENGINESentry, one runner, oneDETECTline, one flag pair. The alternative — omp shimming aclaudecommand — would make the map label its answers with a program that is not Claude Code, which is the case #95 was about.