GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Proposal: native plan mode over OMP RPC/RPC-UI · Issue #9230 · can1357/oh-my-pi Not planned DescriptionProposal: native plan mode over OMP RPC/RPC-UISummaryOMP v17.4.0 exposes native interactive plan mode through This proposal defines an additive, capability-gated OMP RPC/RPC-UI contract that lets a client project OMP's existing native plan lifecycle without creating a second state machine. OMP remains authoritative for lifecycle legality, persistence, writer guards, model/tool restoration, proposal decisions, and implementation handoff. This is a design proposal for maintainer discussion, not an implementation assignment or an implementation reservation. Because this is a major architectural/behavioral change, the contribution must be discussed in the OMP Discord before implementation begins. That discussion is a required contribution gate, not maintainer approval; a GitHub issue is not a substitute, and prior discussion does not guarantee that a later pull request will be merged. Problem and goalsThe RPC/RPC-UI surface currently lacks:
The v1 goal is an additive OMP contract with these properties:
Proposed v1 contractCapability and bootstrapAdvertise support only after the OMP runtime implements the contract: capabilities?: { plan_mode?: { version: 1 }; } Unknown versions are unavailable. A client exposes native plan controls only when A capable { capabilities?: { plan_mode?: { version: 1 } }; planMode?: PlanModeSnapshot; planModeRevision?: number; } OMP persists the revision with canonical plan state and increments it for every observable authoritative transition. The client installs the Do not add process-generation fields or same-process reconnect machinery in v1. EOF rejects pending bridges, drains/disposes the session, and exits the OMP process. If a decision was durably committed before disconnect but its response was lost, retrying the same decision ID and payload returns the stored result. Without a durable commit, retry proceeds normally. Snapshot and persistencetype PlanModeSnapshot = { status: "inactive" | "active" | "paused" | "handoff"; proposal?: { proposalId: string; title: string; planText: string; }; handoff?: { handoffId: string; proposalId: string; status: "claimed" | "started" | "interrupted"; }; }; Invariants:
Commands and resultsAll plan commands call the shared/native OMP plan controller. Valid plan commands return a typed result, including no-op, stale, busy, and invalid outcomes: type PlanModeResult = { requestId: string; outcome: | "accepted" | "in_progress" | "completed" | "stale" | "invalid" | "unsupported" | "busy" | "confirmation_required"; planMode: PlanModeSnapshot; planModeRevision: number; }; Malformed transport/schema requests use the normal RPC error mechanism.
|
| Current state | Intent | Required result |
|---|---|---|
inactive |
activate |
Enter native active state and apply native writer guards. |
active, no actionable proposal |
exit |
Apply native draft-content confirmation rules; confirmed exit becomes paused. |
active with proposal |
exit |
Return busy; decide or dismiss first; no state change. |
paused |
resume |
Enter active. |
paused |
disable |
Enter inactive and clear fresh-session plan-entry intent. |
active |
disable |
Return busy/invalid; use native exit to reach paused, then explicit disable. |
inactive |
resume or disable |
Follow controller idempotence/invalid semantics; never implicitly activate. |
Any handoff state |
Any intent | Return busy with the authoritative snapshot; no state change. |
| Already at target state | Corresponding intent | Return idempotent completed with the snapshot. |
Confirmed active exit preserves native active -> paused behavior and durable plan_paused state. Full disable is a separate explicit paused -> inactive transition. Draft/no-draft confirmation, resume, disable persistence, busy behavior, and idempotence require coverage.
respond_to_plan_proposal{ proposalId: string; decisionId: string; action: "approve" | "refine" | "dismiss"; }
The durable decision key is exactly (sessionId, proposalId, decisionId). Store a canonical payloadHash for the normalized decision payload (proposalId, decisionId, action, and any future versioned decision fields; not the transport requestId).
invalid with no side effect; retain the original record.stale with no side effect.V1 approval has exactly one meaning: invoke the existing native Approve and execute branch, equivalent to #approvePlan with preserveContext: false, compactBeforeExecute: false, and no executionModel override. OMP exits plan mode, restores the native execution tool set, and queues the native approved-plan turn.
refine atomically clears the actionable proposal, returns to native active planning, and waits for the user's next ordinary feedback prompt; it does not inject an automatic model turn or implementation prompt. dismiss atomically clears the proposal and remains in native active planning without implementation.
continue_plan_handoff{ handoffId: string; proposalId: string; decisionId: string; }
This explicit user action is valid only for a matching handoff.interrupted record. It uses persisted approved plan context and invokes the same v1 Approve and execute continuation branch once. It is durable and idempotent: use a new decision record keyed by (sessionId, proposalId, decisionId) with a stored payload hash; identical retries return the saved result and hash conflicts return invalid. It never replays automatically after a later process restart.
Approval enters handoff before continuation:
handoff.claimed, approved plan context, proposal/decision identity, a non-terminal decision reservation, and the next revision.handoff.started before reporting continuation started.inactive (plan mode has exited for implementation).active, and permit the same decision retry to create a fresh reservation.claimed or started, retain the decision record, persist/emit handoff.interrupted, and never replay automatically. Keep approved plan context only for explicit continue_plan_handoff.A later process restores handoff.interrupted before ready; it does not claim that a live connection survived. At-most-once applies to automatic continuation. Exactly-once external model/tool effects are not promised.
new_session, switch_session, branch, and generic handoff must be serialized with proposal decisions and continue_plan_handoff:
| State | Required behavior |
|---|---|
active with actionable proposal |
Reject busy; preserve proposal; do not consume, silently invalidate, or change session. |
handoff.claimed or handoff.started |
Reject busy; do not orphan, interrupt, or duplicate continuation. |
handoff.interrupted |
Reject busy; require explicit continue_plan_handoff first. |
active without proposal, paused, or inactive |
Preserve existing native command semantics, with durable state/event ordering. |
A racing loser returns busy or stale with the current authoritative snapshot and never reports success for an obsolete proposal/handoff. Every accepted session transition persists its new canonical state and emits its authoritative event before returning its RPC result.
Emit a complete snapshot for every observable lifecycle transition:
{ type: "plan_mode_updated"; planMode: PlanModeSnapshot; planModeRevision: number; }
Persistence commit precedes event emission; event emission precedes the corresponding command response. Replacement, decision completion, handoff claim/start/interruption, pause, resume, disable, and accepted session transitions must be observable with correct snapshots. Repeated identical decision results need not emit a new transition event.
| OMP runtime | Client | Required behavior |
|---|---|---|
| No capability/old runtime | New client | Hide native plan controls; preserve normal OMP behavior. |
| V1 capability | Old client | Ignore optional capability/state/event fields; preserve normal behavior. |
| V1 capability | V1 client | Use the full contract. |
| OMP process restarts | V1 client | Reattach only by launching/connecting to the new process, install its ready snapshot, discard transient permissions, and rebuild UI from durable canonical state. |
| Capability disappears | V1 client | Clear the live card/control from the authoritative snapshot; never auto-enter plan mode. |
Paseo remains on rpc-ui. It maps OMP's single current proposal to one shared permission_requested event with kind: "plan", sends fresh decision IDs, and projects OMP snapshots/events. It does not resolve OMP storage paths, construct implementation prompts, implement legality checks, or expose native plan as a fourth approval mode. planModel/--plan <model> remains independent. Feature configuration is fresh-session entry intent only; loaded/resumed OMP state wins.
Reuse the native enforcePlanModeWrite boundary. Preserve native behavior for write/edit/patch/replace/hashline/archive/sqlite and target resolution, including rejection of worktree/out-of-sandbox mutations, deletion, and rename, while allowing validated session-local artifact writes (local://, hashline, and realpath cases) that native OMP permits. Existing xd://propose dispatch remains available.
Adding plan state must not claim or create universal enforcement. Bash, arbitrary xd:// devices, MCP, extensions, custom tools, subprocesses, and their existing approval/prompt policies remain authoritative; RPC/RPC-UI must not broaden or narrow those policies as a side effect.
A maintainer-ready implementation should include:
get_plan_state resynchronizes.set_plan_mode table, including draft confirmation, active -> paused, separate paused -> inactive, resume, busy, and idempotence.new_session, switch_session, branch, and generic handoff against approve, refine, dismiss, and Continue in every proposal/handoff state.plan_mode.version = 1.xd:// devices, MCP, extensions, custom tools, or subprocesses.--plan-yolo as remote interactive planning.--plan <model> or planModel as plan-mode activation.Approve and compact context, keep-context execution, model-tier/execution-model selection, or any other native approval branch not explicitly named for v1.plan_mode.version = 1 and local RPC-UI integration has been exercised.rpc-ui; do not require an upstream PR, release, push, or publication.Record local experiment results afterward. Decide afterward, with the required discussion and maintainer feedback, whether any upstream PR, release, or other contribution is appropriate; those decisions are post-experiment and do not gate local implementation or QA.
The GitHub issue records a design for local experiment and maintainer discussion. It does not reserve implementation work or require maintainers/robomp to implement it.
Marking as duplicate. The underlying capability gap — exposing OMP's native plan mode over the RPC/RPC-UI transport — is already tracked by the open enhancement #5380 ("Add set_mode RPC command to toggle plan mode in headless/RPC mode"), and #8171 was previously ruled a duplicate of the same ask. The RPC surface genuinely lacks plan-mode wiring today (packages/coding-agent/src/modes/rpc/rpc-types.ts has set_fast_mode/set_steering_mode/etc. but no set_plan_mode, and RpcSessionState has no plan field), so the gap is real — but it's the one #5380 already covers.
There is also active implementation work on this surface worth folding your design notes into rather than opening a parallel track:
Since this is explicitly a design proposal for maintainer discussion (and, per the body, for your own local experiment) rather than a bug or an implementation request, the detailed v1 contract here — capability gating, revisioned snapshots, decision dedup keyed on (sessionId, proposalId, decisionId), and handoff/crash-recovery ordering — is best raised on #5380 and in the Discord thread you mention, so the discussion stays consolidated with the existing tracker and the in-flight PRs. Leaving the final call to the maintainer.
This issue has had no activity for 45 days and is now marked stale. It will be closed in 14 days unless there is a new comment or update. If it still reproduces on the latest release, comment with what you're seeing and it stays open.
Closed: marked stale with no activity since. If this is still relevant, comment and a maintainer can reopen it.