Skip to content

fix: restore aiSummaryState module and fix test infrastructure broken by hotfix#21

Closed
abdushakoor12 wants to merge 3 commits into
Nimblesite:mainfrom
abdushakoor12:disable-ai-summaries
Closed

fix: restore aiSummaryState module and fix test infrastructure broken by hotfix#21
abdushakoor12 wants to merge 3 commits into
Nimblesite:mainfrom
abdushakoor12:disable-ai-summaries

Conversation

@abdushakoor12
Copy link
Copy Markdown
Contributor

TLDR

Restores the deleted aiSummaryState module and fixes the summary orchestration so the hotfix's disabled-by-default flag is properly testable and initAiSummaries always sets the VS Code context key.

Details

What was added:

  • src/aiSummaryState.ts — new module holding aiSummaryRuntime.temporarilyDisabled (defaults to true, keeping AI summaries off). Exports aiSummariesTemporarilyDisabled() and setAiSummariesTemporarilyDisabledForTests() 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 in out/ after the hotfix deleted the original source.

What was changed:

  • summaryOrchestration.tsaiSummariesEnabled() now checks aiSummariesTemporarilyDisabled() first instead of hardcoding return false. initAiSummaries() now always calls setContext("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, runs syncAndSummarise, and asserts summarised === 1 — which only passes if aiSummariesEnabled() correctly reads the flag rather than hardcoding false.

The new test "initAiSummaries sets the disabled context without starting summarisation" passes: it runs initAiSummaries with the flag at its default (temporarilyDisabled = true) and asserts that exactly one setContext("commandtree.aiSummariesEnabled", false) call is made with no summarisation triggered.

All 118 unit tests and 377 E2E tests pass.

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