# Migration TODO List

## Completed Tasks
- [x] Initial Go project setup
- [x] Database schema & migrations (hardcoded in `db.go`)
- [x] Configuration loader (Viper)
- [x] Auth Middleware (scoped to `/v1`)
- [x] Basic Provider implementations (OpenAI, Gemini, DeepSeek, Grok, Ollama)
- [x] Streaming Support (SSE & Gemini custom streaming)
- [x] Archive Rust files to `rust` branch
- [x] Clean root and set Go version as `main`
- [x] Enhanced `helpers.go` for Multimodal & Tool Calling (OpenAI compatible)
- [x] Enhanced `server.go` for robust request conversion
- [x] Dashboard Management APIs (Clients, Tokens, Users, Providers)
- [x] Dashboard Analytics & Usage Summary (Fixed SQL robustness)
- [x] WebSocket for real-time dashboard updates (Hub with client counting)
- [x] Asynchronous Request Logging to SQLite
- [x] Update documentation (README, deployment, architecture)
- [x] Cost Tracking accuracy (Registry integration with `models.dev`)
- [x] Model Listing endpoint (`/v1/models`) with provider filtering
- [x] System Metrics endpoint (`/api/system/metrics` using `gopsutil`)
- [x] Fixed dashboard 404s and 500s

## Planned Resolutions (High Priority)

### Security Fixes
- [x] **Critical:** Fix `AuthMiddleware` to reject invalid tokens instead of falling back to insecure prefix derivation.

### Feature Parity Checklist (High Priority)

### OpenAI Provider
- [x] Tool Calling
- [x] Multimodal (Images) support
- [x] Accurate usage parsing (cached & reasoning tokens)
### Feature Parity: OpenAI Provider Enhancements
- [x] **Reasoning Content (CoT) Support (`o1`/`o3`):**
    - [x] Infrastructure verified. `reasoning_content` is mapped in request/response structures.
- [x] **Support for `/v1/responses` API:**
    - [x] Implemented new route in `internal/server/server.go`.

### Gemini Provider
- [x] Tool Calling (mapping to Gemini format)
- [x] Multimodal (Images) support
- [x] Reasoning/Thought support
- [x] Handle Tool Response role in unified format

### DeepSeek Provider
- [x] Reasoning Content (CoT) support
- [x] Parameter sanitization for `deepseek-reasoner`
- [x] Tool Calling support
- [x] Accurate usage parsing (cache hits & reasoning)

### Grok Provider
- [x] Tool Calling support
- [x] Multimodal support
- [x] Accurate usage parsing (via OpenAI helper)

### Ollama Provider
- [x] OpenAI-compatible API integration
- [x] Streaming support
- [x] Model pattern detection for routing
- [x] Zero cost calculation (local/free models)

## Infrastructure & Middleware
- [ ] Implement Rate Limiting (`golang.org/x/time/rate`)
- [x] Implement Circuit Breaker (`github.com/sony/gobreaker`)

## Verification
- [ ] Unit tests for feature-specific mapping (CoT, Tools, Images)
- [ ] Integration tests with live LLM APIs
