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:
2026-05-13 15:09:27 +03:00
parent 7447cb3a56
commit 28eb7e849b
9 changed files with 114 additions and 175 deletions
+9
View File
@@ -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