Skip to content

Conversation

@processtrader
Copy link
Contributor

Summary

  • Fix empty "Modified Files" sidebar when using certain LLM providers (e.g., GLM-4.6 via models.dev)

Problem

The start-step event from the AI SDK fires at different times depending on the provider:

  • Anthropic: fires before tool execution → correct "before" snapshot
  • Some providers (GLM-4.6, etc.): fires after tool execution has begun → snapshot captures "after" state
    This caused step-start and step-finish snapshots to have identical hashes, resulting in empty diffs in the Modified Files sidebar.

Solution

Take the snapshot before the stream starts instead of waiting for the start-step event. This ensures we always capture the true "before" state regardless of provider timing.

Testing

Tested with:

  • GLM-4.6 via models.dev (zai-coding-plan) - previously broken, now working
  • Anthropic Haiku 4.5 - still working correctly

Before the change, 'Modified Files' was not present:

image

After the change updates to the file were tracked well coming from GLM and Haiku

image

… providers

Some providers emit the start-step event after tool execution has already
begun, causing step-start and step-finish to have identical snapshots.
This results in empty diffs and missing Modified Files in the UI.

By taking the initial snapshot before the stream starts, we ensure we
always capture the true 'before' state regardless of provider timing.
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