Skip to content

Conversation

Darknoon5891
Copy link

Correct PowerShell comment syntax and process-specific exit code handling in run-server.ps1

Description

This PR fixes syntax errors in run-server.ps1 introduced in commit fe9968b when Qwen Code support was added. The issues prevented proper script execution and caused false failure reports.

Changes Made

  • Fixed unclosed comment block (lines 1518-1728) - Properly closed PowerShell comment on line 1594 instead of leaving it open until line 1728, which was commenting out critical code
  • Fixed process-specific exit code handling (lines 695-700) - Changed $LASTEXITCODE to process-specific exit code checking to prevent false "uv failed" errors on multiple runs

Testing

Please review our Testing Guide before submitting.

Run all linting and tests (required):

  • All linting passes (ruff, black, isort)
  • All unit tests pass
  • Manual testing completed with realistic scenarios

Related Issues

Fixes #280

Checklist

  • PR title follows the format guidelines above
  • Activated venv and ran code quality checks: source venv/bin/activate && ./code_quality_checks.sh
  • Self-review completed
  • Tests added for ALL changes (see Testing section above)
  • Documentation updated as needed
  • All unit tests passing
  • Relevant simulator tests passing (if tool changes)
  • Ready for review

DarkNoon5891 added 2 commits October 7, 2025 20:05
… Made Installing dependencies with uv safer on fail. Fixed syntax issue on line 1728.
Copy link
Contributor

Summary of Changes

Hello @Darknoon5891, 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 focuses on enhancing the robustness and correctness of the run-server.ps1 script. It addresses critical syntax errors that prevented proper script execution and refines the handling of external process exit codes to eliminate misleading failure reports, particularly after the integration of Qwen Code support.

Highlights

  • PowerShell Comment Syntax: Corrected an unclosed comment block in run-server.ps1 that was inadvertently commenting out critical code related to Qwen Code support, ensuring proper script execution.
  • Process Exit Code Handling: Implemented process-specific exit code checking instead of relying on $LASTEXITCODE for uv installations. This resolves issues where false 'uv failed' errors occurred on multiple runs, improving the reliability of dependency installation.
  • Code Readability and Formatting: Improved script readability by reformatting catch blocks and aligning key-value pairs in hashtables, enhancing maintainability.
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

This pull request successfully addresses two critical issues in run-server.ps1: an unclosed comment block that was disabling a large portion of the script, and incorrect exit code handling for the uv process. The change to use process-specific exit codes instead of $LASTEXITCODE is a significant improvement in reliability. The PR also includes numerous stylistic updates, such as moving catch and else blocks to new lines and aligning hashtables, which enhance code readability and consistency. However, I've identified a critical regression in the .env file parsing logic that needs to be addressed.

if ($line -match '^([^#][^=]*?)=(.*)$') {
$key = $matches[1].Trim()
$value = $matches[2].Trim() -replace '^["'']|["'']$', ''
$value = $matches[2].Trim() -replace '^["'']| ["'']$', ''
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The regular expression used to remove quotes from environment variable values has been modified incorrectly. An extra space was added to the pattern, which will cause it to fail for correctly quoted values like "VALUE". This will lead to incorrect parsing of the .env file and likely cause configuration-related failures. The space appears to be a typo and should be removed to restore the correct behavior.

$value = $matches[2].Trim() -replace '^["''']|["''']$', ''

Copy link
Member

Choose a reason for hiding this comment

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

Yes this looks like an issue

@guidedways
Copy link
Member

Thank you!

@guidedways guidedways merged commit 7a2fac1 into BeehiveInnovations:main Oct 8, 2025
5 checks passed
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.

run-server.ps1 syntax issue

2 participants