mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-11-29 11:13:05 +00:00
Two fixes that together restore claude.ai connector functionality through Anthropic's Streamable HTTP proxy: 1. Respect the client's Accept header. The proxy sends `Accept: application/json, text/event-stream` and rejects plain JSON responses as "Invalid content from server" because it expects the SSE form. When the client accepts text/event-stream, wrap the JSON-RPC response as `event: message\ndata: <json>\n\n` and respond with Content-Type: text/event-stream. 2. Auto-recreate sessions for unknown session IDs. When the device restarts (process kill, app reinstall, idle eviction) the in-memory sessions map is empty, but the proxy / client still holds the old session ID and sends tools/call without re-initializing. Returning 404 surfaces "Invalid content from server" through the proxy. Instead, recreate the session under the requested id and bind it to the caller's clientId. Security is unchanged: the caller's OAuth token is what gates access, and the SDK Server starts fresh — there is no leftover state from the previous session. Tests for the previous "unknown session = 404" behaviour are updated to assert the auto-recreate behaviour, including matching session id echo on the response. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bridge | ||
| mcp | ||
| testfixtures | ||
| tunnel | ||