Skip to content

Commit 8f64c4b

Browse files
committed
disable todo tools when running as task
1 parent a32877e commit 8f64c4b

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

packages/opencode/src/session/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ export namespace Session {
325325
providerID: z.string(),
326326
modelID: z.string(),
327327
mode: z.string().optional(),
328+
tools: z.record(z.boolean()).optional(),
328329
parts: z.array(
329330
z.discriminatedUnion("type", [
330331
MessageV2.TextPart.omit({
@@ -618,6 +619,7 @@ export namespace Session {
618619

619620
for (const item of await Provider.tools(input.providerID)) {
620621
if (mode.tools[item.id] === false) continue
622+
if (input.tools?.[item.id] === false) continue
621623
if (session.parentID && item.id === "task") continue
622624
tools[item.id] = tool({
623625
id: item.id as any,

packages/opencode/src/tool/task.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export const TaskTool = Tool.define({
4141
sessionID: session.id,
4242
modelID: msg.modelID,
4343
providerID: msg.providerID,
44+
tools: {
45+
todoread: false,
46+
todowrite: false,
47+
},
4448
parts: [
4549
{
4650
id: Identifier.ascending("part"),

packages/tui/internal/viewport/viewport.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package viewport
22

33
import (
4-
"log/slog"
54
"math"
65
"strings"
76

0 commit comments

Comments
 (0)