Skip to content

Add TOOM output option for MCP text responses#1704

Merged
nmaguiar merged 3 commits intot8from
codex/modify-replymcp-to-use-af.totoom-conditionally
Feb 22, 2026
Merged

Add TOOM output option for MCP text responses#1704
nmaguiar merged 3 commits intot8from
codex/modify-replymcp-to-use-af.totoom-conditionally

Conversation

@nmaguiar
Copy link
Collaborator

@nmaguiar nmaguiar commented Feb 22, 2026

Motivation

  • Allow MCP text output assembly to optionally use af.toTOOM(result) when __flags.MCPSERVER.answerInTOOM === true while keeping the current stringify(result) behavior as the default.

Description

  • Introduced a small helper _mcpResultToText to choose between stringify(result) and af.toTOOM(result) based on __flags.MCPSERVER.answerInTOOM in mcpStdio and a2a.send.
  • Replaced inline stringify(result) fallbacks for non-string tool outputs inside mcpStdio with _mcpResultToText while preserving direct string passthrough.
  • Updated A2A send normalization so non-map handler results and missing-content cases use _mcpResultToText to produce MCP content text.

Testing

  • Ran a whitespace/diff check with git diff --check and it passed.
  • Inspected the produced patch with git diff -- js/owrap.server.js to verify the intended replacements and locations, and verified occurrences with rg searches; all expected changes are present.

@nmaguiar nmaguiar self-assigned this Feb 22, 2026
- Add MCPSERVER flag  to control output format
- Update  and  to use  when flag is true
- Remove legacy  usage
@nmaguiar nmaguiar marked this pull request as ready for review February 22, 2026 22:55
- Updated the MCPSERVER flag name for consistency.
- Adjusted all references in openaf.js and owrap.server.js.
- Ensures future code uses the correct flag name.
@nmaguiar nmaguiar merged commit 1406873 into t8 Feb 22, 2026
1 check passed
@nmaguiar nmaguiar deleted the codex/modify-replymcp-to-use-af.totoom-conditionally branch February 22, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant