Skip to content

fix(patch): cherry-pick d0c6a56 to release/v0.28.2-pr-18976 [CONFLICTS]#19024

Open
gemini-cli-robot wants to merge 1 commit intorelease/v0.28.2-pr-18976from
hotfix/v0.28.2/0.28.3/stable/cherry-pick-d0c6a56/pr-18976
Open

fix(patch): cherry-pick d0c6a56 to release/v0.28.2-pr-18976 [CONFLICTS]#19024
gemini-cli-robot wants to merge 1 commit intorelease/v0.28.2-pr-18976from
hotfix/v0.28.2/0.28.3/stable/cherry-pick-d0c6a56/pr-18976

Conversation

@gemini-cli-robot
Copy link
Copy Markdown
Collaborator

This PR automatically cherry-picks commit d0c6a56 to patch version v0.28.2 in the stable release to create version 0.28.3.

⚠️ Merge Conflicts Detected

This cherry-pick resulted in merge conflicts that need manual resolution.

🔧 Next Steps:

  1. Review the conflicts: Check out this branch and review the conflict markers
  2. Resolve conflicts: Edit the affected files to resolve the conflicts
  3. Test the changes: Ensure the patch works correctly after resolution
  4. Update this PR: Push your conflict resolution

📋 Files with conflicts:

The commit has been created with conflict markers for easier manual resolution.

🚨 Important:

  • Do not merge this PR until conflicts are resolved
  • The automated patch release will trigger once this PR is merged

# Conflicts:
#	packages/core/src/utils/headless.test.ts
#	packages/core/src/utils/headless.ts
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @gemini-cli-robot, 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 is an automated cherry-pick of a commit aimed at improving the isHeadlessMode utility. The original change enhances the function's ability to determine if an application is running in a headless environment by considering query parameters and command-line flags such as --prompt and --yolo. However, the cherry-pick resulted in merge conflicts that need to be resolved manually before the PR can be merged.

Highlights

  • Headless Mode Detection Logic: Refined the isHeadlessMode function to accurately detect headless environments based on query options and command-line arguments like -p or --prompt.
  • Expanded Test Coverage: Expanded test coverage for isHeadlessMode to include scenarios involving query parameters and process.argv flags, specifically addressing --yolo behavior.
  • Merge Conflicts: Introduced merge conflicts in headless.ts and headless.test.ts due to the cherry-pick, requiring manual resolution.
Changelog
  • packages/core/src/utils/headless.test.ts
    • Updated the test for query option to reflect that providing a query should now result in headless mode.
    • Added new tests to ensure isHeadlessMode correctly identifies headless mode when -p or --prompt are present in process.argv.
    • Added new tests to confirm isHeadlessMode correctly identifies non-headless mode when -y or --yolo are present in process.argv.
  • packages/core/src/utils/headless.ts
    • Modified the isHeadlessMode function to include options?.query as a condition for headless mode.
    • Implemented a fallback mechanism to check process.argv for -p or --prompt flags to determine headless mode.
Activity
  • Automated cherry-pick of commit d0c6a56c65556fc4e1d03b680d38cadb28aa01ec to release/v0.28.2-pr-18976.
  • Merge conflicts detected in packages/core/src/utils/headless.test.ts and packages/core/src/utils/headless.ts.
  • Manual resolution of conflicts is required before merging this pull request.
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
Copy Markdown
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

This pull request contains unresolved merge conflicts from a cherry-pick operation. As noted in the description, these conflicts in packages/core/src/utils/headless.test.ts and packages/core/src/utils/headless.ts must be resolved. The presence of conflict markers makes the code invalid and prevents merging.

Comment on lines +102 to +144
<<<<<<< HEAD
it('should return false if query is provided but it is still a TTY', () => {
// Note: per current logic, query alone doesn't force headless if TTY
// This matches the existing behavior in packages/cli/src/config/config.ts
expect(isHeadlessMode({ query: 'test query' })).toBe(false);
=======
it('should return true if query is provided', () => {
expect(isHeadlessMode({ query: 'test query' })).toBe(true);
});

it('should return true if -p or --prompt is in process.argv as a fallback', () => {
const originalArgv = process.argv;
process.argv = ['node', 'index.js', '-p', 'hello'];
try {
expect(isHeadlessMode()).toBe(true);
} finally {
process.argv = originalArgv;
}

process.argv = ['node', 'index.js', '--prompt', 'hello'];
try {
expect(isHeadlessMode()).toBe(true);
} finally {
process.argv = originalArgv;
}
});

it('should return false if -y or --yolo is in process.argv as a fallback', () => {
const originalArgv = process.argv;
process.argv = ['node', 'index.js', '-y'];
try {
expect(isHeadlessMode()).toBe(false);
} finally {
process.argv = originalArgv;
}

process.argv = ['node', 'index.js', '--yolo'];
try {
expect(isHeadlessMode()).toBe(false);
} finally {
process.argv = originalArgv;
}
>>>>>>> d0c6a56c6 (fix(core): ensure --yolo does not force headless mode (#18976))
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.

critical

This file has unresolved merge conflict markers from line 102 to 144. These markers (<<<<<<< HEAD, =======, >>>>>>>) introduce syntax errors and will cause the test suite to fail. Please resolve the conflict by combining the logic from both branches as intended and removing the markers.

Comment on lines +43 to +55
<<<<<<< HEAD
(!!process.stdout && !process.stdout.isTTY)
);
=======
(!!process.stdout && !process.stdout.isTTY);

if (isNotTTY || !!options?.prompt || !!options?.query) {
return true;
}

// Fallback: check process.argv for flags that imply headless mode.
return process.argv.some((arg) => arg === '-p' || arg === '--prompt');
>>>>>>> d0c6a56c6 (fix(core): ensure --yolo does not force headless mode (#18976))
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.

critical

This file has unresolved merge conflict markers from line 43 to 55. The code within this block is syntactically incorrect and will cause a build failure. Please resolve the conflict by merging the logic for isHeadlessMode correctly and removing the conflict markers (<<<<<<< HEAD, =======, >>>>>>>).

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants