fix(showcase/ms-agent-python): drop trailing slash on subpath HttpAgent URLs (#4959)
## Summary
- The `mcp-apps` and `voice-demo` HttpAgent URLs had a trailing slash
(`${AGENT_URL}/mcp-apps/`, `${AGENT_URL}/voice/`), but the FastAPI
backend in `agent_server.py` mounts those agents at `/mcp-apps` and
`/voice` exactly.
- Posting to the trailing-slash URL triggers FastAPI's default
`redirect_slashes` 307, which drops the SSE streaming body and surfaces
in the Next.js runtime as `RUN_ERROR: fetch failed (INCOMPLETE_STREAM)`
for every pill on the deployed showcase.
- Removing the trailing slash from both `HttpAgent({ url })`
constructors mirrors every other ms-agent-python subpath URL
(`/hitl-in-app`, `/headless-complete`, `/multimodal`, `/agent-config`,
…), all of which already work.
## Reproduction (live, against `showcase-ms-agent-python-production`)
```
$ curl -X POST -H 'Content-Type: application/json' -H 'Accept: text/event-stream' -d '{"method":"agent/run","params":{"agentId":"mcp-apps"},"body":{...}}' https://showcase-ms-agent-python-production.up.railway.app/api/copilotkit-mcp-apps
data: {"type":"RUN_ERROR","message":"fetch failed","code":"INCOMPLETE_STREAM"}
$ curl -X POST ... https://showcase-ms-agent-python-production.up.railway.app/api/copilotkit-voice/agent/voice-demo/run
data: {"type":"RUN_ERROR","message":"fetch failed","code":"INCOMPLETE_STREAM"}
```
The same `/api/copilotkit-mcp-apps` runtime called with `agentId:
"headless-complete"` (URL `/headless-complete`, no trailing slash)
returns a clean `RUN_FINISHED` stream — proving the trailing slash is
the only difference.
## Test plan
- [x] Reproduced live against deployed
`showcase-ms-agent-python-production`
- [x] `headless-complete` (no trailing slash, same runtime as mcp-apps)
confirmed working
- [ ] After Railway redeploy: click "Draw a flowchart" and "Sketch a
system diagram" pills on `/integrations/ms-agent-python/demos/mcp-apps`
and the iframe renders
- [ ] After Railway redeploy: voice demo sample-audio "What is the
weather in Tokyo?" returns an assistant reply A
Alem Tuzlak committed
2ea616e9b740bcc011f2123922c615c807968dfe
Committed by GitHub <noreply@github.com>
on 5/21/2026, 2:59:52 PM