This commit is contained in:
Dax Raad
2025-06-12 11:00:37 -04:00
parent b7b490f67c
commit 888105e60f
5 changed files with 43 additions and 19 deletions

View File

@@ -7,17 +7,12 @@ export namespace BunProc {
cmd: string[],
options?: Bun.SpawnOptions.OptionsObject<any, any, any>,
) {
const root =
process.argv0 !== "bun" && false
? path.resolve(process.cwd(), process.argv0)
: "bun"
log.info("running", {
cmd: [root, ...cmd],
cmd: [which(), ...cmd],
options,
})
const result = Bun.spawn([root, ...cmd], {
const result = Bun.spawn([which(), ...cmd], {
...options,
argv0: "bun",
env: {
...process.env,
...options?.env,
@@ -31,4 +26,10 @@ export namespace BunProc {
}
return result
}
export function which() {
return process.argv0 !== "bun"
? path.resolve(process.cwd(), process.argv0)
: "bun"
}
}

View File

@@ -3,6 +3,7 @@ import type { App } from "../app/app"
import path from "path"
import { Global } from "../global"
import { Log } from "../util/log"
import { BunProc } from "../bun"
export namespace LSPServer {
const log = Log.create({ service: "lsp.server" })
@@ -37,15 +38,10 @@ export namespace LSPServer {
app.path.cwd,
).catch(() => {})
if (!tsserver) return
const root =
process.argv0 !== "bun" && false
? path.resolve(process.cwd(), process.argv0)
: "bun"
const proc = spawn(
root,
BunProc.which(),
["x", "typescript-language-server", "--stdio"],
{
argv0: "bun",
env: {
...process.env,
BUN_BE_BUN: "1",

View File

@@ -259,11 +259,14 @@ export namespace Provider {
}
}
const priority = ["claude-sonnet-4", "gemini-2.5-pro-preview", "codex-mini"]
const priority = ["gemini-2.5-pro-preview", "codex-mini", "claude-sonnet-4"]
export function sort(models: Model[]) {
return sortBy(
models,
[(model) => priority.indexOf(model.id), "desc"],
[
(model) => priority.findIndex((filter) => model.id.includes(filter)),
"desc",
],
[(model) => (model.id.includes("latest") ? 0 : 1), "asc"],
[(model) => model.id, "desc"],
)

View File

@@ -283,7 +283,7 @@ export namespace Session {
}
msgs.push(system)
generateText({
maxOutputTokens: 80,
maxOutputTokens: 20,
messages: convertToModelMessages([
{
role: "system",