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.
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.
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.
None.
None.
- Claude Code: not loaded by the bridge (
isInClaudeCode: falseinsrc/modules/registry.ts); claude workers use--json-schemainstead. - OpenCode:
implementer,reviewer,pr-reviewerandresearcherallowsubmit_result(opencode.json).