mirror of
https://github.com/sst/opencode.git
synced 2025-08-03 13:22:19 +00:00
disable todo tools when running as task
This commit is contained in:
parent
a32877e908
commit
8f64c4b312
3 changed files with 6 additions and 1 deletions
|
@ -325,6 +325,7 @@ export namespace Session {
|
|||
providerID: z.string(),
|
||||
modelID: z.string(),
|
||||
mode: z.string().optional(),
|
||||
tools: z.record(z.boolean()).optional(),
|
||||
parts: z.array(
|
||||
z.discriminatedUnion("type", [
|
||||
MessageV2.TextPart.omit({
|
||||
|
@ -618,6 +619,7 @@ export namespace Session {
|
|||
|
||||
for (const item of await Provider.tools(input.providerID)) {
|
||||
if (mode.tools[item.id] === false) continue
|
||||
if (input.tools?.[item.id] === false) continue
|
||||
if (session.parentID && item.id === "task") continue
|
||||
tools[item.id] = tool({
|
||||
id: item.id as any,
|
||||
|
|
|
@ -41,6 +41,10 @@ export const TaskTool = Tool.define({
|
|||
sessionID: session.id,
|
||||
modelID: msg.modelID,
|
||||
providerID: msg.providerID,
|
||||
tools: {
|
||||
todoread: false,
|
||||
todowrite: false,
|
||||
},
|
||||
parts: [
|
||||
{
|
||||
id: Identifier.ascending("part"),
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package viewport
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue