Skip to content

test(desktop): fix ambient failing electron/vitest suites (extensionless TS imports) - #62398

Closed
Kyzcreig wants to merge 1 commit into
NousResearch:mainfrom
ANG-Ventures:fix/desktop-electron-test-suite-upstream
Closed

test(desktop): fix ambient failing electron/vitest suites (extensionless TS imports)#62398
Kyzcreig wants to merge 1 commit into
NousResearch:mainfrom
ANG-Ventures:fix/desktop-electron-test-suite-upstream

Conversation

@Kyzcreig

@Kyzcreig Kyzcreig commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Problem

The desktop Electron node --test suites fail on current main with ERR_MODULE_NOT_FOUND on extensionless relative TypeScript imports (for example, import { … } from './zoom').

Fix

  • Add explicit .ts extensions to relative imports in Electron sources and tests.
  • Set rewriteRelativeImportExtensions: true in tsconfig.electron.json (rather than allowImportingTsExtensions, which conflicts with composite emit under TS5096).
  • Repair the jsdom harness and packaging-script test drift needed for the ambient desktop suites to run cleanly.

Fresh verification after rebasing onto 095b9eed3

  • npm --prefix apps/desktop run test:desktop:platforms320 passed, 1 skipped, 0 failed.
  • npx vitest run --environment jsdom --exclude src/store/panes.test.ts1,229 passed, 0 failed.
  • npm --prefix apps/desktop run typecheck → passed.
  • Focused ESLint on the two post-rebase touched files → 0 errors.
  • Full Vitest currently has one unrelated failure in src/store/panes.test.ts; the identical test also fails on clean upstream 095b9eed3 (13 passed, 1 failed), so it is not introduced by this PR.

Test/config-only change; no runtime behavior is changed.

@alt-glitch alt-glitch added type/test Test coverage or test infrastructure P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) labels Jul 11, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for isolating the direct-Node TypeScript import issue. The premise is present on current main: apps/desktop/package.json:40 runs .ts tests through node --test, while apps/desktop/electron/zoom.test.ts:10 and its siblings use extensionless relative imports.

Problems

  • apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx removes regression coverage unrelated to the test-runner repair: multiline slash dispatch, draft restoration, memory-graph aliases, selected-session resume, and timeout recovery. Those behaviors remain implemented in submit.ts:217-247 and submit.ts:289-309; please preserve their tests rather than simplifying the Harness by dropping those cases.

Suggested changes

  • Restore the removed cases and keep the Harness inputs needed to exercise them. The .ts import changes and rewriteRelativeImportExtensions configuration can be salvaged independently.

Automated hermes-sweeper review.

@@ -54,30 +55,22 @@ function Harness({
busyRef,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please retain the Harness inputs instead of deleting the selected-session, timeout-recovery, slash-payload, and memory-graph regression cases. Current production code still relies on the selected-session resume path (submit.ts:217-247) and timeout retry path (submit.ts:289-309); neither is related to the extensionless-import repair.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 11, 2026
@Kyzcreig
Kyzcreig force-pushed the fix/desktop-electron-test-suite-upstream branch 2 times, most recently from 0a02a4c to bdf95bd Compare July 12, 2026 08:45
The electron node:test suites failed with ERR_MODULE_NOT_FOUND on
extensionless relative TS imports (`from './zoom'`); add explicit .ts
extensions + rewriteRelativeImportExtensions in tsconfig.electron.json
(not allowImportingTsExtensions, which conflicts with composite emit,
TS5096). Also fixes jsdom harness setup + packaging-script test drift.
node --test: 320 pass / 0 fail on this base.
@Kyzcreig
Kyzcreig force-pushed the fix/desktop-electron-test-suite-upstream branch from bdf95bd to 4bb7e3b Compare July 12, 2026 09:51
@Kyzcreig

Copy link
Copy Markdown
Contributor Author

Closing — this repairs an ambient suite state the tree is no longer in.

The extensionless-TS-import failure mode this targets isn't current: apps/desktop/tsconfig.json:14 on main is on "moduleResolution": "Bundler", and the described vitest/electron failures don't reproduce. At ~3,400 commits behind with 52 apply errors across 48 files, a test-repair branch has essentially no salvage value — the suite has moved underneath it.

Worth flagging on the record for anyone who finds this later: the branch also removed regression coverage for five behaviors unrelated to the import repair. So it shouldn't be revived wholesale even if extensionless imports break again — that would be a focused PR touching resolution only.

@Kyzcreig Kyzcreig closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants