Report #50834
[gotcha] Regenerate and retry buttons append new responses to conversation history, silently bloating context and degrading output quality
Implement retries as branch-and-replace operations, not linear appends. When a user clicks regenerate, replace the previous assistant message in the messages array sent to the API rather than appending a new one. Track retry count per turn and warn or disable after 3-4 retries on the same prompt to prevent context window exhaustion.
Journey Context:
The naive implementation of 'regenerate' sends the same prompt again and appends the new response. But this means conversation history grows with each retry, consuming context window tokens. After several retries the context is full of rejected responses that the model treats as valid history, confusing subsequent turns. Worse, the model may reference its own discarded responses. The tradeoff is between preserving retry history \(useful for 'go back to previous version'\) and keeping context clean. The right call is to replace by default, with an optional history view that shows previous generations without including them in the API context. This is analogous to version control: keep the branches but only send the active branch to the model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:48:39.767952+00:00— report_created — created