This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Levi Neely
21827c57eb
backend: extract stream parsers, shared HTTP, url.URL, comprehensive tests
- Extract streamOpenAISSE, streamOllamaNDJSON from ChatStream goroutines
into standalone functions taking io.Reader for direct testability
- Remove ctx parameter from streamAnthropicSSE (caller handles cancellation)
- Extract streamRequest into backend.go: shared HTTP execution, 429/error
handling, and goroutine lifecycle for all three backends
- Extract encodeOpenAIMessages, encodeOpenAITools from ChatStream
- Replace string baseURL with *url.URL; validate in constructors
- Constructors (NewOpenAI, NewOllama, NewAnthropic, NewCopilot) now return error
- Remove unreachable json.Marshal and http.NewRequestWithContext error branches
ChatStream coverage: 100% (OpenAI, Ollama, Anthropic)
Stream parsers: 100% (OpenAI, Ollama), 96.6% (Anthropic)
streamRequest: 100%
Test files:
- openai_encode_test.go: message/tool encoding, JSON round-trip
- openai_stream_test.go: SSE parsing via io.Reader
- ollama_stream_test.go: NDJSON parsing via io.Reader
- anthropic_stream_test.go: SSE parsing, mapAnthropicStopReason
- openai_test.go: HTTP integration, error paths, models, context length
- backend_test.go: contract checks (all interface methods), stream text/usage/
tool calls/tool conversation, HTTP errors, rate limits for all backends
|
2026-04-21 15:32:03 +02:00 |
| .. |
|
agent
|
pkg/log: remove globals, inject Sink as dependency
|
2026-04-21 14:48:41 +02:00 |
|
backend
|
backend: extract stream parsers, shared HTTP, url.URL, comprehensive tests
|
2026-04-21 15:32:03 +02:00 |
|
config
|
pkg/config, pkg/skills: accept io.Reader, remove filesystem access
|
2026-04-21 13:51:46 +02:00 |
|
env
|
pkg/env: add tests (0% -> 100% coverage)
|
2026-04-21 13:53:38 +02:00 |
|
log
|
pkg/log: remove globals, inject Sink as dependency
|
2026-04-21 14:48:41 +02:00 |
|
paths
|
add OLLIE_CFG_PATH and OLLIE_DATA_PATH env vars
|
2026-04-17 15:31:19 +02:00 |
|
skills
|
pkg/config, pkg/skills: accept io.Reader, remove filesystem access
|
2026-04-21 13:51:46 +02:00 |
|
tools
|
pkg/tools: add contract tests, remove Close from Server/Dispatcher
|
2026-04-21 13:38:02 +02:00 |