Keep captured bot and phone restrictions through forks, child and mission admission, and each model request. Preserve operational worker mailboxes with saved recall off, filter protected source history and isolate automatic phone extension hooks. Add reviewed portable recipes and keep current engine 1.0.10 with accurate historical beta.5 notes.
4.9 KiB
OMP engine (VST-050)
Run a TensorFold thread on the installed omp coding agent (@oh-my-pi/pi-coding-agent)
via its headless rpc mode. TensorFold stays the GUI: timeline, plan panel (todos),
subagent tree, Guide steering, and session resume all mirror engine state; omp owns the
agent loop — its specialists, prewalk, worktrees, and todo discipline.
Wire facts were taken from the INSTALLED package source (src/modes/rpc/*,
src/session/agent-session-events.ts) plus a live --mode=rpc probe on this machine,
following the pi engine precedent (VST-033, electron/agent/pi-cli.ts).
Architecture
ThreadPanel (Engine: Native loop | OMP agent)
│ threads:setEngine / omp:status IPC
▼
thread-runtime.ts ── engine === 'omp' ? ──▶ runOmpThread (electron/agent/omp-engine.ts)
│ │
│ native loop (default) │ OmpRpcClient (electron/agent/omp-rpc.ts)
▼ ▼
runAgent `omp --mode=rpc` child (LF-JSONL stdio)
- Transport (
omp-rpc.ts): spawnsomp --mode=rpc --cwd <thread.cwd> [--resume <path>], negotiates the protocol (readyframe), sends newline-JSON commands, splits stdout on LF only (U+2028/U+2029 are valid inside JSON strings), reassemblesrpc_chunk-split responses, correlatesresponseframes by id, streamsAgentSessionEvents to listeners, and disposes via stdin EOF with a force-kill fallback plus a silence timeout. - Mapping (
omp-engine.ts, pure + tested): ompmessage_start/update/end→ assistant items + text deltas (thinking is not mirrored);tool_execution_start/end→ tool items with untrusted-output framing;todo_reminder/notice→ notices;agent_end→ done. Todo phases round-trip withPlanStep(statuses, blockers, nesting): multi-phase lists aggregate per phase and nest tasks as subtasks. - Run loop:
set_subagent_subscription, push the existing plan viaset_todos,promptwith the user turn, Guide cues becomesteercommands, abort becomes theabortcommand, then a finalget_statesyncs todo phases + the session cursor (thread.ompResumeCursor, resumed with--resumenext run) andget_subagentsprojects the engine's subagents into TensorFold's subagent store (stable omp ids).
Security posture
The host-tools bridge (slice 2, shipped): whenever the host provides its approval
channel, omp's own mutating tools (bash/edit/write/ast_edit) are disabled via the
spawn toolset (OMP_BRIDGED_TOOLSET = reads, structural search, todos, task/hub
orchestration, web search) and TensorFold's write_file/edit_file/apply_patch/
run_command are registered as omp host tools. The engine's model plans; every
mutation executes through TensorFold's approval gate (executeOmpHostTool mirrors the
native loop's decision order: read-only auto-run → readonly deny → package-install
saved-policy gate → Full Auto risk bands → interactive prompt), the real executeTool
executor, and the audit trail. host_tool_cancel aborts pending calls with the run's
signal. Read-only runs keep omp restricted to read,grep,glob with no host tools.
Propagation (verified in omp source): subagent toolsets derive from the parent
session's enabled tools (executor.ts: session.getEnabledToolNames()), so the spawn
filter reaches every subagent, and host tools registered on the main rpc session do not
leak into subagent sessions. Net posture for a bridged run: omp subagents can research
(read/grep/glob/task orchestration) but cannot mutate — mutations exist ONLY as bridged
host tools on the main agent, which run through TensorFold's gate.
Testing
omp-rpc.test.tsruns the transport against a fixture child that speaks the real protocol (ready, correlated responses, chunk-splitget_state, streamed events).omp-engine.test.tscovers the pure mappings, a fullrunOmpThreadpass against a duck-typed client (prompt, todo push/sync, session cursor, subagent projection), and a bridged round-trip: ahost_tool_callframe flows through the approval gate and back as ahost_tool_result, with livesubagent_lifecycleupdates.omp-host-tools.test.tswalks the gate matrix against the real policy engine: readonly deny, suggest prompt/allow/deny, fail-closed without an approver, Full Auto risk bands, and the package-install saved-policy refusal.- Live checks on this machine:
omp --mode=rpchandshake probe and binary discovery (omp/18.1.19at~/.local/bin/omp).
Follow-on slices
Host-tools bridge— shipped (see Security posture).- Subagent transcripts (
get_subagent_messages) into the subagent viewer; verify spawn-policy propagation of the--toolsfilter to omp subagents. set_model/set_thinking_levelcontrols in the Engine panel.- Room seats on the omp engine;
switch_session/branchin the timeline history menu.