Description
The OpenAI shim might inject synthetic [Tool results received] markers or similar protocol text that reaches the model as assistant content, which can corrupt the model's generation context.
Environment
- OS: Any
- Node version: Node 22+
- Nanocoder version: 1.29.0
- Provider: OpenAI-compatible API
- Model: Any
Steps to Reproduce
- Connect via OpenAI-compatible provider.
- Trigger a tool call and examine the raw payload sent back to the model in subsequent turns.
- Observe synthetic protocol text.
Expected Behavior
The shim should format tool results strictly according to the API spec without injecting synthetic markdown/text that the model interprets as its own past output.
Actual Behavior
Synthetic markers are potentially being injected into the context window.
Logs/Screenshots
N/A
Additional Context
Description
The OpenAI shim might inject synthetic
[Tool results received]markers or similar protocol text that reaches the model asassistantcontent, which can corrupt the model's generation context.Environment
Steps to Reproduce
Expected Behavior
The shim should format tool results strictly according to the API spec without injecting synthetic markdown/text that the model interprets as its own past output.
Actual Behavior
Synthetic markers are potentially being injected into the context window.
Logs/Screenshots
N/A
Additional Context