fix: resolve tech debt from PRs #226/#229 CR#235
Merged
Conversation
commit: |
923c96a to
d63e152
Compare
When match.message is absent, the config loader was falling back to /.*/ which silently matched every incoming request and could shadow other fixtures. Now skips message matching when no pattern is specified.
Check that input.messages is an array after JSON.parse, return 400 with clear error instead of confusing downstream 404. Fix aguiInput() test helper to include threadId, runId, and id on messages.
Accept optional logger parameter consistent with other functions. Handle non-Error throws instead of silently swallowing them.
Align drift test helper with the fixed version in providers.ts — normalize line endings, strip data: prefixes per line, and rejoin.
d63e152 to
38edd53
Compare
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.
Summary
Fixes 4 tech debt items identified during code review of PRs #226/#229:
match.message, the config loader was falling back to/.*/which matched every request. Now registers viaaddFixturewithout a message pattern so other criteria (toolCallId, toolName, stateKey) are honoured.input.messagesis an array when provided, returning 400 with a clear error instead of letting downstream code fail. Also fixed theaguiInput()test helper to includethreadId,runId, andidon messages matching the type definitions.console.warncalls inwriteAGUIEventStreamwith optionalloggerparameter (consistent with other functions in the file). Falls back toconsole.warnwhen no logger is provided. Added else branch for non-Error throws.parseDataOnlySSEin drift test helpers with the fixed version inproviders.ts— normalizes\r\nline endings and handles multi-line data blocks by strippingdata:prefixes and rejoining beforeJSON.parse.Test plan