Skip to content

fix(tests): dedupe imports + permission-mode types from #202 consolidation#204

Merged
arul28 merged 1 commit intomainfrom
fix/typecheck-test-consolidation
Apr 26, 2026
Merged

fix(tests): dedupe imports + permission-mode types from #202 consolidation#204
arul28 merged 1 commit intomainfrom
fix/typecheck-test-consolidation

Conversation

@arul28
Copy link
Copy Markdown
Owner

@arul28 arul28 commented Apr 26, 2026

Fixes the typecheck failures on main after the test consolidation in #202.

  • ctoWorkerLifecycle / linearIntake / linearSync had duplicate import lines (TS2300).
  • prRebase.test.ts under-typed the lazy resolverUtils handles (TS2322) — corrected to AiPermissionMode -> AgentChatPermissionMode.

Local typecheck clean.

Greptile Summary

This PR fixes TypeScript compilation failures introduced by the test consolidation in #202. It removes duplicate import statements (TS2300) in three CTO service test files and corrects the lazy variable type annotations in prRebase.test.ts from generic string to the proper domain types (AiPermissionModeAgentChatPermissionMode), matching the actual signatures of mapPermissionMode and mapPermissionModeForModelFamily in resolverUtils.ts.

Confidence Score: 5/5

Safe to merge — changes are purely type/import cleanup with no runtime impact.

All four files contain only import deduplication or type annotation corrections in test files. The types used (AiPermissionMode, AgentChatPermissionMode) are verified to be correctly exported from shared/types, and the function signatures in resolverUtils.ts match exactly. No logic changes, no security implications.

No files require special attention.

Important Files Changed

Filename Overview
apps/desktop/src/main/services/cto/ctoWorkerLifecycle.test.ts Removed duplicate import type { AgentIdentity } and three duplicate vitest/kvDb import lines; consolidated into single correct imports.
apps/desktop/src/main/services/cto/linearIntake.test.ts Removed duplicate import type { ... } block and two duplicate vitest import lines; added LinearWorkflowConfig to the merged type import.
apps/desktop/src/main/services/cto/linearSync.test.ts Consolidated four duplicate import type lines for shared types into a single multi-symbol import; removed two duplicate vitest import lines.
apps/desktop/src/main/services/prs/prRebase.test.ts Corrected lazy variable types for mapPermissionMode / mapPermissionModeForModelFamily from string to `AiPermissionMode

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["prRebase.test.ts\n(resolverUtils tests)"] -->|"vi.importActual"| B["resolverUtils.ts"]
    B -->|"mapPermissionMode(AiPermissionMode)"| C["AgentChatPermissionMode"]
    B -->|"mapPermissionModeForModelFamily(AiPermissionMode, family)"| C
    D["shared/types (prs.ts)"] -->|"exports"| E["AiPermissionMode\n(read_only | guarded_edit | full_edit)"]
    F["shared/types (chat.ts)"] -->|"exports"| G["AgentChatPermissionMode\n(default | plan | edit | full-auto | config-toml)"]
    E --> B
    G --> B
Loading

Reviews (1): Last reviewed commit: "fix(tests): dedupe imports + correct per..." | Re-trigger Greptile

…olidation

The test consolidation in #202 left duplicate import lines in
ctoWorkerLifecycle / linearIntake / linearSync test files (TS2300) and
under-typed the lazy resolverUtils handles in prRebase.test.ts (TS2322
against the real AiPermissionMode -> AgentChatPermissionMode signatures).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Apr 26, 2026 6:25pm

@arul28 arul28 merged commit f9fc7d7 into main Apr 26, 2026
6 of 7 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 26, 2026

Warning

Rate limit exceeded

@arul28 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 48 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 48 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 069b14b4-0d39-4142-8bdb-b37a5e025573

📥 Commits

Reviewing files that changed from the base of the PR and between 96df71e and da8984c.

📒 Files selected for processing (4)
  • apps/desktop/src/main/services/cto/ctoWorkerLifecycle.test.ts
  • apps/desktop/src/main/services/cto/linearIntake.test.ts
  • apps/desktop/src/main/services/cto/linearSync.test.ts
  • apps/desktop/src/main/services/prs/prRebase.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/typecheck-test-consolidation

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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