← Back to PRs

#9829: Fix MCP transport reconnect and SSE header handling

by mabengda open 2026-02-05 18:41 View on GitHub →
docs stale
Fixes double-connect errors by closing existing transport before reconnect; lets StreamableHTTPServerTransport own SSE headers; guards error paths with headersSent/writableEnded checks to avoid double headers. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the workspace `docs/reference/templates/AGENTS.md` template, changing baseline agent safety/privacy guidance, “ask-first” boundaries, and group-chat behavior guidance. Several edits appear to regress safety constraints by removing explicit non-exfiltration language, encouraging broader access to user data, and loosening “ask first” triggers. Since this file is a template intended to be copied into workspaces, these changes can materially alter downstream agent behavior and should be tightened before merge. <h3>Confidence Score: 2/5</h3> - Not safe to merge as-is due to safety/privacy guidance regressions in a widely used agent template. - The change set is small and easy to reason about, but it removes and weakens key guardrails (no-exfiltration, ask-first for external actions/uncertainty) and adds instructions encouraging broader access to user data; those are behavior-changing and likely unintended for a safety template. - docs/reference/templates/AGENTS.md <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <details><summary><h4>Context used (3)</h4></summary> - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) - Context from `dashboard` - docs/reference/templates/AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=ef691cbd-a005-4c3e-998b-6fcd72f2d312)) </details> <!-- /greptile_comment -->

Most Similar PRs