ISSUE DESCRIPTION fix(installer): back navigation from Pi-only install shows unrelated…
- User
ISSUE DESCRIPTION
fix(installer): back navigation from Pi-only install shows unrelated Gentle AI configuration
Pre-flight Checklist
- I have searched existing issues and this is not a duplicate
- I understand that PRs will be rejected if the linked issue does not have
status:approved
📝 Bug Description
When running the
gentle-piinstaller fromgentle-ai, if I select onlyPias the installation target and then useBackon the next step,
the installer returns to an unexpected configuration flow.Instead of going back to the previous installation target selection, it shows configuration options that do not correspond to the selected
Pi-only path, such as TDD configuration, multi-agent installation, communication style, and related Gentle AI setup options.🔄 Steps to Reproduce
- Start the
gentle-aiinstaller.
2. Select onlyPias the installation target.
3. Continue to the next step.
4. SelectBack.
5. Observe that the installer shows configuration screens for TDD, multi-agent setup, speaking style, etc.
✅ Expected Behavior
After selecting
Back, the installer should return to the previous relevant step in the Pi-only installation flow, likely the installation
target selection screen.❌ Actual Behavior
The installer jumps to unrelated Gentle AI configuration screens, including TDD setup, multi-agent installation, communication style, and other
options that were not expected after choosing a Pi-only installation.Gentle AI Version
v 1.30.5
Operating System
macOS
AI Agent / Client
Other
📋 Affected Area
CLI (commands, flags)
💡 Logs / Error Output
No logs available. This appears to be an installer navigation/state-flow issue.Additional Context
This happens specifically when selecting only
Piduring installation and then navigating back from the following step.ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use to restore the file to its original state. You can also reset all changes in the repository using command. Additionally, you can use and to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call ) using or commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted.
- Assistant
I'll start by exploring the repository structure to understand the codebase and locate the installer-related code. Let's first get an overview.
- Assistant
Let me explore the repository structure more to understand the codebase.
- Assistant
This looks like a Go project (has go.mod). Let's look at the cmd directory and internal directories to understand the structure better.
- Assistant
Let me explore the project structure more thoroughly.
- Assistant
Let me explore the installcmd directory first since that seems to be the installer command directory.
- Assistant
Let me look at the TUI directory since this is a navigation/state-flow issue in the installer.
- Assistant
Let me look at the router.go file to understand how navigation works.
- Assistant
Let me explore the TUI screens directory to understand the different screens available.
- Assistant
Let me look at the model.go file to understand the screens and navigation logic better.
- Assistant
Let me search for the screen types and state management to understand the navigation flow:
- Assistant
Let me search for "pi" related content in the codebase:
- Assistant
Let me look for "Pi" more broadly - it could be a product name or feature:
- Assistant
Let me look at the agents directory to understand the structure better.
- Assistant
Now let me understand the flow better. Let me look at the welcome screen and how the installation flow works:
- Assistant
Let me search for how the "Start installation" option is handled:
- Assistant
Let me look at how the welcome screen handles user selection:
- Assistant
Let me look at the agents screen and how it handles back navigation:
- Assistant
Let me search for how the model handles ScreenAgents:
- Assistant
Let me look at the specific lines around ScreenAgents to understand how the navigation works:
- Assistant
Let me look at the goBack function to understand how back navigation works: more functions of interest Let me also look for the
pispecific case. Looking at the issue description, the issue is that when onlyPiis selected, pressing "Back" goes to an unrelated configuration flow (TDD configuration, multi-agent installation, etc.) instead of going back to the installation target selection screen.Let me look at how the flow works after selecting agents and see if there's special handling for Pi-only installation.Let me look at how the flow works after selecting agents. Let me search for how the model handles forward navigation from ScreenAgents:
- Assistant
Let me search for the key logic where the installer handles forward/back navigation from the agents screen:
- Assistant
Good, I found the key functions. Let me look at them:
- Assistant
Now let me look at the forward navigation from ScreenAgents to see what happens when only Pi is selected:
- Assistant
Now I understand the issue. When Pi is the only selected agent, the flow goes from
ScreenAgents→ScreenDependencyTree, skippingScreenPersonaandScreenPreset. But the router saysScreenDependencyTreegoes back toScreenPreset, which is unrelated configuration. Let me look at thegoBack()function: - Assistant
Now I can see the problem. When only Pi is selected, the flow goes from
ScreenAgentsdirectly toScreenDependencyTree, but thegoBack()function doesn't handle this case. Let me look at the rest of thegoBack()function: - Assistant
Now I understand the issue completely. Let me look at how the forward flow works for Pi-only more carefully:
- Assistant
Now I understand the issue. When Pi-only is selected:
- Forward:
ScreenAgents→ScreenDependencyTree(skippingScreenPersonaandScreenPreset) - Backward from
ScreenDependencyTree: thegoBack()function falls through toPreviousScreen(m.Screen)which returnsScreenPresetfromlinearRoutes
The fix should be: in
goBack(), when onScreenDependencyTreeand agents are Pi-only, go back toScreenAgents.Let me also check if there's a similar issue in
confirmSelection()that was mentioned in the comments: - Forward:
- Assistant
Let me look at the
confirmSelectionfunction for the dependency tree back logic: - Assistant
Let me look at how the back button is handled on the DependencyTree screen:
- Assistant
Let me look at the confirmSelection case for ScreenDependencyTree and the back button handling:
- Assistant
Let me continue reading to see where it falls through:
- Assistant
Now I can see the issue clearly. Let me look at the specific section in
goBack()that handlesScreenDependencyTree: - Assistant
Now I understand the issue. When Pi-only is selected:
- Forward flow: ScreenAgents → ScreenDependencyTree (skipping ScreenPersona and ScreenPreset)
- Back from ScreenDependencyTree: The
goBack()checkm.Selection.Preset != model.PresetCustomis true (because preset isPresetFullGentlemanby default), and since none of theshouldShow*checks match for Pi, it falls through toPreviousScreen(ScreenDependencyTree)which returnsScreenPreset.
But the user never went through ScreenPreset, so it shows unrelated configuration. Let me verify what preset is set when Pi-only:
- Assistant
Now let me also look at the
confirmSelection()handling forScreenDependencyTreeto understand the full picture: - Assistant
Now I understand the issue completely. Let me trace the flow:
- Pi-only selected → ScreenAgents "Continue" →
isPiOnlyAgentsis true → skips ScreenPersona/ScreenPreset → goes to ScreenDependencyTree - From ScreenDependencyTree, pressing "Back" →
goBack()checksm.Screen == ScreenDependencyTree && m.Selection.Preset != model.PresetCustom(this is true because default preset isPresetFullGentleman) - None of the
shouldShow*checks match for Pi-only - Falls through to
PreviousScreen(m.Screen)which returnsScreenPresetfromlinearRoutes
The fix needs to be in both
goBack()andconfirmSelection()- when on ScreenDependencyTree and agents are Pi-only, go back to ScreenAgents. Let me make the fix: - Pi-only selected → ScreenAgents "Continue" →
- Assistant
Now I understand the issue completely. When Pi-only is selected:
- Forward flow:
ScreenAgents→ScreenDependencyTree(skipsScreenPersonaandScreenPreset) - Backward flow:
ScreenDependencyTree→ checksm.Selection.Preset != model.PresetCustom(true since Pi flow doesn't go through preset selection), then checks variousshouldShow*screens which are all false for Pi-only, so it falls through toPreviousScreen(m.Screen)→ScreenPreset
The fix: When on
ScreenDependencyTreeand agents are Pi-only, go back toScreenAgentsinstead of following the normal non-custom preset flow. I need to fix bothgoBack()and theconfirmSelection()"Back" path.Let me also check existing tests for this:
- Forward flow:
- Assistant
Let me look at the existing Pi-only test to understand the expected behavior:
- Assistant
Now I understand the issue completely. When Pi-only is selected:
- Forward:
ScreenAgents→ScreenDependencyTree(skippingScreenPersonaandScreenPreset) - Back from ScreenDependencyTree in
goBack(): The checkm.Screen == ScreenDependencyTree && m.Selection.Preset != model.PresetCustomevaluates to true, but none of theshouldShow*conditions match, so it falls through toPreviousScreen(m.Screen)which returnsScreenPresetfrom the linear routes - Back from ScreenDependencyTree in
confirmSelection(): The else branch at the end setsm.setScreen(ScreenPreset)when none of the intermediate screens apply
Both paths need fixing. Let me fix the
goBack()function first: - Forward:
- Assistant
Now I understand the issue. The forward flow for Pi-only skips
ScreenPersonaandScreenPreset, going directly fromScreenAgents→ScreenDependencyTree. But when pressing Back, thegoBack()function checks for non-custom preset and tries to navigate through the intermediate screens (SDDMode, StrictTDD, ClaudeModelPicker), all of which are false for Pi-only. It then falls through to the linear route fallback which sends it toScreenPreset(the backward route forScreenDependencyTreeinlinearRoutes).The fix needs to handle Pi-only in both
goBack()andconfirmSelection(). Let me also check theconfirmSelection()code: - Assistant
Now I understand the issue fully. I need to fix both places:
goBack()- line 2436: After the existing check form.Screen == ScreenDependencyTree && m.Selection.Preset != model.PresetCustom, if none of the shouldShow* conditions match, it falls through toPreviousScreen(m.Screen)which returnsScreenPreset. I need to add a Pi-only check.confirmSelection()- line 1820: The else clausem.setScreen(ScreenPreset)needs a Pi-only check.
Let me fix both places:
- Assistant
I see there's a duplicate comment block. Let me fix that:
- Assistant
There's an extra closing brace on line 2442. Let me fix that:
- Assistant
There's a duplicate line. Let me fix it:
- Assistant
Good, the
goBack()function is fixed. Now I need to fix theconfirmSelection()function as well. Let me look at the relevant part: - Assistant
Now I need to fix the
confirmSelection()function as well. The issue is in the else clause where it falls back toScreenPreset. I need to add a Pi-only check before that: - Assistant
Now let me verify the code compiles and run the tests:
- Assistant
Let me check the Go environment.
- Assistant
Let me set up the environment properly.
- Assistant
Good, the build succeeds. Now let me run the tests:
- Assistant
Good, the existing tests pass. Let me also run all the tests to make sure I haven't broken anything:
- Assistant
All tests pass. Let me also run the full test suite to make sure nothing else is broken:
- Assistant
The full test suite timed out. Let me run just the relevant tests instead:
- Assistant
All tests pass. Let me now verify the changes I made by reviewing them:
- Assistant
The changes look correct. Let me run the tests one more time to confirm everything passes:
- Assistant
All tests pass. Let me now review the final changes one more time to make sure everything is correct:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.