Summary
When platform.enabled=true in agent.yaml, OpenAIChatServer's HTTP handler still uses the chat completions streaming path (astep_stream -> call_model_stream_raw), which calls /v1/chat/completions directly. It never calls step() or call_model_responses(), so platform mode has no effect on the HTTP serving path.
This means agents using OpenAIChatServer with platform mode get:
- 404 errors (OGX doesn't serve the same chat completions endpoint shape)
- No MCP tool routing (tools configured in
platform.mcp are never passed)
- No guardrail enforcement
Reproduction
# agent.yaml
platform:
enabled: true
endpoint: http://ogx-server:8321/v1
mcp:
- name: memoryhub
connector_id: memoryhub
# src/agent.py (step() is never called by the server)
class MyAgent(BaseAgent):
async def step(self) -> StepResult:
response = await self.call_model_responses(input=...)
return StepResult.done(result=response.content)
Start with OpenAIChatServer and send a POST to /v1/chat/completions. The server calls astep_stream -> call_model_stream_raw -> chat completions, ignoring platform mode entirely.
Workaround
Replace OpenAIChatServer with a thin FastAPI server that calls call_model_responses() directly and translates the result to chat completions format. Working example in memory-hub demos/ogx-memory.
Expected behavior
When platform.enabled=true, OpenAIChatServer should route through the Responses API path instead of chat completions. The instructions parameter should carry the assembled system prompt, and platform.mcp tools should be passed on every request.
Additional context
Also found that platform.endpoint needs to include /v1 because _require_platform() passes it directly to AsyncOpenAI(base_url=...). Without the suffix, the SDK hits /responses instead of /v1/responses. This should be documented or auto-appended.
Summary
When
platform.enabled=trueinagent.yaml,OpenAIChatServer's HTTP handler still uses the chat completions streaming path (astep_stream->call_model_stream_raw), which calls/v1/chat/completionsdirectly. It never callsstep()orcall_model_responses(), so platform mode has no effect on the HTTP serving path.This means agents using
OpenAIChatServerwith platform mode get:platform.mcpare never passed)Reproduction
Start with
OpenAIChatServerand send a POST to/v1/chat/completions. The server callsastep_stream->call_model_stream_raw-> chat completions, ignoring platform mode entirely.Workaround
Replace
OpenAIChatServerwith a thin FastAPI server that callscall_model_responses()directly and translates the result to chat completions format. Working example in memory-hub demos/ogx-memory.Expected behavior
When
platform.enabled=true,OpenAIChatServershould route through the Responses API path instead of chat completions. Theinstructionsparameter should carry the assembled system prompt, andplatform.mcptools should be passed on every request.Additional context
Also found that
platform.endpointneeds to include/v1because_require_platform()passes it directly toAsyncOpenAI(base_url=...). Without the suffix, the SDK hits/responsesinstead of/v1/responses. This should be documented or auto-appended.