mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 06:45:22 +00:00
fix: comment out gitlab for now
This commit is contained in:
@@ -180,31 +180,32 @@ export namespace LLM {
|
||||
// Wire up toolExecutor for DWS workflow models so that tool calls
|
||||
// from the workflow service are executed via opencode's tool system
|
||||
// and results sent back over the WebSocket.
|
||||
if (language instanceof GitLabWorkflowLanguageModel) {
|
||||
const workflowModel = language
|
||||
workflowModel.systemPrompt = system.join("\n")
|
||||
workflowModel.toolExecutor = async (toolName, argsJson, _requestID) => {
|
||||
const t = tools[toolName]
|
||||
if (!t || !t.execute) {
|
||||
return { result: "", error: `Unknown tool: ${toolName}` }
|
||||
}
|
||||
try {
|
||||
const result = await t.execute!(JSON.parse(argsJson), {
|
||||
toolCallId: _requestID,
|
||||
messages: input.messages,
|
||||
abortSignal: input.abort,
|
||||
})
|
||||
const output = typeof result === "string" ? result : (result?.output ?? JSON.stringify(result))
|
||||
return {
|
||||
result: output,
|
||||
metadata: typeof result === "object" ? result?.metadata : undefined,
|
||||
title: typeof result === "object" ? result?.title : undefined,
|
||||
}
|
||||
} catch (e: any) {
|
||||
return { result: "", error: e.message ?? String(e) }
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: fix this once v6 is ready
|
||||
// if (language instanceof GitLabWorkflowLanguageModel) {
|
||||
// const workflowModel = language
|
||||
// workflowModel.systemPrompt = system.join("\n")
|
||||
// workflowModel.toolExecutor = async (toolName, argsJson, _requestID) => {
|
||||
// const t = tools[toolName]
|
||||
// if (!t || !t.execute) {
|
||||
// return { result: "", error: `Unknown tool: ${toolName}` }
|
||||
// }
|
||||
// try {
|
||||
// const result = await t.execute!(JSON.parse(argsJson), {
|
||||
// toolCallId: _requestID,
|
||||
// messages: input.messages,
|
||||
// abortSignal: input.abort,
|
||||
// })
|
||||
// const output = typeof result === "string" ? result : (result?.output ?? JSON.stringify(result))
|
||||
// return {
|
||||
// result: output,
|
||||
// metadata: typeof result === "object" ? result?.metadata : undefined,
|
||||
// title: typeof result === "object" ? result?.title : undefined,
|
||||
// }
|
||||
// } catch (e: any) {
|
||||
// return { result: "", error: e.message ?? String(e) }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
return streamText({
|
||||
onError(error) {
|
||||
|
||||
Reference in New Issue
Block a user