Fix tool history hygiene on current main (integrates #36) - #39
Merged
Merged
Conversation
Integrate jt-wang's PR #36 (629debd). The original patch predates current gateway/native relay changes. Preserve its reused-call identity and Chat-to-Responses conversion work and tests, adapting them into the current shared pairing boundary. Flatten mixed dialects before identity, pairing and deduplication. Keep completed invocations distinct, coalesce identical pending copies, avoid alias collisions, and retain structured output and visible reasoning. Reject genuinely ambiguous pending calls instead of guessing their results. Test all routed normalizers and the Chat bridge from one history fixture. Replay a sanitized 1,659-item session plus eight mixed tool rounds through the built bundle, including Chat/Responses switching and compaction. Full Windows suite: 1141 passed, 7 skipped, 0 failed (1148 total). Live Go and Command Code probes were blocked by account quota limits; no successful live-provider inference is claimed. Original-PR: #36 Original-Commit: 629debd
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Origin and source drift
This integrates and supersedes the tool-history work proposed by @jt-wang in #36 (original commit
629debd2ea069f2964f2a418e3b13d88242ac006). The source had drifted by the time we reviewed it: current main has newer native relay APIs and a shared history normalization path. The original patch could not simply be merged unchanged.The integration commit retains the original author's identity, the two proposed helpers and the original regression cases. It adapts the implementation to current main and adds the boundaries discovered during review. Thank you @jt-wang for identifying and addressing the original history-loss problem.
Changes
Verification
npm test: 1,148 total; 1,141 passed, 7 skipped, 0 failed.CI must pass on this PR's exact head before merge. This PR does not include #38, a version bump or a deployment.