fix: delete 9 dead functions with zero callers (#22697)
This commit is contained in:
@@ -85,18 +85,6 @@ function prepareBinDirectory(binaryName) {
|
||||
return { binDir, targetPath }
|
||||
}
|
||||
|
||||
function symlinkBinary(sourcePath, binaryName) {
|
||||
const { targetPath } = prepareBinDirectory(binaryName)
|
||||
|
||||
fs.symlinkSync(sourcePath, targetPath)
|
||||
console.log(`opencode binary symlinked: ${targetPath} -> ${sourcePath}`)
|
||||
|
||||
// Verify the file exists after operation
|
||||
if (!fs.existsSync(targetPath)) {
|
||||
throw new Error(`Failed to symlink binary to ${targetPath}`)
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
if (os.platform() === "win32") {
|
||||
|
||||
@@ -26,10 +26,6 @@ const Headers = Schema.Struct({
|
||||
})
|
||||
|
||||
export namespace ExperimentalHttpApiServer {
|
||||
function text(input: string, status: number, headers?: Record<string, string>) {
|
||||
return HttpServerResponse.text(input, { status, headers })
|
||||
}
|
||||
|
||||
function decode(input: string) {
|
||||
try {
|
||||
return decodeURIComponent(input)
|
||||
|
||||
@@ -596,35 +596,11 @@ function hit(url: string, body: unknown) {
|
||||
} satisfies Hit
|
||||
}
|
||||
|
||||
/** Auto-acknowledging tool-result follow-ups avoids requiring tests to queue two responses per tool call. */
|
||||
function isToolResultFollowUp(body: unknown): boolean {
|
||||
if (!body || typeof body !== "object") return false
|
||||
// OpenAI chat format: last message has role "tool"
|
||||
if ("messages" in body && Array.isArray(body.messages)) {
|
||||
const last = body.messages[body.messages.length - 1]
|
||||
return last?.role === "tool"
|
||||
}
|
||||
// Responses API: input contains function_call_output
|
||||
if ("input" in body && Array.isArray(body.input)) {
|
||||
return body.input.some((item: Record<string, unknown>) => item?.type === "function_call_output")
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function isTitleRequest(body: unknown): boolean {
|
||||
if (!body || typeof body !== "object") return false
|
||||
return JSON.stringify(body).includes("Generate a title for this conversation")
|
||||
}
|
||||
|
||||
function requestSummary(body: unknown): string {
|
||||
if (!body || typeof body !== "object") return "empty body"
|
||||
if ("messages" in body && Array.isArray(body.messages)) {
|
||||
const roles = body.messages.map((m: Record<string, unknown>) => m.role).join(",")
|
||||
return `messages=[${roles}]`
|
||||
}
|
||||
return `keys=[${Object.keys(body).join(",")}]`
|
||||
}
|
||||
|
||||
namespace TestLLMServer {
|
||||
export interface Service {
|
||||
readonly url: string
|
||||
|
||||
@@ -143,25 +143,6 @@ async function assistant(sessionID: SessionID, parentID: MessageID, root: string
|
||||
return msg
|
||||
}
|
||||
|
||||
async function tool(sessionID: SessionID, messageID: MessageID, tool: string, output: string) {
|
||||
return svc.updatePart({
|
||||
id: PartID.ascending(),
|
||||
messageID,
|
||||
sessionID,
|
||||
type: "tool",
|
||||
callID: crypto.randomUUID(),
|
||||
tool,
|
||||
state: {
|
||||
status: "completed",
|
||||
input: {},
|
||||
output,
|
||||
title: "done",
|
||||
metadata: {},
|
||||
time: { start: Date.now(), end: Date.now() },
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function fake(
|
||||
input: Parameters<SessionProcessorModule.SessionProcessor.Interface["create"]>[0],
|
||||
result: "continue" | "compact",
|
||||
|
||||
Reference in New Issue
Block a user