Skip to content

fix: prompt when network argument is empty - #407

Open
ayaanoncrypto wants to merge 1 commit into
genlayerlabs:v0.40-devfrom
ayaanoncrypto:fix/empty-network-selection
Open

fix: prompt when network argument is empty#407
ayaanoncrypto wants to merge 1 commit into
genlayerlabs:v0.40-devfrom
ayaanoncrypto:fix/empty-network-selection

Conversation

@ayaanoncrypto

@ayaanoncrypto ayaanoncrypto commented Aug 19, 2026

Copy link
Copy Markdown

Closes #306

Summary

Treat an empty network argument as omitted so genlayer network set "" opens the interactive network selector instead of attempting to resolve an empty alias.

Changes

  • Simplified the explicit-network condition to require a non-empty value.
    • Updated the focused test to verify prompting, configuration, and success output for an empty argument.

Validation

git diff --check passed. Local Vitest and TypeScript binaries were unavailable in the sandbox.

Summary by CodeRabbit

  • Bug Fixes
    • Improved network selection when no network is specified.
    • Users are now prompted to choose a network instead of receiving an error for an empty selection.
    • Interactive configuration can successfully proceed with the selected local network.

@github-actions
github-actions Bot changed the base branch from main to v0.40-dev August 19, 2026 18:46
@github-actions

Copy link
Copy Markdown

This PR targeted main, which is only the default/static branch.

I retargeted it to v0.40-dev, the active development branch. Pushes to v0.40-dev automatically fast-forward main.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a47550ad-358b-470b-8a4c-44a6e5feb780

📥 Commits

Reviewing files that changed from the base of the PR and between 3396474 and 628db53.

📒 Files selected for processing (2)
  • src/commands/network/setNetwork.ts
  • tests/actions/setNetwork.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

setNetwork("") now opens the interactive network picker. The test selects localnet and verifies configuration and success feedback.

Changes

Network selection

Layer / File(s) Summary
Interactive handling for empty input
src/commands/network/setNetwork.ts, tests/actions/setNetwork.test.ts
The explicit-selection guard now excludes empty strings. The test mocks the prompt and verifies successful localnet configuration and feedback.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 628db

This localized change makes an empty network argument open the interactive selector, with no actionable merge-blocking risk remaining after normal checks and review.

Suggested reviewers: muncleuscles

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the fix: prompt when the network argument is empty.
Linked Issues check ✅ Passed The change treats an empty string as omitted and routes execution to the interactive network selector, matching issue #306.
Out of Scope Changes check ✅ Passed The source change and focused test update directly support issue #306 and the stated pull request objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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.

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.

[Bug] setNetwork treats empty string argument as valid input bypassing interactive prompt

1 participant