feat: increase SSE scanner buffer to 4MB for Anthropic tool calls, add stream error handling, prune unused Go dependencies, and add setup instructions.
This commit is contained in:
@@ -43,9 +43,18 @@ Authorization: Bearer <api-key>
|
||||
| `infoPage()` | `GET /anthropic` (boş path) için HTML bilgi sayfası |
|
||||
| `modelsList()` | `GET /anthropic/v1/models` için model listesi |
|
||||
|
||||
## Streaming (`handleStreaming()`)
|
||||
|
||||
`STREAMING=true` ve client `stream: true` gönderdiğinde SSE streaming devreye girer.
|
||||
|
||||
- `bufio.Scanner` buffer: **4MB** (varsayılan 64KB yerine) — Claude Code tool çağrılarında büyük chunk'lar için
|
||||
- Scanner hatası (`bufio.ErrTooLong` vb.) loglanır ve stream sonlandırılır
|
||||
- Write/Flush hataları loglanır
|
||||
|
||||
## Edge Case'ler
|
||||
|
||||
- Geçersiz Anthropic formatı → uyarı log'u + raw passthrough
|
||||
- Upstream hatası → `502 Bad Gateway`
|
||||
- Yanıt dönüşüm hatası → raw yanıtı forward et
|
||||
- `STREAMING=false` → client `stream: true` isteği görmezden gelinir, non-streaming yanıt döner
|
||||
- Scanner buffer overflow → `[ANTHROPIC] Stream scan error` log'u, stream durur
|
||||
|
||||
Reference in New Issue
Block a user