Files
oh-my-pi/packages/coding-agent
metaphorics 0d23cb75c2 fix(session): converge plan mode on ask/resolve across continuation paths
Plan-mode convergence (call `ask` or `resolve`) was enforced on only the
non-synthetic `prompt()` return. Every other turn-ending path — `agent.continue()`
drains, the IRC idle wake, and advisor steer delivery — settles via `agent_end`
and bypassed it, so advisor/IRC/follow-on traffic could keep the agent producing
non-converging turns indefinitely (the prompt() recovery wait never returns while
continuations run, and agent-core re-drains late steering/asides before agent_end).

Suppress non-user producers in plan mode: `#routeAdvice` preserves the advisor
card (visible + persisted, no turn) and the idle IRC paths (`deliverIrcMessage`,
`#resumeStrandedIrcAsides`) record into context without waking a turn. User
steers/follow-ups are untouched and still resume planning.

Enforce the decision at the universal `agent_end` terminal settle via a
bounded-retry counter: a plan-mode turn that stops without `ask`/`resolve` gets
the reminder plus a provider-neutral `required` choice (both tools stay
available), up to a fixed cap, then yields to the user. A non-decision tool
answer (e.g. `read`) does not reset the cap, so it cannot loop or silently end
plan mode un-converged; `ask`/`resolve`, a fresh user prompt, or plan-mode exit
reset the counter. Todo-completion reminders are gated off in plan mode so they
cannot re-wake a turn the cap intends to yield. Removes the now-redundant
post-`prompt()` enforcement to keep a single policy.

Op: correct
Restores: spec:plan-mode turns must converge to ask/resolve or yield after bounded reminders
2026-07-01 00:24:11 +09:00
..
2026-06-30 11:58:55 +02:00

@oh-my-pi/pi-coding-agent

Core implementation package for the omp coding agent in the oh-my-pi monorepo.

For installation, setup, provider configuration, model roles, slash commands, and full CLI reference, see:

Package-specific references:

Memory backends

The agent supports three mutually-exclusive memory backends, selected via the memory.backend setting (Settings → Memory tab, or ~/.omp/config.yml):

  • off (default) — no memory subsystem runs.
  • local — existing rollout-summarisation pipeline; writes memory_summary.md and consolidated artifacts under the agent dir.
  • hindsight — talks to a Hindsight server (Cloud or self-hosted Docker), retains transcripts every Nth user turn, recalls memories on the first turn of a session, and exposes retain, recall, and reflect.

Hindsight quickstart

  1. Run a Hindsight server (Cloud or docker run -p 8888:8888 ghcr.io/vectorize-io/hindsight:latest).
  2. Set memory.backend = "hindsight" and hindsight.apiUrl = "http://localhost:8888" (or your Cloud URL).
  3. Optional environment overrides (env wins over settings):
    • HINDSIGHT_API_URL, HINDSIGHT_API_TOKEN — connection
    • HINDSIGHT_BANK_ID, HINDSIGHT_DYNAMIC_BANK_ID, HINDSIGHT_AGENT_NAME — bank addressing
    • HINDSIGHT_AUTO_RECALL, HINDSIGHT_AUTO_RETAIN, HINDSIGHT_RETAIN_MODE — lifecycle
    • HINDSIGHT_RECALL_BUDGET, HINDSIGHT_RECALL_MAX_TOKENS — recall sizing
    • HINDSIGHT_BANK_MISSION, HINDSIGHT_DEBUG

Switching backends mid-session is honoured on the next system-prompt rebuild and the next /memory slash command. Existing users with memories.enabled = true|false are migrated to memory.backend = "local"|"off" exactly once on first launch.