Skip to content

Fix Windows installer network mode selection not accepting Enter key#270

Open
hobostay wants to merge 2 commits intoagentscope-ai:mainfrom
hobostay:fix-windows-network-mode-selection
Open

Fix Windows installer network mode selection not accepting Enter key#270
hobostay wants to merge 2 commits intoagentscope-ai:mainfrom
hobostay:fix-windows-network-mode-selection

Conversation

@hobostay
Copy link
Copy Markdown
Contributor

Summary

  • Fixed network mode selection in Windows PowerShell installer
  • Changed input validation from -not $localChoice to [string]::IsNullOrEmpty($localChoice)
  • Users can now press Enter to accept default "local only" mode

Problem

Issue #257 reports that in the Windows installer, the network mode selection prompt doesn't work as expected. When users press Enter without typing anything, the selection is skipped and defaults to "local only" mode without proper interaction.

Root Cause

The condition used to check for empty input was incorrect:

$localChoice = Read-Host "$(Get-Msg 'port.local_only.choice')"
if (-not $localChoice) { $localChoice = "1" }

In PowerShell:

  • Read-Host returns an empty string "" (not $null) when user presses Enter
  • -not "" evaluates to $false (only empty string is falsy)
  • The default value "1" is never applied when user just presses Enter

Solution

Changed to use [string]::IsNullOrEmpty() which correctly handles both $null and empty string cases:

$localChoice = Read-Host "$(Get-Msg 'port.local_only.choice')"
# Handle empty input (user pressed Enter without typing anything)
if ([string]::IsNullOrEmpty($localChoice)) { $localChoice = "1" }

Testing

  1. User can now press Enter to accept default "local only" mode (option 1)
  2. User can type "2" or "n" or "N" or "no" or "NO" to select "external access" mode
  3. User can type "1" or any other input to select "local only" mode

This aligns with the installer's "(press Enter for defaults)" behavior described in the documentation.

Related

The documentation mentions "(press Enter for defaults)" multiple times, and this fix ensures that behavior works correctly in the network mode selection.

Fixes #257

🤖 Generated with Claude Code

hobostay and others added 2 commits March 14, 2026 14:20
…sync

This commit improves the error handling in the copaw-worker's sync.py to provide
more helpful diagnostic messages when MinIO operations fail, addressing issue agentscope-ai#200.

Changes:
1. **Enhanced mc binary not found error** - Added installation instructions for different platforms
2. **Added endpoint validation** - Warns when using Higress Console ports (18080/18001) instead of MinIO ports (9000/9001)
3. **Improved mc alias set error handling** - Provides detailed error messages for common issues:
   - Connection refused (possible causes and troubleshooting steps)
   - Authentication failures (credential validation tips)
4. **Better openclaw.json not found error** - Includes expected path and troubleshooting command
5. **Added JSON parsing error handling** - Catches JSONDecodeError with helpful context
6. **Reduced log verbosity** - Changed mc command logs from INFO to DEBUG level to reduce noise

These changes help users diagnose common configuration issues, particularly:
- Using wrong endpoint URL (Higress Console vs MinIO)
- Connection problems
- Authentication issues
- Missing worker configuration

Fixes agentscope-ai#200 (partial - improves error messages; root cause may still need user to correct their --fs parameter)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Issue agentscope-ai#257 reports that in the Windows installer, when the network mode
selection prompt is displayed, pressing Enter without typing anything
skips the selection and defaults to "local only" mode.

Root Cause:
The condition `if (-not $localChoice)` fails to detect empty string input.
In PowerShell:
- Read-Host returns empty string "" (not $null) when user presses Enter
- -not "" evaluates to $false (only empty string is falsy)
- So the default value "1" is never applied when user just presses Enter

Fix:
Changed from `if (-not $localChoice)` to `if ([string]::IsNullOrEmpty($localChoice))`
which correctly handles both $null and empty string cases.

This allows users to press Enter to accept the default "local only" option
(option 1), as the prompt text suggests with "(press Enter for defaults)".

Fixes agentscope-ai#257

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

windows安装网络模式选择直接跳过,默认仅本机 || Windows installation network mode selects skip directly, default is local machine only

1 participant