- JavaScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| index.js | ||
| index.test.js | ||
| normalize.js | ||
| normalize.test.js | ||
| package.json | ||
| README.md | ||
OpenCode Responses output normalizer
This local OpenCode 2.2.5 plugin merges multiple text content parts from a
completed tool result into one text part before the result is returned to the
model. For the configured chat-brodda-it provider only, non-text result parts
are replaced by an explicit notice because that LibreChat Agents Responses
endpoint currently rejects content arrays. The model is told that it cannot
inspect the omitted attachment; image/file understanding is therefore not
preserved by this workaround. Other providers continue to receive non-text
parts unchanged. Other plugins and their files are not modified.
The final http.request hook additionally converts Responses
function_call_output.output arrays into strings for chat-brodda-it only.
This catches text parts appended by output truncation after execute.after,
and results replayed from existing chats. Call IDs and user attachments are
preserved; stored chat history is not changed. Other providers are untouched
by this HTTP fallback. This covers HTTP transport, not WebSocket frames.
OpenCode watches local plugin files and reloads them after changes. Use
/reload if necessary; a service restart is not required.
The plugin is registered in the user OpenCode configuration alongside the
existing Usage plugin. To disable this workaround, remove only the
C:\dev\projects\opencode-workspace\responses-output-plugin entry from the
plugins array in C:\Users\BroddaJa\.config\opencode\opencode.json and
use /reload if the change has not already been picked up automatically.
Run npm test in this directory for isolated tests. The live test used a
harmless PowerShell command producing separate stdout and stderr text parts;
the plugin collapsed those parts and the Responses call completed successfully.
Regression verification (2026-11-04): all 12 tests passed. A transient
session.generate request against the previously failing session returned
NORMALIZER_OK, with tools disabled by that API. The problematic historical
webfetch result had two text parts (51,151 and 136 characters), the latter
being the output-truncation notice.