Open
Conversation
Gemini has some issues with consistently generating the required schema, so accept a simpler schema too.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances command functionalities by adding intelligent test case suggestions, improving XML tag handling in streams, and expanding user option parsing.
- Added automated test case suggestions in observe-command with a new private method.
- Introduced utilities for replacing stream content and ensuring well-formed XML via closing tags.
- Updated schemas and improved type safety in the explain-command and user options modules.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/lib/closing-tags.spec.ts | Added comprehensive test cases for the XML closing tags utility. |
| src/lib/replace-stream.ts | Implemented asynchronous stream replacement for dynamic content replacement. |
| src/lib/parse-options.ts | Enhanced option parsing to accept both Maps and Records with consistent key formatting. |
| src/lib/closing-tags.ts | Introduced utility to detect unclosed XML tags and generate appropriate closing tags. |
| src/interaction-history.ts | Added a clone method for creating shallow copies of interaction history. |
| src/commands/observe-command.ts | Improved observe-command functionality with test suggestion logic and adjusted messaging. |
| src/commands/explain-command.ts | Adjusted service dependency types to enhance flexibility and type safety. |
Other improvements: - enhance UserOptions constructor to accept both Map and object formats; - add clone method to InteractionHistory; - implement closingTags function for unclosed XML tags; - introduce replaceStream for async string replacement in streams; - update ExplainCommand to handle optional classifierService.
dafa9e0 to
cae623f
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.
This pull request introduces enhancements to the
observe-commandandexplain-commandfunctionality, focusing on improved test case suggestions, handling of unclosed XML tags, and better flexibility in user options. It also includes utility additions and test coverage for new functionality.Enhancements to
observe-command:[[1]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR160-R162),[[2]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR193-R270),[[3]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cL189-R296),[[4]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cL225-R332))suggestTestCaseto handle the generation of test case suggestions usingExplainCommand. ([packages/navie/src/commands/observe-command.tsR193-R270](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR193-R270))RelevantTestschema to support nullable and transformed fields, and added asuggestedTestfield for test case suggestions. ([[1]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR3-R60),[[2]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR72-R80))Enhancements to
explain-command:classifierServiceoptional and restrictedagentSelectionServiceto specific properties, improving flexibility and type safety. ([[1]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-8fc64b3b138b643930110c42f044e061bdc178fb607f1fbcf34bd30b7b13e95cL37-R41),[[2]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-8fc64b3b138b643930110c42f044e061bdc178fb607f1fbcf34bd30b7b13e95cL55-R58))Utility additions:
closingTagsfunction to detect and append missing XML closing tags, ensuring well-formed output. ([packages/navie/src/lib/closing-tags.tsR1-R33](https://github.com/getappmap/appmap-js/pull/2282/files#diff-192232aef104a6ceddd59ee60925fa896ff165740e45f82e81195e1232e91412R1-R33))replaceStreamutility to replace specific patterns in a stream with asynchronous replacements. ([packages/navie/src/lib/replace-stream.tsR1-R35](https://github.com/getappmap/appmap-js/pull/2282/files#diff-103e6121f36f41a08a0e12704ff43d2930a244b4b4e63d77f5a84bb23dbf5e01R1-R35))Improvements to
InteractionHistory:clonemethod to create shallow copies of interaction history for isolated modifications. ([packages/navie/src/interaction-history.tsR319-R333](https://github.com/getappmap/appmap-js/pull/2282/files#diff-ed85c6d6714ad90002f856d93a39906e6cbd3135d24e1b4bb445c8360a9df27cR319-R333))Test coverage:
closingTagsutility to validate its behavior with various tag scenarios. ([packages/navie/test/lib/closing-tags.spec.tsR1-R35](https://github.com/getappmap/appmap-js/pull/2282/files#diff-6e1aad13709c90f0f865d6437be1b34d8931838f059ea792158b095afc9e2c26R1-R35))