mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-03 13:52:09 +03:00
fix(qoder): revert out-of-scope PR #1021 changes that broke qoder tests
This commit is contained in:
@@ -24,20 +24,7 @@ export class QoderExecutor extends BaseExecutor {
|
||||
super("qoder", PROVIDERS.qoder);
|
||||
}
|
||||
|
||||
buildHeaders(_credentials: ProviderCredentials, stream = true): Record<string, string> {
|
||||
const headers: Record<string, string> = { "Content-Type": "application/json" };
|
||||
if (stream) headers["Accept"] = "text/event-stream";
|
||||
return headers;
|
||||
}
|
||||
|
||||
async execute({
|
||||
model,
|
||||
body,
|
||||
stream: _stream,
|
||||
credentials,
|
||||
signal,
|
||||
upstreamExtraHeaders,
|
||||
}: ExecuteInput) {
|
||||
async execute({ model, body, stream, credentials, signal, upstreamExtraHeaders }: ExecuteInput) {
|
||||
const token = getAuthToken(credentials);
|
||||
|
||||
if (!token) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { getModelContextLimit } from "../../src/lib/modelsDevSync";
|
||||
const DEFAULT_LIMITS: Record<string, number> = {
|
||||
claude: 200000,
|
||||
openai: 128000,
|
||||
gemini: 1048576,
|
||||
gemini: 1000000,
|
||||
codex: 400000,
|
||||
default: 128000,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { spawn } from "child_process";
|
||||
import crypto from "crypto";
|
||||
|
||||
const DEFAULT_TIMEOUT_MS = 45_000;
|
||||
const DEFAULT_MAX_TURNS = "1";
|
||||
const QODER_DEFAULT_MODEL = "qoder-rome-30ba3b";
|
||||
|
||||
export const QODER_STATIC_MODELS = [
|
||||
@@ -21,6 +24,26 @@ export const QODER_STATIC_MODELS = [
|
||||
|
||||
type JsonRecord = Record<string, unknown>;
|
||||
|
||||
type QoderCliRunOptions = {
|
||||
token: string;
|
||||
prompt: string;
|
||||
stream: boolean;
|
||||
model?: string | null;
|
||||
workspace?: string | null;
|
||||
command?: string | null;
|
||||
signal?: AbortSignal | null;
|
||||
timeoutMs?: number;
|
||||
};
|
||||
|
||||
type QoderCliRunResult = {
|
||||
ok: boolean;
|
||||
code: number | null;
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
timedOut: boolean;
|
||||
error: string | null;
|
||||
};
|
||||
|
||||
type QoderCliFailure = {
|
||||
status: number;
|
||||
message: string;
|
||||
@@ -297,10 +320,6 @@ export function parseQoderCliFailure(stderrText: string, stdoutText = ""): Qoder
|
||||
return { status: 504, message: combined, code: "timeout" };
|
||||
}
|
||||
|
||||
if (normalized.includes("command not found") || normalized.includes("no such file")) {
|
||||
return { status: 503, message: combined, code: "runtime_error" };
|
||||
}
|
||||
|
||||
return { status: 502, message: combined, code: "upstream_error" };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user