Repository navigation
Conversation
Contributor
Author
|
Superseded by #63, which includes this change or replaces it. |
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.
Fixes #36.
Sessions.AddMessageandAddFullMessagereturned nothing.JSONLBackendhanded the store's error to the standard library'slog.Printf, which goes to stderr and not to gateway.log. The turn then went on as if the message were saved. A full disk or a permission problem could keep a message out of<workspace>/sessions/<key>.jsonl. It was then missing from the next turn's context, and from the chat when reopened, with no sign of why.Now:
session.SessionStore'sAddMessageandAddFullMessagereturn the store's error (JSONLBackend). The sub-turns' in-memory store returns nil. The interface's doc no longer callsAdd*fire-and-forget.turnState.noteSessionWrite. That covers the user message, tool calls and their results, denied and skipped calls, steering messages, and the reply.agent.errorwith stagesession_save, as a failedSavedoes.JSONLBackend's other failures (summary, history, truncation, metadata) are logged through Compa's logger instead oflog.Printf.A failed
Savestill fails the turn, as before.For Go embedders, this changes an exported interface: a type that implements
session.SessionStoremust return an error fromAddMessageandAddFullMessage. CHANGELOG lines under Changed and Fixed. No doc describes the session store.Tests:
TestRunTurn_SessionAppendErrorIsReportedOnceruns a turn whose user message and reply both fail to append. It checks that the reply still comes, with onesession_saveerror and one notice naming the error. It fails when the failure isn't reported, and when it's reported for each message.TestJSONLBackend_AddReturnsTheStoreErrorfails when the backend drops the error.