Skip to content

fix: CodeRabbit auto-fixes for PR #2 - #3

Closed
coderabbitai[bot] wants to merge 2 commits into
codex/cross-platform-pwsh7from
coderabbitai/autofix/b83f08e
Closed

fix: CodeRabbit auto-fixes for PR #2#3
coderabbitai[bot] wants to merge 2 commits into
codex/cross-platform-pwsh7from
coderabbitai/autofix/b83f08e

Conversation

@coderabbitai

@coderabbitai coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

This stacked PR contains CodeRabbit auto-fixes for #2.

Files modified:

  • install-code-intel-pipeline.ps1
  • tools/code-intel-platform.psm1

2233admin and others added 2 commits June 19, 2026 23:39
Fixed 2 file(s) based on 3 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Author

Important

Review skipped

This PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 02d13e4e-ce23-4750-8869-ffe145726479

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tools/code-intel-platform.psm1 (1)

160-164: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Appending unconditionally will accumulate duplicate lines for the same var over repeated runs.

Switching to Add-Content fixes the prior bug where Set-Content wiped out previously-persisted variables for other names. However, since there's no check for an existing $env:$Name = ... line, calling Set-CodeIntelUserEnv again for the same $Name (e.g., re-running the installer) appends a new line rather than replacing the old one. Correctness is preserved (last line wins on dot-source) but env.ps1 grows unbounded with stale duplicate entries.

♻️ Suggested fix: remove any prior assignment for the same name before appending
     $envFile = Join-Path $configDir "env.ps1"
     $escaped = $Value.Replace("'", "''")
-    "`$env:$Name = '$escaped'" | Add-Content -LiteralPath $envFile -Encoding UTF8
+    if (Test-Path -LiteralPath $envFile) {
+        $existing = Get-Content -LiteralPath $envFile | Where-Object { $_ -notmatch "^\`$env:$Name\s*=" }
+        Set-Content -LiteralPath $envFile -Value $existing -Encoding UTF8
+    }
+    "`$env:$Name = '$escaped'" | Add-Content -LiteralPath $envFile -Encoding UTF8
🤖 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 `@tools/code-intel-platform.psm1` around lines 160 - 164, Set-CodeIntelUserEnv
currently appends a new assignment every time, so repeated runs create duplicate
stale entries in env.ps1. Update the Set-CodeIntelUserEnv flow around
$configDir, $envFile, and the final Add-Content write so it first removes any
existing `$env:$Name = ...` line for the same variable name before appending the
new value. Keep the existing Add-Content behavior for preserving other
variables, but ensure the env.ps1 file stays deduplicated per $Name.
🤖 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.

Nitpick comments:
In `@tools/code-intel-platform.psm1`:
- Around line 160-164: Set-CodeIntelUserEnv currently appends a new assignment
every time, so repeated runs create duplicate stale entries in env.ps1. Update
the Set-CodeIntelUserEnv flow around $configDir, $envFile, and the final
Add-Content write so it first removes any existing `$env:$Name = ...` line for
the same variable name before appending the new value. Keep the existing
Add-Content behavior for preserving other variables, but ensure the env.ps1 file
stays deduplicated per $Name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a5d685a-49f1-43b7-a591-ff93696de030

📥 Commits

Reviewing files that changed from the base of the PR and between b83f08e and e2005b3.

📒 Files selected for processing (2)
  • install-code-intel-pipeline.ps1
  • tools/code-intel-platform.psm1

@2233admin
2233admin force-pushed the codex/cross-platform-pwsh7 branch 2 times, most recently from c1e3155 to 6b6f0cb Compare July 1, 2026 20:14
@2233admin

Copy link
Copy Markdown
Owner

Superseded: PR #2 was rebased onto main's current architecture (per ADR 0005, the Ponytail-vendoring commits were dropped) and merged directly. This branch's history no longer applies; closing as superseded.

@2233admin 2233admin closed this Jul 1, 2026
@2233admin
2233admin deleted the coderabbitai/autofix/b83f08e branch July 2, 2026 16:52
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