Skip to content

[pull] master from MAXeaglet:master - #2

Open
pull[bot] wants to merge 7 commits into
iccmei:masterfrom
MAXeaglet:master
Open

[pull] master from MAXeaglet:master#2
pull[bot] wants to merge 7 commits into
iccmei:masterfrom
MAXeaglet:master

Conversation

@pull

@pull pull Bot commented Aug 4, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

ouones and others added 6 commits August 1, 2026 11:02
getApiKey only read the Authorization: Bearer header, which the Anthropic
TypeScript/JS SDK does not send — it authenticates via the x-api-key
header. Fall back to x-api-key (case-insensitive) when no Bearer token is
present, extracting the user_ key with the same regex. OpenAI-style
requests keep working unchanged.
In handleChatCompletions, startTime/bytesReceived/lastCcEvent/keepaliveCount
were declared with const/let inside the try block after the await
forwardToCC() call, but the res.on('close') callback (registered later)
references them. If the client disconnects while the upstream response is
slow, the close callback runs before those declarations execute, hitting
the temporal dead zone and throwing ReferenceError. The non-stream idle
timeout catch branch has the same risk.

Hoist these to function scope before the try block; keep only the
branch-local non-stream vars (finishReason/usage/toolCalls) where they
are. Same fix applied to handleMessages for startTime/messageId/reader/
bytesReceived/lastCcEvent/fullText, and declare the missing
finishReason/usage/toolCalls in the non-stream Anthropic branch (were
undefined, also a ReferenceError source).
fix: hoist TDZ-bound disconnect-handler vars + x-api-key fallback for Anthropic SDK
…ts, x-api-key auth, 429 zero-output, updated model list)
@pull pull Bot locked and limited conversation to collaborators Aug 4, 2026
@pull pull Bot added the ⤵️ pull label Aug 4, 2026
… non-stream)

CC upstream emits reasoning-delta for thinking; the Anthropic paths dropped it
(stream: empty break; non-stream: fell to default warn), so Claude Code never
saw thinking. Route it into standard Anthropic thinking content blocks:

- stream: content_block_start(type=thinking) -> thinking_delta -> signature_delta -> stop
- non-stream: accumulate reasoning-delta, emit {type:'thinking', thinking, signature}
- fake E-prefixed signature (base64, payload first byte 0x12) passes Claude Code's
  shallow verification; request-side conversion still strips thinking so upstream
  caching/billing are unaffected (verified: cache_read_input_tokens unchanged,
  output_tokens are CC's real billing value including thinking)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants