Skip to content

Latest commit

 

History

History
24 lines (13 loc) · 1.2 KB

File metadata and controls

24 lines (13 loc) · 1.2 KB

Structured Output

Gives an OpenCode worker a schema-checked way to return its result. A run dispatched with a result schema (the workflow engine's agent steps pass one) finishes by calling submit_result, whose input is that schema; a claude worker gets the same through --json-schema.

Tools

  • submit_result - the session's final result, as an object matching the schema; the result is checked, and a mismatch answers with errors so the worker can fix it and call again.

Hooks

server.ts wraps the tool in its own plugin and registers ctx.session.hook('context', ...). For every model request the hook reads the session's resultSchema metadata: a session without one never sees submit_result, and a session with one sees the tool advertise its schema as input and is told to finish with it. A deny rule removes the tool before the hook runs, so only agents that allow it are affected.

Authentication

None.

Configuration

None.

Where it runs

  • Claude Code: not loaded by the bridge (isInClaudeCode: false in src/modules/registry.ts); claude workers use --json-schema instead.
  • OpenCode: implementer, reviewer, pr-reviewer and researcher allow submit_result (opencode.json).