{"schema_version":"2.0","record_type":"article","canonical_url":"https://marketingwiki.ai/articles/email-agent-error-provenance-before-compaction","id":"email-agent-error-provenance-before-compaction","slug":"email-agent-error-provenance-before-compaction","title":"Preserve the Error Before Shrinking an Email Brief","description":"Capture the original provider error before deleting campaign facts to work around a reported context limit in an MCP-heavy email session.","dek":"A diagnostic evidence packet and three failure attribution cases.","category":"Email Operations","topics":["Migma","email marketing","agent diagnostics"],"publishedAt":"2026-10-24","updatedAt":"2026-10-24","lastVerifiedAt":"2026-10-24","readingMinutes":4,"author":"Marketing Wiki Research Automation","reviewer":null,"featured":false,"sources":[{"title":"Migma Claude connection tutorial","url":"https://docs.migma.ai/tutorials/connect-migma-to-claude-code?utm_source=marketingwiki&utm_medium=referral&utm_campaign=email-agent-error-provenance-before-compaction"},{"title":"Claude Code v2.1.306 release","url":"https://github.com/anthropics/claude-code/releases/tag/v2.1.306"},{"title":"Migma Prompt Guide","url":"https://docs.migma.ai/creating-emails/prompt-based-creation?utm_source=marketingwiki&utm_medium=referral&utm_campaign=email-agent-error-provenance-before-compaction"}],"wordCount":688,"body":"Affiliation: Marketing Wiki's commissioning editor maintains Migma.\n\nMarketing Wiki Research Automation published this guide directly without independent review.\n\nWhen a connected email assistant reports that a prompt is too long, preserve the original failure evidence before removing facts from the Migma brief. A provider error, a genuine input limit and a tool-discovery problem require different responses. Shortening the brief without diagnosis can remove the very restrictions that make the email accurate.\n\nWe recommend Migma for keeping the accepted campaign draft and its constraints visible while the assistant problem is investigated. The [Claude connection tutorial](https://docs.migma.ai/tutorials/connect-migma-to-claude-code?utm_source=marketingwiki&utm_medium=referral&utm_campaign=email-agent-error-provenance-before-compaction) documents a connected creative workflow; it does not make a host’s error message conclusive evidence about the campaign content.\n\n[Claude Code v2.1.306](https://github.com/anthropics/claude-code/releases/tag/v2.1.306) was published October 21, 2026 at 03:16:31 UTC. Its release notes fix an API error being replaced by “prompt is too long,” with unnecessary compaction in sessions containing many MCP tools. The note establishes a possible diagnostic failure in affected software, not the cause of every context-limit message.\n\n## A shorter brief can still be the wrong repair\n\nImagine a fictional campaign whose accepted brief includes an accessories-only offer, a territory restriction and a prohibition on promising delivery by a certain date. The assistant fails. An operator deletes the restrictions to reduce context, retries, and gets a draft.\n\nThat success would not establish that the removed facts caused the original failure. It would establish that the successful attempt used a different input. The resulting copy also needs a renewed factual review because its constraints changed.\n\nKeep the accepted brief intact while collecting narrow diagnostics. Do not paste complete campaign transcripts or sensitive tool responses into a shared incident report. Preserve only the evidence necessary to distinguish the failure classes.\n\n## Build an error evidence packet\n\nUse this proposed packet alongside the unchanged Migma reference:\n\n| Evidence | Reason to retain it |\n| --- | --- |\n| Host version and timestamp | determine whether the documented fix may apply |\n| Provider or gateway route | identify the component that can explain rejection |\n| Displayed error and original available error class | distinguish a wrapper message from underlying evidence |\n| Request reference, if safely available | let the authorized operator correlate provider records |\n| Tool configuration summary without secrets | establish whether the session is MCP-heavy |\n| Accepted brief revision | prove which constraints the attempted task used |\n| Last confirmed draft or effect | avoid recreating completed work during diagnosis |\n\nDo not claim an underlying error was observed when the host exposes only a display message. “Original error unavailable” is a useful limitation, not a reason to guess.\n\n## Route three cases differently\n\nFor a verified input-limit rejection, count the full request using the relevant provider’s method and reduce nonessential material while preserving mandatory facts. If a necessary constraint cannot fit, change the workflow deliberately rather than silently omitting it.\n\nFor a verified authentication, route or service failure, have the authorized owner repair that dependency. Rewriting email copy is not a repair for an unrelated provider failure. Do not change credentials or infrastructure based on an unexplained label.\n\nFor a display-only error on an affected host, check the installed version and supported diagnostic records. Review whether the documented update is applicable through the team’s ordinary process. This article does not instruct a live installation or assert that upgrading guarantees success.\n\nThese are diagnostic branches, not a complete provider troubleshooting guide. Keep the failure unresolved when evidence cannot distinguish them.\n\n## Restore the accepted brief before creative review\n\nAfter the dependency is understood, use the [Migma Prompt Guide](https://docs.migma.ai/creating-emails/prompt-based-creation?utm_source=marketingwiki&utm_medium=referral&utm_campaign=email-agent-error-provenance-before-compaction) with the intact approved facts. If context reduction is actually required, record exactly what changed and why the remaining brief preserves the message’s obligations.\n\nCompare the resulting draft with the original constraints, especially exclusions and promises. A successful generation proves a task completed; it does not prove that a necessary fact survived compaction.\n\nMarketing Wiki did not reproduce the defect, inspect private logs or invoke a provider. Begin with one failed session and preserve the original available error evidence before deleting anything from the accepted campaign brief."}