Skip to content

Fix copilot and git related scripts execution#736

Merged
RomanNikitenko merged 3 commits into
che-incubator:mainfrom
RomanNikitenko:fix-scripts
Jun 26, 2026
Merged

Fix copilot and git related scripts execution#736
RomanNikitenko merged 3 commits into
che-incubator:mainfrom
RomanNikitenko:fix-scripts

Conversation

@RomanNikitenko

@RomanNikitenko RomanNikitenko commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

  1. Fixes copilot problem in a terminal:
Screenshot 2026-06-26 at 12 51 52
  1. Fixes interactive git editor
Screenshot 2026-06-26 at 14 18 01
  1. Fixes Git clone for a private repo
Screenshot 2026-06-26 at 13 25 31

What issues does this PR fix?

https://redhat.atlassian.net/browse/CRW-11371

How to test this PR?

  1. copilot use case
  • Start workspace - click here
  • create a vanilla VS Code terminal
  • type copilot

Expected behavior:

  • No error (see the screenshot in the previous section)
  • copilot is run or it propose to install copilot CLI
Screenshot 2026-06-26 at 13 56 58
  1. Interactive git editor
  • Start a workspace - click here
  • Set git.terminalGitEditor to true in VS Code settings
  • Create a vanilla VS Code terminal
  • Make a change and stage it: echo test >> file.txt && git add file.txt
  • Run: git commit (without -m)

Expected behavior:

Screenshot 2026-06-26 at 14 08 15
  1. Git clone for a private repo
  • You need to revoke/remove/clean up any git credentials for the instance where you are going to test the use case
  • Start workspace - click here
  • Create a vanilla VS Code terminal
  • git clone https://github.com/RomanNikitenko/private-test-repo.git

Expected behavior:
image
Device Auth flow is triggered
Screenshot 2026-06-26 at 13 45 49
Private repo cloned successfully
Screenshot 2026-06-26 at 13 49 10

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability for Git-related prompts and editor launch flows by ensuring bundled Node components can find required system libraries.
    • Fixed Copilot CLI and debug startup on Unix-like systems by setting up library paths before launching, reducing startup failures in affected environments.
    • Updated rebase conflict handling so these changes are applied consistently during maintenance workflows.

… contain required libs

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Assisted-by: Cursor AI
… not contain required libs

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Assisted-by: Cursor AI
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@tolusha

tolusha commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm che-ai-assistant — I help with your pull requests.

Available commands:

  • /che-ai-assistant generate-che-doc — Generate a documentation PR based on this PR's changes
  • /che-ai-assistant ok-pr-review — Run a comprehensive PR review (summary, code review, deep review, impact analysis)
  • /che-ai-assistant help — Show this help message

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
@github-actions

Copy link
Copy Markdown
Contributor

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

@RomanNikitenko RomanNikitenko marked this pull request as ready for review June 26, 2026 11:10
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Git and Copilot shell wrappers now prepend bundled ld_libs paths to LD_LIBRARY_PATH before launching Node-based helpers. Matching .rebase/replace entries and rebase.sh conflict rules were added, and .rebase/CHANGELOG.md got a new top entry.

Changes

Bundled Node library path updates

Layer / File(s) Summary
Git wrappers and rebase rules
code/extensions/git/src/askpass.sh, code/extensions/git/src/git-editor.sh, code/extensions/git/src/ssh-askpass.sh, .rebase/replace/code/extensions/git/src/askpass.sh.json, .rebase/replace/code/extensions/git/src/git-editor.sh.json, .rebase/replace/code/extensions/git/src/ssh-askpass.sh.json, rebase.sh, .rebase/CHANGELOG.md
Git askpass, git-editor, and ssh-askpass scripts now prepend bundled ld_libs paths to LD_LIBRARY_PATH, matching rebase replacements and Git-specific conflict rules are added, and the changelog records the affected files.
Copilot wrappers and rebase rules
code/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLITerminalIntegration.ts, code/extensions/copilot/src/extension/onboardDebug/vscode-node/copilotDebugCommandContribution.ts, .rebase/replace/code/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLITerminalIntegration.ts.json, .rebase/replace/code/extensions/copilot/src/extension/onboardDebug/vscode-node/copilotDebugCommandContribution.ts.json, rebase.sh
Copilot CLI terminal and debug shell wrappers now export LD_LIBRARY_PATH from bundled ld_libs paths before launching Node, and rebase.sh adds the matching conflict rules.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • rgrunber
  • vitaliy-guliy
  • azatsarynnyy

Poem

A rabbit hopped by moonlit code,
and found the libs along the road.
With LD paths set just so,
the askpass scripts began to glow.
🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: fixing execution of Copilot and Git-related scripts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.rebase/CHANGELOG.md:
- Around line 5-13: The changelog entry under the contributor name is using a
fourth-level heading and skips the required heading hierarchy. Update the
heading in the referenced changelog section to an H2 so it stays consistent with
the surrounding markdown structure and avoids markdownlint failures; adjust the
heading for the entry that lists the affected scripts and copilot files.

In `@rebase.sh`:
- Around line 417-422: `resolve_conflicts()` is missing a branch for
`.rebase/CHANGELOG.md`, so that file falls through to the manual-conflict
fallback. Add a new `elif` in the conflict dispatch alongside the existing
file-specific handlers (for example near the `code/extensions/git/src/*` cases)
that routes `.rebase/CHANGELOG.md` to the appropriate resolution helper,
preventing the rebase flow from stopping on that file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26beb3ec-28af-4146-9152-9382d44900dd

📥 Commits

Reviewing files that changed from the base of the PR and between ae47c92 and 863c1ef.

📒 Files selected for processing (12)
  • .rebase/CHANGELOG.md
  • .rebase/replace/code/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLITerminalIntegration.ts.json
  • .rebase/replace/code/extensions/copilot/src/extension/onboardDebug/vscode-node/copilotDebugCommandContribution.ts.json
  • .rebase/replace/code/extensions/git/src/askpass.sh.json
  • .rebase/replace/code/extensions/git/src/git-editor.sh.json
  • .rebase/replace/code/extensions/git/src/ssh-askpass.sh.json
  • code/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLITerminalIntegration.ts
  • code/extensions/copilot/src/extension/onboardDebug/vscode-node/copilotDebugCommandContribution.ts
  • code/extensions/git/src/askpass.sh
  • code/extensions/git/src/git-editor.sh
  • code/extensions/git/src/ssh-askpass.sh
  • rebase.sh

Comment thread .rebase/CHANGELOG.md
Comment on lines +5 to +13
#### @RomanNikitenko
https://github.com/che-incubator/che-code/pull/736

- code/extensions/git/src/askpass.sh
- code/extensions/git/src/ssh-askpass.sh
- code/extensions/git/src/git-editor.sh
- code/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLITerminalIntegration.ts
- code/extensions/copilot/src/extension/onboardDebug/vscode-node/copilotDebugCommandContribution.ts
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use an H2 here to keep heading levels valid.

This new #### skips heading levels and is already tripping markdownlint on Line 5.

Suggested fix
-#### `@RomanNikitenko`
+## `@RomanNikitenko`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### @RomanNikitenko
https://github.com/che-incubator/che-code/pull/736
- code/extensions/git/src/askpass.sh
- code/extensions/git/src/ssh-askpass.sh
- code/extensions/git/src/git-editor.sh
- code/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLITerminalIntegration.ts
- code/extensions/copilot/src/extension/onboardDebug/vscode-node/copilotDebugCommandContribution.ts
---
## `@RomanNikitenko`
https://github.com/che-incubator/che-code/pull/736
- code/extensions/git/src/askpass.sh
- code/extensions/git/src/ssh-askpass.sh
- code/extensions/git/src/git-editor.sh
- code/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLITerminalIntegration.ts
- code/extensions/copilot/src/extension/onboardDebug/vscode-node/copilotDebugCommandContribution.ts
---
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 5-5: Heading levels should only increment by one level at a time
Expected: h2; Actual: h4

(MD001, heading-increment)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.rebase/CHANGELOG.md around lines 5 - 13, The changelog entry under the
contributor name is using a fourth-level heading and skips the required heading
hierarchy. Update the heading in the referenced changelog section to an H2 so it
stays consistent with the surrounding markdown structure and avoids markdownlint
failures; adjust the heading for the entry that lists the affected scripts and
copilot files.

Source: Linters/SAST tools

Comment thread rebase.sh
Comment on lines +417 to +422
elif [[ "$conflictingFile" == "code/extensions/git/src/askpass.sh" ]]; then
apply_changes_multi_line "$conflictingFile"
elif [[ "$conflictingFile" == "code/extensions/git/src/ssh-askpass.sh" ]]; then
apply_changes_multi_line "$conflictingFile"
elif [[ "$conflictingFile" == "code/extensions/git/src/git-editor.sh" ]]; then
apply_changes_multi_line "$conflictingFile"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Add a resolver for .rebase/CHANGELOG.md.

This PR updates .rebase/CHANGELOG.md, but resolve_conflicts() still has no branch for it. If that file conflicts, the fallback at Lines 521-536 exits on che-specific files with no rule, so the automated rebase flow still stops manually.

Also applies to: 501-504

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rebase.sh` around lines 417 - 422, `resolve_conflicts()` is missing a branch
for `.rebase/CHANGELOG.md`, so that file falls through to the manual-conflict
fallback. Add a new `elif` in the conflict dispatch alongside the existing
file-specific handlers (for example near the `code/extensions/git/src/*` cases)
that routes `.rebase/CHANGELOG.md` to the appropriate resolution helper,
preventing the rebase flow from stopping on that file.

@RomanNikitenko RomanNikitenko merged commit 3f60274 into che-incubator:main Jun 26, 2026
14 checks passed
@RomanNikitenko RomanNikitenko deleted the fix-scripts branch June 26, 2026 13:20
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.

3 participants