Skip to content

test(clients): spread the real connect module in the route-intent recovery mock - #8700

Merged
lidge-jun merged 1 commit into
devfrom
codex/fix-route-intent-connect-recovery-1113
Nov 13, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/fix-route-intent-connect-recovery-1113

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes the two failures in dev batch run 43451726885 (test 5/5, head 65ec0dd):

  • tests/clients/route-intent-connect-recovery.test.ts "Hub rejects generic clients before reading a credential or attempting connect"
  • same file, "Link accepts generic clients and completion uses the effective connection selection"

Both scenarios run in a bun --eval subprocess and replace ./src/client/connect with mock.module. The factory exported only connectClient, disconnectClient, revokeConnectedClientKey, and rotateConnectedClientKey. #8662 (63c7da7) added assertDisconnectExpectation to src/client/connect.ts and imported it from src/cli/connect.ts for disconnect --expect-link, so importing the CLI module failed with:

SyntaxError: Export named 'assertDisconnectExpectation' not found in module '.../src/client/connect.ts'.

The product is correct; the test's mock was incomplete. The factory now spreads the real module and overrides only those four functions, so a future export from src/client/connect.ts cannot break the link step again. The Link scenario still asserts the mocked connectClient received the selection, which shows the override takes effect.

PR test changed follows the import graph and cannot see subprocess tests, which is why this reached dev. This PR carries ci:full so the full Ubuntu shards run the file.

Verification

  • bun test tests/clients/route-intent-connect-recovery.test.ts on dev 65ec0dd: 7 pass, 2 fail with the SyntaxError above (failure reproduced before the fix). With the fix: 9 pass, 0 fail.
  • bun test tests/clients/route-intent-*.test.ts tests/cli/*connect*: 271 pass, 1 skip (Windows-only probe), 0 fail across 28 files.
  • bun run typecheck: no type errors in 2,533 files.
  • NOT RUN locally: full bun run test. The change touches one test file with no src/ change; the full Ubuntu shards run via ci:full.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (None needed: test-only change.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (No security surface touched.)

Summary by CodeRabbit

  • Tests
    • Updated test mocking to preserve other connection-module exports when testing CLI recovery behavior.

…overy mock

The subprocess mock of ./src/client/connect listed four functions. #8662 made
src/cli/connect import assertDisconnectExpectation as well, so the CLI module
failed to link and both CLI scenarios exited with a SyntaxError before running.
The mock now spreads the real module and overrides only the four functions.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 13, 2026 15:39
@lidge-jun lidge-jun added the ci:full Run the four full Ubuntu test shards on this pull request label Nov 13, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T15:40:46.139320Z ca654cf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The connect-command test mock now retains exports from the real src/client/connect module and overrides connectClient.

Changes: Test mock update

Layer / File(s) Summary
Preserve connect module exports
tests/clients/route-intent-connect-recovery.test.ts
The mock spreads the real connect module before overriding connectClient.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: Minimal · up to ca654

This is a test-only change that fixes two failing CLI subprocess tests by keeping the real connect module exports. It has no production impact and is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the test-only change: the route-intent recovery mock now spreads the real connect module. The raw summary and objectives confirm this is the main change, which fixes a missing export (…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the test-only change: the route-intent recovery mock now spreads the real connect module. The raw summary and objectives confirm this is the main change, which fixes a missing export (assertDisconnectExpectation) that broke two subprocess tests. The title is 79 characters and uses the conventional test(scope) prefix, so it is specific and scannable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 65ec0dd and ca654cf.

Files selected for processing: 1

  • tests/clients/route-intent-connect-recovery.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration into dev (MAINTAINERS.md dev-only exception), authorized by the release owner for this fix.

@lidge-jun
lidge-jun merged commit 43f9761 into dev Nov 13, 2026
37 of 39 checks passed
@lidge-jun
lidge-jun deleted the codex/fix-route-intent-connect-recovery-1113 branch November 13, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). ci:full Run the four full Ubuntu test shards on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant