Skip to content

fix: guard against auxiliary message_complete clearing turn state#23049

Merged
siddseethepalli merged 1 commit into
mainfrom
do/fix-aux-message-complete-guard
Apr 2, 2026
Merged

fix: guard against auxiliary message_complete clearing turn state#23049
siddseethepalli merged 1 commit into
mainfrom
do/fix-aux-message-complete-guard

Conversation

@siddseethepalli
Copy link
Copy Markdown
Contributor

@siddseethepalli siddseethepalli commented Apr 2, 2026

Summary

  • Add early return in handleMessageComplete when messageId is nil and isSending is true
  • Prevents auxiliary message_complete events (watch notifiers, call notifications) from prematurely clearing currentAssistantMessageId mid-stream
  • Fixes the LLM Context Inspector showing 0 calls until app restart when watch handlers fire during active streaming

Original prompt

these 2 PRs

🤖 Generated with Claude Code


Open with Devin

Non-persisted message_complete events (call transcript, call completion) arrive
without messageId and would still clear currentAssistantMessageId on the client,
corrupting the main agent loop's daemonMessageId backfill. Skip the full turn-reset
logic when message_complete lacks messageId while the main agent loop is active.

This is the client-side defensive counterpart to the backend fix that threads
messageId through persisted notifier events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@siddseethepalli siddseethepalli merged commit f97ad8a into main Apr 2, 2026
@siddseethepalli siddseethepalli deleted the do/fix-aux-message-complete-guard branch April 2, 2026 01:11
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f76a93935

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread clients/shared/Features/Chat/ChatActionHandler.swift
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread clients/shared/Features/Chat/ChatActionHandler.swift
Comment thread clients/shared/Features/Chat/ChatActionHandler.swift
@siddseethepalli
Copy link
Copy Markdown
Contributor Author

Addressed in #23075

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant