Skip to content

fix(examples): re-prompt session menu on invalid choice in nav demo - #69

Merged
Zhiyue-Wang merged 1 commit into
huaweicloud:mainfrom
Isuzu-ren:fix/examples-nav-session-select
Oct 12, 2026
Merged

Zhiyue-Wang merged 1 commit into
huaweicloud:mainfrom
Isuzu-ren:fix/examples-nav-session-select

Conversation

@Isuzu-ren

Copy link
Copy Markdown
Contributor

The navigation demo's CLI session selection silently created a brand new empty session whenever the user entered an unexpected key. A stray keystroke should never spawn an empty conversation, so the menu is now wrapped in a loop that re-prompts on invalid input instead. The misleading "[2]" header on the resume section was also dropped in favor of a plain text label, and the dead start_index variable was removed along the way.

The behavior of the valid choices is unchanged: "1" starts a new session and a numeric choice resumes the matching existing session. Only invalid input now behaves differently — it shows an error message and redraws the menu. The fix mirrors what the finance_adk demo already does in its session manager.

Verified locally with a syntax check; the TUI path needs no change since its modal session picker already rejects invalid selections without creating anything.

CLI session selection silently created a new empty session when the user entered an unexpected key. Wrap the menu in a loop so invalid choices re-prompt instead of spawning a conversation.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@a4b7157). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #69   +/-   ##
=======================================
  Coverage        ?   58.90%           
=======================================
  Files           ?      109           
  Lines           ?     9581           
  Branches        ?     1496           
=======================================
  Hits            ?     5644           
  Misses          ?     3528           
  Partials        ?      409           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Zhiyue-Wang
Zhiyue-Wang merged commit 4940dc6 into huaweicloud:main Oct 12, 2026
6 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.

3 participants