#3587: fix(message): disable cross-context marker by default (#1782)
Cluster:
Cron Session Enhancements
## Summary
- Disable `[from #...]` prefix on cross-context messages by default
- Users who want the origin marker can set `tools.message.crossContext.marker.enabled: true`
- Updated docs and config schema to reflect new default
## Test plan
- [x] `pnpm lint` passes
- [x] `pnpm build` passes
- [x] `pnpm test` passes (4590/4590)
- [x] Updated test to explicitly enable marker when testing embed behavior
Rebased on latest main and resolved CHANGELOG.md conflict. Ready for review.
Closes #1782
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR changes cross-context message decoration so the visible origin marker (e.g., `[from …]`) is **disabled by default**, and must be explicitly enabled via `tools.message.crossContext.marker.enabled: true`. It updates the outbound decoration logic (`src/infra/outbound/outbound-policy.ts`) accordingly, adjusts the relevant test to opt in to the marker (`src/infra/outbound/outbound-policy.test.ts`), and updates config UI/schema help text plus the changelog to document the new default.
The change is localized to the outbound message pipeline: `message-action-runner.ts` calls `buildCrossContextDecoration`, which now returns `null` unless the marker is explicitly enabled, preventing the prefix/suffix or embeds from being applied on cross-context sends unless opted in.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is narrowly scoped to the cross-context decoration gate, flips the default as intended, and updates the associated test and config help text. No other call sites rely on the old default, and decoration is already optional (null-safe) in the outbound pipeline.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
**Context used:**
- 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))
<!-- /greptile_comment -->
Most Similar PRs
#22121: fix: resolve cross-context messaging policy from agent defaults
by AIflow-Labs · 2026-02-20
74.7%
#13318: fix(agents): prevent sanitizeUserFacingText from rewriting conversa...
by hleliofficiel · 2026-02-10
73.8%
#8175: fix: suppress raw API errors for non-owners
by Rakshi2609 · 2026-02-03
73.0%
#9511: feat: add tool error fallback toggle
by bolismauro · 2026-02-05
72.9%
#18997: fix: improve context overflow error messages and docs
by realhoratiobot · 2026-02-17
72.8%
#9829: Fix MCP transport reconnect and SSE header handling
by mabengda · 2026-02-05
72.6%
#7353: fix: prevent silent message drops after config.patch restart
by 18-RAJAT · 2026-02-02
72.6%
#15148: auto-reply: add message_time and compact inbound metadata JSON
by detecti1 · 2026-02-13
72.5%
#19917: feat(discord): allow disabling intermediate status reactions
by Gitjay11 · 2026-02-18
72.3%
#8742: fix(webchat): hide internal system messages from UI (#7440)
by revenuestack · 2026-02-04
72.2%