#9829: Fix MCP transport reconnect and SSE header handling
docs
stale
Cluster:
Security Enhancements and Fixes
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
#15852: fix: pass agentId when resolving IRC session paths
by MisterGuy420 · 2026-02-14
82.7%
#7892: Claude/setup agent firewall ww xsv
by starwreckntx · 2026-02-03
81.6%
#11743: fix: remove redundant file reads from AGENTS.md template
by shogunsea · 2026-02-08
81.6%
#19560: docs: refactor agent workspace default location & bootstrap configu...
by ashinkuniyil · 2026-02-17
79.7%
#13833: Cursor/cloud agent 1770777372587 3zom0
by zhch158 · 2026-02-11
79.5%
#7252: docs: align config examples and tool docs with current runtime
by nice-and-precise · 2026-02-02
79.5%
#16362: Update session-pruning.md - updated agents.defaults config std
by elliottb · 2026-02-14
78.5%
#8175: fix: suppress raw API errors for non-owners
by Rakshi2609 · 2026-02-03
78.2%
#12974: fix: intermittent (no output) reported by users
by vincentkoc · 2026-02-10
78.1%
#7127: fix(webchat): add regenerate flag to prevent context leak on response…
by craihub · 2026-02-02
78.1%