GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Callable Effect Standard Schemas without a JSON Schema converter disappear from the tool registry · Issue #66827 · anomalyco/opencode

Callable Effect Standard Schemas without a JSON Schema converter disappear from the tool registry #66827

New issue
Copy link
New issue
Copy link
Backlog
#66828
Backlog
Callable Effect Standard Schemas without a JSON Schema converter disappear from the tool registry#66827
#66828
Copy link
Labels
area/pluginsPlugins, skills, custom agentsplatform/windowsWindowsstatus/regressionstatus/repro-simulatedReproduced with a simulated model or mocktype/bugSomething is brokenversion/v2OpenCode 2.x

Description

@virajchoudhary
virajchoudhary
opened on Nov 27, 2026
Issue body actions

Description

OpenCode skips tools that use Schema.toStandardSchemaV1 when the Effect adapter has no ~standard.jsonSchema converter. Definition building throws Schema vendor "effect" does not support JSON Schema conversion. I reproduced this independently with a wrapped input and with a wrapped output. Effect 4.1.0 can generate a JSON Schema document for both.

Plugins

Minimal local Effect plugin using ToolEditor.add and Effect 4.1.0.

OpenCode version

dev at 138cc9aedb9327a75ea3a95f60b772a24f118211.

Steps to reproduce

Register this tool. The registry snapshot should contain increment with a required string field and a string output schema. The tool is missing from the snapshot. To test either direction on its own, pass the other schema directly without wrapping it.

editor.add({
  name: "increment",
  description: "Increment a number",
  input: Schema.toStandardSchemaV1(Schema.Struct({ value: Schema.NumberFromString })),
  output: Schema.toStandardSchemaV1(Schema.NumberFromString),
  options: { codemode: false },
  execute: ({ value }) => Effect.succeed({ output: value + 1 }),
})

Operating System

Windows x64, Bun 1.4.5.

Related to #62753 and #62746. #64515 fixed callable schema detection. This report covers conversion when the callable adapter supplies validation only.

Activity

  1. opencodejr
    added
    area/pluginsPlugins, skills, custom agents
    platform/windowsWindows
    type/bugSomething is broken
    version/v2OpenCode 2.x
    on Nov 27, 2026
  2. opencodejr commented on Nov 27, 2026

    @opencodejr
    opencodejrBot
    on Nov 27, 2026
    Contributor
    More actions

    Seen with a simulated model or a mock server, not a real provider; a maintainer should confirm.

    Thanks for the precise report. I reproduced this on 2.4.2 and it still happens on the latest dev (8815bc9).

    The script below loads a local Effect plugin that registers four tools with editor.add: one with plain Effect schemas, one with both schemas wrapped in Schema.toStandardSchemaV1 (your example), one with only the input wrapped and one with only the output wrapped. A simulated model then lists the tools it receives. Only the plain-schema tool is sent; all three wrapped tools are missing. Calling definition() from packages/core/src/tool/runtime.ts directly with a wrapped input, or with a wrapped output, throws Schema vendor "effect" does not support JSON Schema conversion.

    The cause looks like what you describe. standardJsonSchema in that file only converts schemas that have ~standard.jsonSchema or are Zod types. Since #64515, the callable schema from Schema.toStandardSchemaV1 takes that path instead of the plain Effect conversion it got before (see #62746).

    Related: #62746 (callable Standard Schema validation, fixed by #64515) and #62753.

    Reproduction script (drive.ts)
    // Reproduces anomalyco/opencode#66827: tools whose input/output is a callable
    // Effect Standard Schema (Schema.toStandardSchemaV1, no ~standard.jsonSchema)
    // are missing from the tool list sent to the model.
    // Run: OPENCODE_DRIVE_MEDIA_DIR=/workspace/media opencode-drive run drive.ts
    //      (set OC_DEV=/path/to/opencode/checkout to run from source)
    import { Effect, Stream } from "effect"
    import { Llm, OpenCodeDriver } from "opencode-drive"
    
    const plugin = `
    import { Plugin } from "@opencode/plugin/effect"
    import { Effect, Schema } from "effect"
    
    export default Plugin.define({
      id: "repro-66827",
      effect: (ctx) =>
        Effect.gen(function* () {
          yield* ctx.tool.transform((editor) => {
            const base = {
              description: "Increment a number",
              options: { codemode: false },
              execute: ({ value }: any) => Effect.succeed({ output: Number(value) + 1 }),
            }
            // control: plain Effect schemas
            editor.add({ ...base, name: "control_plain",
              input: Schema.Struct({ value: Schema.NumberFromString }),
              output: Schema.NumberFromString } as any)
            // both wrapped (the issue's example)
            editor.add({ ...base, name: "increment",
              input: Schema.toStandardSchemaV1(Schema.Struct({ value: Schema.NumberFromString })),
              output: Schema.toStandardSchemaV1(Schema.NumberFromString) } as any)
            // only input wrapped
            editor.add({ ...base, name: "increment_input_wrapped",
              input: Schema.toStandardSchemaV1(Schema.Struct({ value: Schema.NumberFromString })),
              output: Schema.NumberFromString } as any)
            // only output wrapped
            editor.add({ ...base, name: "increment_output_wrapped",
              input: Schema.Struct({ value: Schema.NumberFromString }),
              output: Schema.toStandardSchemaV1(Schema.NumberFromString) } as any)
          })
        }),
    })
    `
    
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        project: { git: true, files: { ".opencode/plugins/repro.ts": plugin } },
      },
      ({ ui, llm }) =>
        Effect.gen(function* () {
          yield* llm.serve((request) => {
            const body = request.body as any
            const names: string[] = (body?.tools ?? []).map(
              (t: any) => t?.function?.name ?? t?.name ?? JSON.stringify(t).slice(0, 60),
            )
            const ours = names.filter((n) => n.includes("increment") || n.includes("control_plain"))
            console.log("TOOLS SENT TO MODEL (plugin ones):", JSON.stringify(ours))
            for (const n of ["control_plain", "increment", "increment_input_wrapped", "increment_output_wrapped"])
              console.log(`  ${n}: ${names.some((x) => x.endsWith(n)) ? "PRESENT" : "MISSING"}`)
            return Stream.make(Llm.text("done"))
          })
          yield* Effect.sleep(3000)
          yield* ui.submit("hi")
          yield* ui.waitFor("done")
          yield* ui.screenshot("after")
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

  3. opencodejr
    added
    status/regression
    status/repro-simulatedReproduced with a simulated model or mock
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pluginsPlugins, skills, custom agentsplatform/windowsWindowsstatus/regressionstatus/repro-simulatedReproduced with a simulated model or mocktype/bugSomething is brokenversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.