Skip to content

Add support for phase param to custom models#542

Merged
chrarnoldus merged 6 commits intomainfrom
christiaan/phase
Feb 25, 2026
Merged

Add support for phase param to custom models#542
chrarnoldus merged 6 commits intomainfrom
christiaan/phase

Conversation

@chrarnoldus
Copy link
Contributor

@chrarnoldus chrarnoldus commented Feb 24, 2026

This is a hacky way purely to benchmark GPT-5.3-Codex. It will be properly implemented in the client when OpenRouter, Vercel AI SDK etc support it.

I am assuming the model will never emit the same text twice in the same task with different phases, but that sounds reasonable to me.

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Feb 24, 2026

Code Review Summary

Status: 7 Issues Found | Recommendation: Address before merge

Fix these issues in Kilo Cloud

Overview

Severity Count
CRITICAL 0
WARNING 6
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
src/db/schema.ts N/A temp_phase table has no cleanup/retention policy — rows will accumulate indefinitely
src/lib/custom-llm/customLlmRequest.ts 264 undefined taskId stringifies as "undefined" in hash input, risking subtle collisions
src/lib/custom-llm/customLlmRequest.ts 300 Unhandled DB error in streaming hot path — a transient DB failure will crash the user's stream
src/lib/custom-llm/customLlmRequest.ts 708 JSON.parse can throw if init.body is not valid JSON
src/lib/custom-llm/customLlmRequest.ts 792 includeRawChunks was previously gated behind inStreamDebugMode, now always true — increases memory/processing for all requests
src/lib/custom-llm/customLlmRequest.ts N/A N+1 database queries — each assistant message in responseCreateParamsPatchFetch computes a key individually, though the batch query mitigates this

SUGGESTION

File Line Issue
src/lib/custom-llm/customLlmRequest.ts N/A The part parameter name in .filter(part => ...) inside extractMessageTextParts shadows the outer part in convertStreamPartToChunk (not a bug since they're in different scopes, but could be confusing)
Files Reviewed (6 files)
  • package.json - 0 issues (openai version bump)
  • pnpm-lock.yaml - skipped (generated)
  • src/db/migrations/0030_wet_wither.sql - 0 issues
  • src/db/schema.ts - 1 issue
  • src/app/api/openrouter/[...path]/route.ts - 0 issues
  • src/lib/custom-llm/customLlmRequest.ts - 6 issues

@chrarnoldus chrarnoldus merged commit 26d71d3 into main Feb 25, 2026
12 checks passed
@chrarnoldus chrarnoldus deleted the christiaan/phase branch February 25, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants