The conversation history character count calculation is inaccurate
As noted in #1169 the calculate_char_count method on ConversationState is inaccurate since it is not being performed on the result of as_sendable_conversation_state, which is the actual conversation state being sent to the backend.
To facilitate an accurate character count calculation, we need to decouple our in-app representation of the conversation from the data being sent to the backend.
One approach would be to update as_sendable_conversation_state to be idempotent. Any code that already calls as_sendable_conversation_state would therefore not need to be updated.
After reviewing the current source, calculate_char_count in conversation.rs already calls backend_conversation_state (which is the equivalent of as_sendable_conversation_state) rather than computing the count on the raw in-memory state. This appears to have been addressed as part of the context tracking refactor. Can a maintainer confirm whether this can be closed?