mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-26 18:31:34 +01:00
Five protocol corrections from the CTO review of the Phase 4b work. Canonical runtime request outcome. The real driver emitted `resolution` while the scripted driver and browser read `action`, so a real resolved card reported an unknown outcome. `harnessRuntimeRequestOutcome` is now the one payload every driver emits for a terminal `runtime_request.*` fact, carrying `requestId`, `requestKind`, `turnId`, and `itemId` in the payload as well as the event binding. Decoded request identities. Path segments are split before they are decoded, so a percent-encoded reserved character stays inside the segment the browser meant it for; malformed encoding fails with 400. Resolution shapes validated by request kind. `parseHarnessRuntimeRequestResolution` requires `answers` for a `user_input` submit and `content` for an elicitation submit, and rejects a mismatched body instead of accepting it as an empty response. Both drivers and the browser transport run it, and the request card now sends elicitation answers as `content`. One terminal fact per reconnect. The demo server snapshots after the close rather than before it, so requests the close already cancelled are not replayed into the driver's stale-request recovery path and reported terminal a second time. Reading afterwards also carries the closing events' source sequence into the resumed session. Goal support retired only on a provider denial. A transport or protocol failure during `thread/goal/get` said nothing about what the build supports but still set `goals: false`. `CodexRpcError` now carries the JSON-RPC code, and the capability is retired only when the provider answers that it will not serve the method. Three defects surfaced while verifying the above are fixed here too: a same-origin `EventSource` GET sends no `Origin`, so requiring one on `/stream` rejected the console's own subscription and no live-console test could connect; the browser payload redactor covered only `.paperclip` paths and leaked the app-server's `~/.codex/memories`; and the browser suite shares one server across 19 sessions against an interactive cap of 16, now sized through `PAPERCLIP_PHASE4B_MAX_SESSIONS`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>