Skip to content

fix(proxy): handle Read argument snapshot deltas#217

Merged
unive3sal merged 1 commit into
mainfrom
fix/read-duplicate-start-buffer
May 29, 2026
Merged

fix(proxy): handle Read argument snapshot deltas#217
unive3sal merged 1 commit into
mainfrom
fix/read-duplicate-start-buffer

Conversation

@SaladDay
Copy link
Copy Markdown
Owner

@SaladDay SaladDay commented May 29, 2026

Summary

  • Fix Responses streaming fallback for Read tool arguments when response.function_call_arguments.done omits arguments.
  • Keep normal split JSON delta behavior by joining chunks, while supporting non-standard snapshot-style deltas by using the latest complete JSON object.
  • Preserve the existing Read.pages == "" sanitizer and avoid rewriting/clamping offset because the proxy does not have file context.

Refs #197

Verification

  • cargo fmt --manifest-path src-tauri/Cargo.toml -- --check
  • cargo test --manifest-path src-tauri/Cargo.toml read_tool_snapshot_argument_deltas_use_latest_complete_json
  • cargo test --manifest-path src-tauri/Cargo.toml read_tool_split_argument_deltas_are_still_joined
  • cargo test --manifest-path src-tauri/Cargo.toml read_tool_incomplete_argument_deltas_are_not_treated_as_snapshots
  • cargo test --manifest-path src-tauri/Cargo.toml read_tool_duplicate_start_preserves_buffered_arguments
  • cargo test --manifest-path src-tauri/Cargo.toml non_read_tool_empty_delta_still_uses_done_arguments
  • cargo test --manifest-path src-tauri/Cargo.toml read_tool_arguments_are_buffered_and_sanitized
  • git diff --check

@SaladDay SaladDay force-pushed the fix/read-duplicate-start-buffer branch from 975a5fc to be456ad Compare May 29, 2026 06:14
@SaladDay SaladDay changed the title test(proxy): cover duplicate Read response starts fix(proxy): handle Read argument snapshot deltas May 29, 2026
Buffer Read tool argument chunks as discrete deltas so normal split JSON still joins correctly, while non-standard providers that resend complete JSON snapshots fall back to the latest complete object when done.arguments is missing.\n\nRefs #197
@SaladDay SaladDay force-pushed the fix/read-duplicate-start-buffer branch from be456ad to baad825 Compare May 29, 2026 08:49
@SaladDay
Copy link
Copy Markdown
Owner Author

cc @unive3sal

@unive3sal unive3sal self-requested a review May 29, 2026 14:41
Copy link
Copy Markdown
Collaborator

@unive3sal unive3sal left a comment

Choose a reason for hiding this comment

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

LGTM

@unive3sal unive3sal merged commit 7f30e01 into main May 29, 2026
2 checks passed
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.

2 participants