Skip to content

fix: merge duplicate imports in packages/core (3/4)#19791

Closed
Nixxx19 wants to merge 13 commits intogoogle-gemini:mainfrom
Nixxx19:nityam/cleanup-import-no-duplicates-core
Closed

fix: merge duplicate imports in packages/core (3/4)#19791
Nixxx19 wants to merge 13 commits intogoogle-gemini:mainfrom
Nixxx19:nityam/cleanup-import-no-duplicates-core

Conversation

@Nixxx19
Copy link
Contributor

@Nixxx19 Nixxx19 commented Feb 21, 2026

Summary

  • Merged duplicate import statements across 141 files in packages/core
  • Combined type and value imports from the same module using inline type syntax
  • Fixed import ordering to comply with import/no-duplicates ESLint rule

Changes

  • Used ESLint's --fix with import/no-duplicates rule to automatically merge most duplicates
  • Manually fixed edge cases where ESLint's autofix created malformed imports
  • Ensured proper separation of value imports and type imports
  • Fixed getFolderStructure.test.ts to use correct namespace import references

Testing

  • ✅ All 265 test suites pass (4998 tests)
  • ✅ TypeScript compilation successful
  • ✅ ESLint passes with only 2 pre-existing warnings (unrelated to this PR)
  • ✅ No breaking changes

Stats

  • 141 files changed
  • +933 insertions, -753 deletions

Related

Fixes #19753 - PR 3 of 4 (packages/core)

Previous PRs:

Merged duplicate import statements across all files in packages/core
to comply with the import/no-duplicates ESLint rule. Changes include:

- Combined type and value imports from the same module
- Merged namespace imports with named imports where appropriate
- Fixed import ordering to separate value imports from type imports
- Ensured all imports follow the inline type import pattern

All 265 test suites pass successfully.

Related to google-gemini#19753
@Nixxx19 Nixxx19 requested a review from a team as a code owner February 21, 2026 05:13
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Nixxx19, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the import statements across numerous files within the packages/core module. The primary objective is to streamline and standardize module imports by consolidating duplicates and integrating type-only imports using inline type modifiers. This effort enhances code readability, maintainability, and ensures adherence to ESLint's import rules, contributing to a cleaner and more robust codebase.

Highlights

  • Import Consolidation: Duplicate import statements were merged across 141 files in the packages/core directory to improve code consistency and reduce redundancy.
  • Inline Type Modifiers: Type and value imports from the same module were combined into single statements using TypeScript's inline type syntax.
  • ESLint Compliance: Import ordering was fixed to comply with the import/no-duplicates ESLint rule, with most changes applied automatically via ESLint's --fix command.
  • Edge Case Handling: Manual adjustments were made to correct edge cases where ESLint's autofix feature might have produced malformed import statements.
  • Specific Test File Fix: The getFolderStructure.test.ts file was updated to use correct namespace import references.
Changelog
  • packages/core/src/agents/a2a-client-manager.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/agents/agentLoader.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/agents/local-executor.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/agents/local-executor.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/agents/local-invocation.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/agents/registry.test.ts
    • Merged duplicate import statements, combined type and value imports using inline type syntax, and removed a redundant import of ConfigParameters.
  • packages/core/src/agents/remote-invocation.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/code_assist/codeAssist.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/code_assist/converter.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/code_assist/converter.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/code_assist/oauth2.test.ts
    • Merged duplicate import statements, combined type and value imports using inline type syntax, and removed redundant imports of OAuth2Client, Compute, and GoogleAuth.
  • packages/core/src/code_assist/oauth2.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/code_assist/server.ts
    • Merged duplicate import statements, combined type and value imports using inline type syntax, and removed a redundant import of UserTierId.
  • packages/core/src/code_assist/setup.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/code_assist/setup.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/config/config.test.ts
    • Merged duplicate import statements, combined type and value imports using inline type syntax, and removed a redundant import of uiTelemetryService.
  • packages/core/src/config/config.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/baseLlmClient.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/client.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/contentGenerator.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/contentGenerator.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/coreToolHookTriggers.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/coreToolScheduler.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/coreToolScheduler.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/geminiChat.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/geminiChat.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/geminiChat_network_retry.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/logger.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/loggingContentGenerator.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/turn.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/core/turn.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookAggregator.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookAggregator.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookEventHandler.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookEventHandler.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookPlanner.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookRegistry.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookRegistry.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookRunner.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookRunner.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookSystem.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/hookSystem.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/types.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/hooks/types.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/ide/ide-installer.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/mcp/google-auth-provider.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/mcp/oauth-provider.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/mcp/oauth-utils.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/mcp/token-storage/hybrid-token-storage.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/output/stream-json-formatter.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/policy/config.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/policy/toml-loader.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/safety/built-in.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/safety/built-in.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/safety/checker-runner.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/safety/checker-runner.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/confirmation.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/policy.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/scheduler.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/scheduler.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/scheduler_parallel.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/state-manager.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/state-manager.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/tool-executor.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/tool-executor.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/scheduler/tool-modifier.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/chatCompressionService.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/chatRecordingService.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/fileDiscoveryService.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/gitService.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/loopDetectionService.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/loopDetectionService.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/modelConfig.integration.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/modelConfigService.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/shellExecutionService.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/services/shellExecutionService.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/activity-monitor.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/clearcut-logger/clearcut-logger.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/file-exporters.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/file-exporters.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/gcp-exporters.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/loggers.test.circular.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/loggers.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/loggers.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/metrics.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/semantic.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/types.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/uiTelemetry.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/telemetry/uiTelemetry.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/test-utils/config.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/test-utils/mock-tool.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/activate-skill.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/edit.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/glob.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/glob.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/grep.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/grep.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/ls.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/mcp-client.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/mcp-tool.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/memoryTool.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/memoryTool.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/modifiable-tool.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/modifiable-tool.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/read-file.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/read-file.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/read-many-files.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/read-many-files.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/ripGrep.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/ripGrep.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/shell.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/shell.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/tool-registry.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/tool-registry.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/tools.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/web-fetch.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/web-search.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/web-search.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/write-file.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/write-file.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/tools/write-todos.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/apiConversionUtils.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/authConsent.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/editCorrector.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/filesearch/crawler.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/filesearch/fileSearch.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/generateContentResponseUtilities.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/getFolderStructure.test.ts
    • Merged duplicate import statements, combined type and value imports using inline type syntax, and updated path imports to nodePath for consistency.
  • packages/core/src/utils/getFolderStructure.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/googleErrors.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/googleQuotaErrors.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/installationManager.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/memoryDiscovery.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/memoryDiscovery.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/nextSpeakerChecker.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/retry.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/shell-utils.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/summarizer.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/tool-utils.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/tool-utils.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
  • packages/core/src/utils/userAccountManager.test.ts
    • Merged duplicate import statements and combined type and value imports using inline type syntax.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request effectively merges duplicate import statements across numerous files in packages/core, combining type and value imports using inline type syntax. It also addresses import ordering to comply with the import/no-duplicates ESLint rule. The changes improve code clarity and maintainability by reducing redundancy in import declarations.

Comment on lines 39 to 46
import {
type LocalAgentDefinition,
type AgentInputs,
type OutputObject,
type SubagentActivityEvent,
AgentTerminateMode,
DEFAULT_QUERY_STRING,
DEFAULT_MAX_TURNS,
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The type imports for LocalAgentDefinition, AgentInputs, OutputObject, and SubagentActivityEvent are correctly merged with the AgentTerminateMode value import from ./types.js.

import {
  type LocalAgentDefinition,
  type AgentInputs,
  type OutputObject,
  type SubagentActivityEvent,
  AgentTerminateMode,
  DEFAULT_QUERY_STRING,
  DEFAULT_MAX_TURNS,
} from './types.js';

Comment on lines +9 to 13
type CaGenerateContentResponse,
toGenerateContentRequest,
fromGenerateContentResponse,
toContents,
} from './converter.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The CaGenerateContentResponse type import is correctly merged with other value imports from ./converter.js, enhancing import consolidation.

import {
  type CaGenerateContentResponse,
  toGenerateContentRequest,
  fromGenerateContentResponse,
  toContents,
} from './converter.js';

Comment on lines 14 to 21
import {
GenerateContentResponse,
FinishReason,
BlockedReason,
type ContentListUnion,
type GenerateContentParameters,
type Part,
} from '@google/genai';
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This change correctly merges the GenerateContentResponse, FinishReason, and BlockedReason value imports with the ContentListUnion, GenerateContentParameters, and Part type imports from @google/genai, reducing import redundancy.

import {
  GenerateContentResponse,
  FinishReason,
  BlockedReason,
  type ContentListUnion,
  type GenerateContentParameters,
  type Part,
} from '@google/genai';

Comment on lines 7 to 13
import {
type Credentials,
type AuthClient,
type JWTInput,
OAuth2Client,
Compute,
CodeChallengeMethod,
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This change correctly merges the Credentials, AuthClient, and JWTInput type imports with several value imports from google-auth-library, reducing import redundancy.

import {
  type Credentials,
  type AuthClient,
  type JWTInput,
  OAuth2Client,
  Compute,
  CodeChallengeMethod,
} from 'google-auth-library';

Comment on lines 41 to 46
import {
type CaCountTokenResponse,
type CaGenerateContentResponse,
fromCountTokenResponse,
fromGenerateContentResponse,
toCountTokenRequest,
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The CaCountTokenResponse and CaGenerateContentResponse type imports are correctly merged with other value imports from ./converter.js, enhancing import consolidation.

import {
  type CaCountTokenResponse,
  type CaGenerateContentResponse,
  fromCountTokenResponse,
  fromGenerateContentResponse,
  toCountTokenRequest,
} from './converter.js';

@gemini-cli gemini-cli bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Feb 21, 2026
@Nixxx19 Nixxx19 changed the title fix: merge duplicate imports in packages/core fix: merge duplicate imports in packages/core (3/4) Feb 21, 2026
@Nixxx19 Nixxx19 force-pushed the nityam/cleanup-import-no-duplicates-core branch from 20669cc to 51e6309 Compare February 22, 2026 06:33
Resolved conflict in packages/core/src/config/config.test.ts:
- Added type import for ContentGenerator (needed for type annotations)
- ContentGeneratorConfig already imported as type in regular import, so no duplicate needed
Separate type import for ContentGenerator from regular imports to maintain proper TypeScript import structure
@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels Feb 26, 2026
@scidomino
Copy link
Collaborator

please resolve your merge conflict

Resolved conflicts in:
- packages/core/src/code_assist/converter.ts: Added debugLogger and Credits type imports
- packages/core/src/code_assist/server.ts: Merged type imports, added billing imports and GeminiUserTier
- packages/core/src/config/config.ts: Added OverageStrategy import
- packages/core/src/scheduler/scheduler_parallel.test.ts: Added GeminiCliOperation import
- packages/core/src/scheduler/tool-executor.ts: Added telemetry constants imports
- packages/core/src/tools/mcp-client.ts: Split imports and added GeminiCLIExtension
- packages/core/src/tools/write-file.test.ts: Kept EditToolParams and editCorrector imports with eslint-disable
- packages/core/src/utils/editCorrector.test.ts: Simplified vitest imports
Addresses reviewer feedback: The currentMode variable was already retrieved,
so we should use it consistently rather than calling getApprovalMode() again.
This ensures consistency and avoids potential issues if the function returns
different values on subsequent calls.
Since there's no name conflict after import cleanup, we can use the
standard 'path' import name instead of 'nodePath'.
This line was accidentally added during merge conflict resolution but
was not present in origin/main. Removing it to keep the PR focused on
import cleanup only.
@Nixxx19 Nixxx19 requested a review from scidomino March 1, 2026 19:46
@Nixxx19
Copy link
Contributor Author

Nixxx19 commented Mar 2, 2026

@scidomino made all the changes and fixed conflicts too, thanks for catching!

@scidomino
Copy link
Collaborator

I'm sorry. There are more merge conflicts.

My advice is to break this up into smaller sections. That will make it easier to review and easier to resolve conflicts.

@scidomino
Copy link
Collaborator

I see you resolved them. Ok. Will review now.

Copy link
Collaborator

@scidomino scidomino left a comment

Choose a reason for hiding this comment

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

More unrelated edits probably due to a bad merge. I stopped reviewing after I saw that file so please do check the rest to make sure they aren't also affected

let mockGeminiClientInstance: Mocked<GeminiClient>;
let mockBaseLlmClientInstance: Mocked<BaseLlmClient>;
let mockConfig: Config;
const mockEnsureCorrectEdit = vi.fn<typeof ensureCorrectEdit>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

These changes (and the others in this file) seem unconnected to imports.

mockEnsureCorrectFileContent.mockReset();

// Default mock implementations that return valid structures
mockEnsureCorrectEdit.mockImplementation(
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@Nixxx19
Copy link
Contributor Author

Nixxx19 commented Mar 2, 2026

More unrelated edits probably due to a bad merge. I stopped reviewing after I saw that file so please do check the rest to make sure they aren't also affected

i will create a fresh new PR with the fix, sorry about that, thanks for flagging!

@Nixxx19 Nixxx19 closed this Mar 3, 2026
@Nixxx19
Copy link
Contributor Author

Nixxx19 commented Mar 3, 2026

hey @scidomino, made a new fresh pr with no merge conflicts #20928, it got closed by the bot, can you please reopen and review it, thanks!!

@Nixxx19 Nixxx19 reopened this Mar 3, 2026
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

You already have 7 pull requests open. Please work on getting existing PRs merged before opening more.

@github-actions github-actions bot closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup existing import/no-duplicates warnings and suppressions

2 participants