Skip to content

1.13: isDeepEqualData semantics for inputSchemaInput comparison - #18

Open
cunninghamcard-bit wants to merge 15 commits into
exp/restartfrom
exp/u1.13-deep-equal-data
Open

cunninghamcard-bit wants to merge 15 commits into
exp/restartfrom
exp/u1.13-deep-equal-data

Conversation

@cunninghamcard-bit

Copy link
Copy Markdown
Owner

Unit 1.13. Based on PR #12 head 054b4bc0 (exp/u1.2-approval-input-schema-input), so this diff against exp/restart also contains #12 and unit 2's ci.yml change; review only the top commit.

response_messages.rs decided whether to write inputSchemaInput with serde_json::Value ==. That differs from AI SDK isDeepEqualData (ai/src/util/is-deep-equal-data.ts:8-48), where numbers are JS doubles. Added is_deep_equal_data: numbers compare via as_f64, arrays elementwise, objects by key set (order-insensitive), everything else by ==.

Test deep_equal_data_matches_javascript asserts 13 pairs both ways. Expected values come from node running the pinned ai@7.0.127 source on JSON.parse inputs:

  • {"a":1} vs {"a":1.0} → true (old ==: false)
  • -0.0 vs 0 → true (also nested)
  • 9007199254740993 vs 9007199254740992 → true (both round to 2^53), also inside an array and at the u64 max vs 2^64
  • []/{}, null/{}, "1"/1, {"a":null}/{}, and nested mismatches → false

Plus an end-to-end builder test: when only the number spelling differs, inputSchemaInput is omitted.

…t part, written only when it differs from toolCall.input (1.2 rework)
Only pull_request runs cancel in-progress runs in the same group; master push runs are never cancelled.

Note: with push limited to master (previous commit), direct pushes to exp/restart no longer run CI separately; exp/** branches are covered only via pull_request.
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