feat(paseo-omp): opt-in correlated-user terminal ownership for unkeyed OMP runtimes - #82
Trevor-Mengel wants to merge 2 commits into
Conversation
…d OMP runtimes Operators pinned to a published OMP release that never keys `agent_end` with its originating request lose every ordinary prompt after the first on a runtime: the turn fails with "OMP terminal ownership could not be confirmed" and the runtime process group is killed. `PASEO_OMP_LEGACY_TERMINAL_OWNERSHIP=correlated-user` in the provider environment adds one extra evidence source, and only for a turn that already requires terminal ownership: the active prompt's own user entry correlated to a branch entry ID that is new relative to a valid branch watermark. Any other value, or unset, keeps the keyed-only default. The switch is never forwarded into the OMP child environment. The safety boundary is preserved. Evidence is refused when the watermark is invalid, when the user entry cannot be correlated, and, through the new per-turn `terminalOwnershipRejected` flag, once a terminal frame has already been refused for missing ownership. A terminal event that arrives before the prompt's user entry therefore still cannot be authorized retroactively, and the ownership deadline, runtime invalidation, keyed path, and branch bounds are untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thank you @Trevor-Mengel for isolating this compatibility gap and supplying the real-process evidence. I pushed a maintainer follow-up that keeps your default-off design while fixing the buffered-event path, fencing asynchronous correlation by observed event order, requiring exact prompt text before direct IDs grant ownership, and preventing the provider-only switch from reaching the child. I also added focused race regressions and a real three-turn OMP test. The strict default remains unchanged. |
|
Thank you again for isolating the published-OMP compatibility gap and validating the multi-turn failure. Main now contains #89, which supersedes this PR with an always-available ordered fallback: keyed terminals remain authoritative, while unkeyed terminals require fresh user correlation, later current-turn assistant activity, confirmed idle state, and no permission, tool, steer, or child-session conflict. It also ignores active ambiguous candidates and fails only the Paseo turn for confirmed-idle ambiguity instead of invalidating the runtime. Rebasing #82 would reintroduce an obsolete parallel state machine and operator switch, so I am closing it as superseded rather than resolving mechanical conflicts. The diagnosis and real-process evidence here directly informed the replacement. |
What
An opt-in, off-by-default escape hatch for OMP runtimes that do not key
agent_endwith the originating request:Follow-up to #81. #81 remains the secure default; this PR covers the compatibility gap until a keyed OMP release is published.
Why
Published OMP releases through 18.2.5 emit unkeyed terminal events for ordinary prompts. On those runtimes, the strict ownership guard cannot authenticate a later-turn
agent_end, so ordinary multi-prompt sessions fail closed after the ownership deadline and the runtime is invalidated. The upstream request-keying fix remains open as can1357/oh-my-pi#12331.The mode gives operators an explicit availability-for-integrity trade while keeping the default unchanged.
How
When enabled, and only for a turn that already requires terminal ownership, the plugin accepts one additional evidence source: an exact-text user echo for the active prompt correlated to a branch entry ID that is new relative to a valid branch watermark.
The ordering is fenced at event observation time:
agent_endmay finish afterward and authorize that terminal;agent_endcannot authorize it retroactively;agentInvoked;entryIdwith different prompt text cannot grant ownership.Invalid watermarks, unavailable or ambiguous history, and uncorrelated users still fail closed. Keyed
requestIdhandling, ownership deadlines, runtime invalidation, and branch-history bounds remain unchanged.The switch is read once per session from the provider environment. Only the exact value
correlated-userenables it. Automatic inheritance excludes it, and childenvorinheritEnvconfiguration attempting to forward it is rejected.The residual risk is explicit: after a matching user echo for the active prompt is observed, a later unkeyed terminal is attributed to that turn without cryptographic or protocol-level proof. Remove the escape hatch once OMP publishes keyed
agent_endevents.Verification
npm test -- tests/provider.test.ts tests/omp-rpc.test.ts: 370 passed.npm run typecheck: passed.npm run check: passed.npm run test:coverage: 693 passed, 6 skipped; thresholds passed.PASEO_OMP_REAL_E2E=1 PASEO_OMP_VERSION=18.2.0 npm test -- tests/provider.real.e2e.test.ts: 4 passed, including three sequential turns on one runtime with legacy mode enabled.Thank you @Trevor-Mengel for isolating the published-runtime compatibility gap and providing the real-process evidence. The follow-up hardens the proposed fallback's ordering and prompt-correlation boundaries while preserving the design and default-off safety decision.
Release Please owns
CHANGELOG.mdand package versions, so neither is changed.