-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Labels
bugSomething isn't workingSomething isn't workingpriority:mediumFor bugs, a serious source of annoyance, but not blocking a large number of users.For bugs, a serious source of annoyance, but not blocking a large number of users.
Description
Summary
When we encounter a malformed message error from the language model, we should fall back to condensing the entire trajectory into a single message, similarly to how Claude Code does it.
Background
This approach was discussed as a way to handle edge cases in condensation. Currently, when we hit malformed message errors, we don't have a robust fallback mechanism. Claude Code's approach of condensing everything into a single message could help avoid some of the edge cases we've been trying to fix (e.g., mixture of thinking blocks, wrong order of action-observation event pairs).
Proposed Solution
Implement a fallback mechanism that:
- Detects malformed message errors from the language model
- Falls back to condensing the entire trajectory into a single comprehensive message (similar to Claude Code's approach)
- Keeps the existing condensation approach as the default, using this only as a fallback
Additional Context
- This should be a fallback strategy, not the default behavior
- We want to keep the option to not condense everything from scratch, as starting from scratch has a fairly high likelihood of confusing the agent (especially with open-source models)
- The existing condensation approach should remain the primary method, with this as a safety net for error cases
Related Discussion
See: #1518 (comment)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority:mediumFor bugs, a serious source of annoyance, but not blocking a large number of users.For bugs, a serious source of annoyance, but not blocking a large number of users.