fix: resolve commitInFlight 404 bug and assistant role data loss#1167
Open
Boes-man wants to merge 1 commit intovolcengine:mainfrom
Open
fix: resolve commitInFlight 404 bug and assistant role data loss#1167Boes-man wants to merge 1 commit intovolcengine:mainfrom
Boes-man wants to merge 1 commit intovolcengine:mainfrom
Conversation
Fix volcengine#1: commitInFlight not cleared on 404 - In pollCommitTaskOnce(), when task not found (404/expired), clear commit state so new commits can proceed - Previously, auto-commit would silently stop working for the session Fix volcengine#2: assistant role conditional on finish='stop' causes data loss - Assistant message roles now stored regardless of finish value - Previously, assistant messages with tool calls (finish='tool_calls') had their content captured but role never stored, causing messages to be orphaned in pendingMessages and never flushed to OV server Both fixes address critical bugs affecting session memory integrity.
|
d_n_w seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Failed to generate code suggestions for PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two critical bugs in the OpenCode memory plugin that affect session memory integrity.
Fix #1: commitInFlight not cleared on 404
Issue: When
pollCommitTaskOnce()receives a 404 response (commit task not found), the error is caught butcommitInFlightis never cleared. This causes auto-commit to stop working permanently for the session.Fix: Added 404/expired task detection in the catch block to clear commit state via
clearCommitState(mapping)so new commits can proceed normally.Fix #2: Assistant role conditional on finish='stop' causes data loss
Issue: Assistant message roles were only stored when
finish === "stop". However, assistant messages with tool calls complete with other finish types (e.g., "tool_calls"). This caused content to be captured inpendingMessagesbut never flushed to the OpenViking server becauseflushPendingMessages()requires both content AND role.Fix: Removed the
finish === "stop"condition - assistant roles are now stored regardless of finish value. Added logging for non-stop finish values for debugging.Impact
Testing
Both fixes have been tested in a live OpenCode environment with OpenViking. The session-map.json showed 15-16 orphaned pendingMessages which were cleared after applying fix #2.