feat: add OpenRouter support with catalog-driven model resolution and cost-based routing#109
feat: add OpenRouter support with catalog-driven model resolution and cost-based routing#109samueltuyizere wants to merge 160 commits into
Conversation
…nfiguration options
…nd add corresponding tests
…rresponding tests
…ponding UI updates and tests
Code Review Roast 🔥Verdict: 1 New Issue | 3 Previous Issues Resolved Overview
New Issue Details (click to expand)
Resolved Issues (from previous review)
🏆 Best part: Three of the four prior review findings are genuinely dead — the orphaned 💀 Worst part: Line 1702. Someone copy-pasted 📊 Overall: Like a band-aid that was ripped off and put back on — the big wounds are closed, but there's still a sticky residue of carelessness. One quick trim and this is clean. Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous Review Summaries (13 snapshots, latest commit 087cbc4)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 087cbc4)Verdict: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The increment actually fixes the prior finding — 💀 Worst part: The 📊 Overall: Like a game of whack-a-mole where the mole is a Fix these issues in Kilo Cloud Files Reviewed (2 files, incremental)Previous review (commit a1d57a6)Verdict: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: This increment actually closes the prior 💀 Worst part: At the streaming finish line (line 778) you attributed the failure to 📊 Overall: Like a sequel that fixes the original plot hole but accidentally leaves a clone of the villain in the final scene — one small continuity error to patch before shipping. Files Reviewed (1 file, incremental)
Fix these issues in Kilo Cloud Previous review (commit cd91105)Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR increment is actually clean. I need to sit down. I had my flamethrower warmed up and everything. The previous duplicate success/failure collection block in 📊 Overall: Like finding a unicorn in production — I didn't think clean PR increments existed anymore, but here we are. Files Reviewed (3 files, incremental)
Previous review (commit 96143b8)Verdict: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The per-model 💀 Worst part: 📊 Overall: Like a fitness tracker that counts your steps but silently zeroes your heart-rate — the metrics half-work, but the scary numbers are missing, and you'd never know from looking. Files Reviewed (2 files, incremental)
Fix these issues in Kilo Cloud Previous review (commit 2f3cbbb)Verdict: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: 💀 Worst part: 📊 Overall: Like a magician's assistant who sawed the volunteer in half and forgot the "put back together" half. The backend disappeared the logs feature cleanly; the frontend left the test module bleeding out under a Logs Module name tag. Fix these issues in Kilo Cloud Files Reviewed (5 files, incremental)
Previous review (commit ebd3e41)Verdict: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The 💀 Worst part: 📊 Overall: A clean, correct refactor round — one real bug (SA6002) squashed properly, one dead feature that got camouflaged instead of built. Like painting over a leak: looks better, still drips. Files Reviewed (3 files, incremental)
Fix these issues in Kilo Cloud Previous review (commit 15f4486)Verdict: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The 💀 Worst part: 📊 Overall: A solid, safe refactor with one dead-on-arrival feature and one ironic allocation in the anti-allocation code. Like a race car with the parking brake gently on — fast, but you can smell it. Files Reviewed (4 files, incremental)
Fix these issues in Kilo Cloud Previous review (commit f845473)Verdict: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The 💀 Worst part: 📊 Overall: A solid, safe refactor with one dead-on-arrival feature and one ironic allocation in the anti-allocation code. Like a race car with the parking brake gently on — fast, but you can smell it. Files Reviewed (4 files, incremental)
Fix these issues in Kilo Cloud Previous review (commit d6917eb)Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR increment is actually clean. I need to sit down. I had my flamethrower warmed up and everything. The lone change at Makefile:36 is a genuine fix: it removes the self-defeating 📊 Overall: Like finding a unicorn in production — I didn't think clean PR increments existed anymore, but here we are. Files Reviewed (1 file, incremental)
Previous review (commit 99cb066)Verdict: No Issues Found | Recommendation: Merge Oh wait, this incremental diff is actually clean. I need to sit down. I had my flamethrower warmed up and everything. The lone change wraps a deferred 📊 Overall: Like finding a unicorn in production — I didn't think clean PR increments existed anymore, but here we are. Files Reviewed (1 file, incremental)
Previous review (commit 3ceb0f4)Verdict: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The catalog.go cleanup is genuinely good — the 💀 Worst part: 📊 Overall: Like a smoke detector with the battery taped over — it still beeps reassuringly, but it won't stop the fire. Files Reviewed (6 files, incremental)
Previous review (commit d6c1f5e)Verdict: No Issues Found | Recommendation: Merge Incremental ScopeThis run covers only the changes since the previous review SHA ( Resolved Findings
New Issues
🏆 Best part: This diff is a masterclass in "make the linter happy" — panic-prone slice hacks fixed, pipefail restored, dead code purged, and the gofmt diff output brought back. The kind of boring, correct cleanup every codebase needs periodically. 💀 Worst part: Nothing. I'm actually suspicious. A PR this clean in a codebase this size is either a phantom or a setup. But I'll take the win. 📊 Overall: Like a quiet Tuesday in operations — no pages, no fires, just maintenance that makes the next deployment slightly less painful. Files Reviewed (14 files, incremental)
Previous review (commit 81beeed)Verdict: 1 Warning | Recommendation: Address before merge Incremental ScopeThis run covers only the changes since the previous review SHA ( Resolved Findings (from prior review)
New Issues
Issue Details (click to expand)
[Snapshot truncated.] Additional previous summary content was truncated to keep this comment within platform limits. Reviewed by step-3.7-flash · Input: 364.1K · Output: 45K · Cached: 3.5M |
Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com> Signed-off-by: TUYIZERE Samuel <tuyizeres0@gmail.com>
… and preferred provider logic
…mance in stream processing
…rings for improved clarity and performance
- Fix 'configModels is not iterable' error in app.js populateModels() by using Array.isArray() check instead of optional chaining fallback - Restore stream.go to working state from commit c4616e9 (removes inconsistent sync.Pool usage and bytes.Buffer confusion) - Add pre-push hook documentation to CONTRIBUTING.md
- Pass []byte directly to fmt.Fprintf instead of string(data) - Use bytes functions instead of strings for SSE parsing - Change lineBuf from bytes.Buffer to []byte slice - Remove heap allocations from hot SSE parse loop
- Add golangci-lint run as check 3/5 (between go vet and tests) - Skip with warning if golangci-lint not installed - Renumber remaining checks to 4/5 (tests) and 5/5 (build)
- Remove unused level variable in gui/server.go - Fix SA6002: store pointers to slices in sync.Pool to avoid allocations - Update Get/Put calls to use *[]byte and dereference on read
- Remove /api/logs/stream and /api/logs/history endpoints - Delete internal/gui/logs.go (LogBuffer, LogHandler, SSE streaming) - Remove Logs tab from index.html and navigation - Remove LogsModule, log translations, and log CSS from frontend - Remove goto-logs command palette action and keyboard shortcut - Clean up unused imports (strconv) and struct fields (logBuffer)
…t with success/failure counts
…ure tracking - Add modelSuccess/modelFailed maps to Metrics struct with dedicated mutexes - RecordSuccess now increments per-model success counter - Add RecordFailureForModel for future per-model failure tracking - Snapshot now includes ModelSuccess and ModelFailed maps - perf.go handlePerformance now populates Success/Failed from Snapshot when using in-memory metrics - Frontend success rate calculation now correctly shows (success / count * 100) per model
- Change 4 RecordFailure() calls in messages.go to RecordFailureForModel(model.ModelID) - Line 591: stream idle error after SSE started - Line 599: upstream failure after SSE started - Line 776: final fallback failure in handleStreamingRequest - Line 1099: final fallback failure in handleNonStreamingRequest (uses result.ModelID) - This populates snap.ModelFailed so Performance tab shows real per-model failure rates instead of always 100% success
- Remove duplicate RecordFailureForModel declaration in metrics.go - Add lastModelID declaration before modelChain loop in handleStreamingRequest - Use lastModelID at final fallback failure recording point
- Revert line 778 from RecordFailureForModel(lastModelID) to RecordFailure() - handleStreamError already recorded per-model failures inside the loop - Using RecordFailureForModel at the 'all failed' point double-counted the last model - Remove unused lastModelID variable (was only needed for per-model recording)
Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com> Signed-off-by: TUYIZERE Samuel <tuyizeres0@gmail.com>
| setTimeout(() => { | ||
| this.testCopyBtn.innerHTML = originalText; | ||
| this.testCopyBtn.classList.remove('copied'); | ||
| this.testCopyBtn.classList.remove('copied'); |
There was a problem hiding this comment.
🔥 The Roast: Someone held down the Ctrl+V key a little too long. this.testCopyBtn.classList.remove('copied') now appears twice in a row at lines 1701–1702 — the second invocation is the coding equivalent of nodding at your own joke after everyone else stopped laughing. It's harmless, but it's also a tell that this diff was copy-pasted from somewhere and nobody proofread it.
🩹 The Fix:
| this.testCopyBtn.classList.remove('copied'); | |
| this.testCopyBtn.classList.remove('copied'); | |
| }, 2000); |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
This PR adds OpenRouter provider support, a local model catalog system, and cost-based routing to routatic-proxy.
What's new
OpenRouter Provider (ba0045c, 1b50001)
Model Catalog System (bdc792f → 56ed94c)
Catalog-Based Model Resolution (bfa3e81, 032c1dd, b6ef72e, 0411bc4)
Cost-Based Routing (b6ecfdf, 3754f07, 4640470)
GUI Updates (56ed94c)