commit 56751db1f67d9f759fa3a5339a3051ac7293ac85 Author: Reavo End Date: Wed Jul 22 10:41:40 2026 -0700 fix: wake on turn-boundary messages Co-authored by: emphasys diff --git a/CHANGELOG.md b/CHANGELOG.md index f22947e..95139f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ 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.17] - 2026-07-22 + +> Requires spt-core **v0.39.1 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 +- **Messages arriving at the end of a turn reliably wake the endpoint.** Listener delivery now delegates idle-versus-streaming arbitration atomically to OMP instead of selecting an explicit non-triggering steer from an `isIdle()` snapshot. A stream that ends between the snapshot and submission can no longer strand peer or operator messages as hidden context in the completed turn. + ## [0.3.16] - 2026-07-21 > Requires spt-core **v0.39.1 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. diff --git a/adapter/strings/omp-spt.mjs b/adapter/strings/omp-spt.mjs index de773d6..96d0cbd 100644 --- a/adapter/strings/omp-spt.mjs +++ b/adapter/strings/omp-spt.mjs @@ -1661,21 +1661,21 @@ export function createOmpSpt(overrides = {}) { function submitListenerItem(item) { if (stopping) return false; item.stub ??= senderStub(item.from ?? "unknown"); - try { - const busy = - typeof runtimeCtx?.isIdle === "function" - ? !runtimeCtx.isIdle() - : agentActive || desiredState === "busy"; - pi.sendUserMessage( - item.stub, - busy ? { deliverAs: "steer", triggerTurn: false } : undefined, - ); - return true; - } catch (error) { + const failSubmission = (error) => { const index = pendingListener.indexOf(item); if (index >= 0) pendingListener.splice(index, 1); releaseItem(item); logError("omp-spt could not submit your message to OMP", error); + }; + try { + // OMP atomically starts a turn when idle or queues a steer while streaming. + // Preselecting explicit steering from an isIdle() snapshot races stream completion + // and can strand the message after the final model continuation. + const submission = pi.sendUserMessage(item.stub); + void submission?.catch(failSubmission); + return true; + } catch (error) { + failSubmission(error); return false; } }