ADORSYS-GIS / ADORSYS-GIS/ai-helm
[Epic]: Track AIEG #2218 — remove the refero Content-Type workaround when fixed
- Dominant language
- Go Template
- Stars
- 3
- Forks
- 1
- Avg merge
- 19h 24m
- Merged PRs (30d)
- 80
Description
### Executive Summary
Track upstream bug **[envoyproxy/ai-gateway#2218](https://github.com/envoyproxy/ai-gateway/issues/2218)** and, when it is fixed and we upgrade AIEG past the fix, **remove the refero `Content-Type` workaround** we added in [ADR-0040](docs/adr/0040-external-mcps-via-caddy-normalizing-proxy.md). This epic is a watch-and-apply tracker; it should be closed when the workaround is gone.
### Strategic Intent
Keep our MCP gateway lean and free of carried workarounds. The refero rewrite is a deliberate, documented stopgap for an AIEG mcpproxy bug; once upstream fixes it, the rewrite is dead weight that masks a real regression signal and should be retired promptly.
### Problem Statement
AIEG's mcpproxy parses an upstream response strictly as SSE when `Content-Type: text/event-stream`, even when the body is plain JSON (no `data:` events) — yielding an **empty `tools/list`** (#2218). refero mislabels its JSON `tools/list` as `text/event-stream`, so its tools came back empty through the gateway. ADR-0040 works around this: refero's Caddy normalizing proxy rewrites the response `Content-Type → application/json` (`charts/mcps` `refero.mcp.proxy.rewriteResponseContentType`). The workaround is fragile — if refero ever emits *real* SSE, forcing `application/json` would break it.
### Desired Outcome
- #2218 is fixed upstream and the fix is in our deployed AIEG version, **AND**
- `refero.mcp.proxy.rewriteResponseContentType` is removed from `charts/mcps/values.yaml`, **AND**
- refero `tools/list` still returns its 8 tools through the gateway without the rewrite (verified live), **AND**
- the ADR-0040 / `charts/mcp` `rewriteResponseContentType` field can be dropped or left dormant (no other MCP uses it).
### Scope (In / Out)
**In:** watching #2218; the AIEG version bump that contains the fix; removing the refero `rewriteResponseContentType`; re-verifying refero end-to-end.
**Out:** any other AIEG/MCP work; the `context7_api_key` population (separate follow-up); firecrawl (works at the gateway — its opencode failures are client-side, not in scope here).
### Source of truth (links)
- Upstream bug: **https://github.com/envoyproxy/ai-gateway/issues/2218** (the trigger — apply when its status → fixed/closed).
- Our solution: [ADR-0040](docs/adr/0040-external-mcps-via-caddy-normalizing-proxy.md) + [`docs/2026-06-10-mcp-external-server-proxy-debug.md`](docs/2026-06-10-mcp-external-server-proxy-debug.md).
- The workaround in code: `charts/mcps/values.yaml` (refero `proxy.rewriteResponseContentType: application/json`); the field lives in `charts/mcp/values.yaml`.
### Stakeholders
- Accountable: @stephane-segning. Consumers: anyone using the refero MCP via `api.ai.camer.digital/mcp/refero`.
### Key Assumptions
- #2218 will be fixed by adding a JSON fallback when an `text/event-stream` response has no SSE events (the requested behaviour), so removing our rewrite will be sufficient.
- No other external MCP needs the rewrite (context7/firecrawl emit real SSE; verified).
### Constraints
- Helm-only repo; tag-based deploys (`tools/release.sh`) + the home-os `charts/cd` root repoint. AIEG is pinned in `charts/apps` (`aieg` + `aieg-crd`, lockstep) — the fix arrives via an AIEG version bump.
### Risks
- Removing the rewrite before the fix is actually in the deployed AIEG version → refero empty tools again (mitigate: verify the running AIEG image contains the #2218 fix, then re-test refero live before/after removal).
- #2218 may be fixed differently (e.g. requiring the upstream to fix its content-type) → re-evaluate; the rewrite may need to stay until refero's server is fixed.
### Success metrics
- refero returns 8 tools through the gateway with **no** `rewriteResponseContentType` set, on the deployed AIEG version.
- The workaround field is removed from `charts/mcps` (and optionally `charts/mcp`).
### Child User Stories
- [ ] Bump AIEG to the version containing the #2218 fix (`charts/apps` `aieg`/`aieg-crd`, lockstep; re-run the v0.7→vNEXT compat audit).
- [ ] Remove `refero.mcp.proxy.rewriteResponseContentType` from `charts/mcps/values.yaml`; cut a release + repoint root.
- [ ] Verify refero `tools/list` → 8 tools end-to-end without the rewrite; update ADR-0040 follow-ups + CLAUDE.md/memory notes.
### Human accountable owner
@stephane-segning
### AI Usage Declaration
Research, Ticket decomposition, Drafting (the diagnosis + this tracker were AI-assisted; the upstream bug, the workaround, and the live validation are real and verified).
### Human verification completed
- [ ] Intent checked against source of truth
- [ ] Scope reviewed by Product Owner
- [ ] Technical feasibility reviewed by Technical Lead
- [ ] Risks reviewed
- [ ] Acceptance criteria reviewed
- [ ] No unverified AI claim remains
- [ ] I am the accountable owner and accept responsibility for this epic.
Contributor guide
Assessment
This issue has not been assessed yet.