fix: restore aiSummaryState module and fix test infrastructure broken by hotfix#21
Closed
abdushakoor12 wants to merge 3 commits into
Closed
fix: restore aiSummaryState module and fix test infrastructure broken by hotfix#21abdushakoor12 wants to merge 3 commits into
abdushakoor12 wants to merge 3 commits into
Conversation
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.
TLDR
Restores the deleted
aiSummaryStatemodule and fixes the summary orchestration so the hotfix's disabled-by-default flag is properly testable andinitAiSummariesalways sets the VS Code context key.Details
What was added:
src/aiSummaryState.ts— new module holdingaiSummaryRuntime.temporarilyDisabled(defaults totrue, keeping AI summaries off). ExportsaiSummariesTemporarilyDisabled()andsetAiSummariesTemporarilyDisabledForTests()so tests can exercise both enabled and disabled paths without changing production behaviour.src/test/e2e/summaryOrchestration.e2e.test.ts— TypeScript source for the test file that existed only as a stale compiled artifact inout/after the hotfix deleted the original source.What was changed:
summaryOrchestration.ts—aiSummariesEnabled()now checksaiSummariesTemporarilyDisabled()first instead of hardcodingreturn false.initAiSummaries()now always callssetContext("commandtree.aiSummariesEnabled", enabled)— even when disabled — so the VS Code context key is always set to the correct value.coverage-thresholds.json— thresholds updated to match the new coverage measurements after new files were added.How Do The Automated Tests Prove It Works?
The previously failing E2E test "syncAndSummarise registers commands and summarises when enabled" now passes: it calls
setAiSummariesTemporarilyDisabledForTests(false)to enable summaries, runssyncAndSummarise, and assertssummarised === 1— which only passes ifaiSummariesEnabled()correctly reads the flag rather than hardcodingfalse.The new test "initAiSummaries sets the disabled context without starting summarisation" passes: it runs
initAiSummarieswith the flag at its default (temporarilyDisabled = true) and asserts that exactly onesetContext("commandtree.aiSummariesEnabled", false)call is made with no summarisation triggered.All 118 unit tests and 377 E2E tests pass.