commit 58e07df5690dc4344a50071e597bd30cee2b0efd Author: Reavo End Date: Sun Jul 19 18:27:32 2026 -0700 fix: restore reliable inbound presentation Use OMP prompt flow for deferred delivery, format inbound envelopes, and style endpoint status through the active theme.\n\nCo-authored by: emphasys diff --git a/CHANGELOG.md b/CHANGELOG.md index bc7e9c1..39f4cdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable user-facing changes to **omp-spt** (the Spacetime adapter for oh-my- > Each release below is keyed to the **adapter version of truth** (the version `spt adapter list` reports and the GitHub release tag). omp-spt starts its own version line at 0.1.0; the sections from [0.17.3] down are the inherited **claude-spt** lineage this project forked from, retained for history. +## [0.3.10] - 2026-07-19 + +> Requires spt-core **v0.31.0 or newer** and Oh My Pi **v16.3.15 or newer**. Update with `spt adapter update omp-spt`, then restart existing endpoints so they load the corrected extension. + +### Fixed +- **ACP-hosted endpoints wake for deferred peer deliveries again.** Deferred custody now enters OMP through the native user-prompt flow. OMP 17 defers extension-initiated hidden turns under an ACP client, so v0.3.9's `nextTurn` trigger could queue a message without starting the receiving agent. +- **Inbound context is easier to identify and read.** The obsolete internal `omp-spt-peer-message` custom-message identifier is gone, and complete `` envelopes place their body on lines between the opening and closing tags. +- **The inline endpoint identity is cyan again.** Status styling now uses OMP's theme API instead of raw ANSI escapes that the status renderer discarded. + ## [0.3.9] - 2026-07-19 ### Fixed diff --git a/adapter/strings/omp-spt.mjs b/adapter/strings/omp-spt.mjs index 7320055..6bd80ef 100644 --- a/adapter/strings/omp-spt.mjs +++ b/adapter/strings/omp-spt.mjs @@ -4,8 +4,6 @@ const ADAPTER = "omp-spt"; const BUSY_TITLE_GLYPHS = [..."⣾⣽⣻⢿⡿⣟⣯⣷"]; const IDLE_TITLE_GLYPH = "○"; const TITLE_FRAME_MS = 80; -const CYAN = "\u001b[36m"; -const DEFAULT_FOREGROUND = "\u001b[39m"; // [impl->REQ-OMP-SESSION-TITLES] export function endpointDisplayName(id, node, project) { @@ -18,8 +16,9 @@ export function endpointDisplayName(id, node, project) { : `${endpoint} @ ${nodeName}`; } -export function endpointInlineStatus(id, node, project) { - return `${CYAN}${endpointDisplayName(id, node, project)}${DEFAULT_FOREGROUND}`; +export function endpointInlineStatus(id, node, project, theme) { + const text = endpointDisplayName(id, node, project); + return theme?.fg ? theme.fg("accent", text) : text; } export function decodeBody(body) { @@ -211,16 +210,24 @@ function senderStub(sender) { return ``; } +export function formatInboundEnvelope(envelope) { + const openingEnd = envelope.indexOf(">"); + const closingStart = envelope.lastIndexOf(""); + if (openingEnd < 0 || closingStart <= openingEnd) return envelope; + return `${envelope.slice(0, openingEnd + 1)}\n${envelope.slice(openingEnd + 1, closingStart)}\n${envelope.slice(closingStart)}`; +} + function injectEnvelope(messages, item) { const index = messages.findLastIndex( (message) => message?.role === "user" && messageText(message) === item.stub, ); if (index < 0) return messages; const original = messages[index]; + const envelope = formatInboundEnvelope(item.envelope); const content = typeof original.content === "string" - ? `${original.content}\n\n${item.envelope}` - : [...(original.content ?? []), { type: "text", text: `\n\n${item.envelope}` }]; + ? `${original.content}\n\n${envelope}` + : [...(original.content ?? []), { type: "text", text: `\n\n${envelope}` }]; const injected = [...messages]; injected[index] = { ...original, content }; return injected; @@ -1179,7 +1186,10 @@ export function createOmpSpt(overrides = {}) { } activated = true; startupBriefPending = true; - ui.setStatus("omp-spt", endpointInlineStatus(id, env.OMP_SPT_NODE, env.OMP_SPT_PROJECT)); + ui.setStatus( + "omp-spt", + endpointInlineStatus(id, env.OMP_SPT_NODE, env.OMP_SPT_PROJECT, ui.theme), + ); // [impl->REQ-OMP-SESSION-TITLES] pi.setSessionName(displayName()); showIdleTitle(); @@ -1643,21 +1653,13 @@ export function createOmpSpt(overrides = {}) { queue.unshift(item); return; } + item.stub = senderStub(item.from ?? "unknown"); item.submitted = true; - item.hiddenSubmitted = true; + item.hiddenSubmitted = false; try { - pi.sendMessage( - { - customType: "omp-spt-peer-message", - content: item.envelope, - display: true, - attribution: "user", - }, - { deliverAs: "nextTurn", triggerTurn: true }, - ); + pi.sendUserMessage(item.stub); } catch (error) { item.submitted = false; - item.hiddenSubmitted = false; await rejectItem(item, "could not submit your message to OMP", error); } } finally { @@ -1783,7 +1785,10 @@ export function createOmpSpt(overrides = {}) { const status = signal ? `signal ${signal}` : code; died(new Error(`spt api listen exited ${status}`), true); }); - ui?.setStatus("omp-spt", endpointInlineStatus(id, env.OMP_SPT_NODE, env.OMP_SPT_PROJECT)); + ui?.setStatus( + "omp-spt", + endpointInlineStatus(id, env.OMP_SPT_NODE, env.OMP_SPT_PROJECT, ui?.theme), + ); } // [impl->REQ-OMP-NATIVE-TUI] @@ -1847,7 +1852,7 @@ export function createOmpSpt(overrides = {}) { } if (current?.submitted && !current.hiddenSubmitted) { if (current.activeInjected) { - const content = `${current.stub}\n\n${current.envelope}`; + const content = `${current.stub}\n\n${formatInboundEnvelope(current.envelope)}`; if ( !messages.some( (message) => message?.role === "user" && messageText(message) === content,