shelley: fix gitinfo messages incorrectly showing agent working

Philip Zeyliger created

phil: I increasingly think we should make the is-agent-working
state explicit and out of band with the messages (especially since
server restart can make it wrong), but haven't done that.

Prompt: after "diff-shortcuts now at bc5feb56" I get the "agent is
working" message, even though the turn is over. Fix that.

Gitinfo messages are created when the agent makes a commit. They always
happen at the end of a turn, so isEndOfTurn should return true for them.
This prevents the UI from incorrectly showing "agent is working" after
a gitinfo message is published.

Change summary

server/server.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

server/server.go 🔗

@@ -189,9 +189,9 @@ func isEndOfTurn(msg *generated.Message) bool {
 	if msg.Type == string(db.MessageTypeError) {
 		return true
 	}
-	// Gitinfo messages are metadata, not part of the agent turn - ignore them
+	// Gitinfo messages always come at end of turn (after a commit)
 	if msg.Type == string(db.MessageTypeGitInfo) {
-		return false
+		return true
 	}
 	// Only agent messages can have end_of_turn
 	if msg.Type != string(db.MessageTypeAgent) {