Skip to content

Commit 436cd39

Browse files
chore: generate
1 parent ed6dc87 commit 436cd39

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

packages/codemode/src/tool-runtime.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,9 @@ export const discoveryPlan = <R>(
467467
: complete
468468
? "Execute JavaScript in a confined runtime. Inside this program, `tools` contains only the host-provided tools listed below; surrounding agent tools are not available unless listed here."
469469
: "Execute JavaScript in a confined runtime. Inside this program, `tools` contains only the host-provided tools listed or searchable below; surrounding agent tools are not available unless listed here.",
470-
...(empty ? [] : ["Do not infer or normalize tool names; use only exact signatures shown below or returned by search."]),
470+
...(empty
471+
? []
472+
: ["Do not infer or normalize tool names; use only exact signatures shown below or returned by search."]),
471473
]
472474

473475
// The search step exists only when search is advertised (PARTIAL catalog); a COMPLETE
@@ -481,7 +483,7 @@ export const discoveryPlan = <R>(
481483
...(complete
482484
? [
483485
"1. Pick a tool from the list under `## Available tools` - each line is the exact call signature; use it as-is rather than guessing segments.",
484-
'2. Call it using the exact signature shown; bracket notation and quotes are part of the path.',
486+
"2. Call it using the exact signature shown; bracket notation and quotes are part of the path.",
485487
'3. Parse text results: `const data = typeof res === "string" ? JSON.parse(res) : res` - most tools return JSON as a string.',
486488
"4. Return only the fields you need: `return { <field>: data.<field> }` - raw payloads get truncated and waste context.",
487489
]

packages/opencode/src/tool/registry.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,7 @@ const layer = Layer.effect(
280280
const ruleset = Permission.merge(input.agent.permission, input.permission ?? [])
281281
const tools = Permission.visibleTools(yield* mcp.tools(), ruleset)
282282
if (Object.keys(tools).length === 0) return
283-
return codeMode.describeCatalog(
284-
tools,
285-
Object.keys(yield* mcp.clients()).map(McpCatalog.sanitize),
286-
)
283+
return codeMode.describeCatalog(tools, Object.keys(yield* mcp.clients()).map(McpCatalog.sanitize))
287284
})
288285

289286
const tools: Interface["tools"] = Effect.fn("ToolRegistry.tools")(function* (input) {
@@ -300,7 +297,9 @@ const layer = Layer.effect(
300297
return true
301298
})
302299

303-
const codeModeDescription = filtered.some((tool) => tool.id === "execute") ? yield* describeCodeMode(input) : undefined
300+
const codeModeDescription = filtered.some((tool) => tool.id === "execute")
301+
? yield* describeCodeMode(input)
302+
: undefined
304303
const visible = filtered.filter((tool) => tool.id !== "execute" || codeModeDescription)
305304

306305
return yield* Effect.forEach(

0 commit comments

Comments
 (0)