Deliver production-grade streaming, resilience, and observability features.
Includes polling parity with the Python SDK plus broad refactors, docs, and
test isolation improvements.
Streaming sampling
- Add SamplingClient.sample_stream/4 for SSE token streaming.
- Introduce Types.SampleStreamChunk for incremental token processing.
- Implement API.Sampling.sample_stream/2 hitting /api/v1/stream_sample.
- Preserve sampling pool concurrency and session semantics.
OpenTelemetry propagation (opt-in)
- Add Telemetry.Otel to inject W3C traceparent and tracestate headers.
- Enable via config otel_propagate: true or env TINKEX_OTEL_PROPAGATE=true.
- Degrade gracefully when OpenTelemetry deps are not installed.
Circuit breaker
- Add CircuitBreaker with closed/open/half-open state machine.
- Add CircuitBreaker.Registry backed by ETS for multi-process sharing.
- Support configurable failure thresholds and reset timeouts.
Future polling parity and reliability
- Move retry policy into polling loop; pass max_retries: 0 to HTTP layer.
- Continue polling on 408 and 5xx responses until poll_timeout elapses.
- Retry connection errors with exponential backoff; cap exponent to avoid
overflow.
- Default polling per-request HTTP timeout to 45s; sampling inherits unless set.
- Merge config.user_metadata into HTTP and Future telemetry metadata.
Defaults and compatibility
- Align API.RetryConfig default max_retries to 10 (Python parity).
- Prefer Task.await(task, :infinity) in docs/examples to avoid 5s default.
Docs, examples, and visuals
- Update CHANGELOG and README highlights for v0.3.3.
- Add onboarding, gaps analysis, current-state docs, and model registry plan.
- Add test infrastructure overhaul plan and refactor guidance.
- Redesign project logo and update asset sizing for better rendering.
- Add timestamps and durations to examples/run_all.sh output.
Tests and quality
- Add test suites for circuit breaker, streaming sampling, and Otel injection.
- Add Future tests for 408, 5xx, and connection error handling.
- Upgrade supertester to 0.4.0; enable async tests with telemetry/logger
isolation, plus ETS isolation for tokenizer cache.
- Refactor numerous modules to reduce complexity and standardize error handling.