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
shellNo 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. - Assistant
I'll start by exploring the repository structure to understand the codebase and locate the installer-related code. Let's first see what's in the current directory.
- Assistant
Let me get a broader view of the repository structure.
- Assistant
This looks like a Go project (go.mod, go.sum). Let me explore the cmd directory and internal directory to understand the structure better.
- Assistant
Let me look for installer-related files and search for "Pi" or "pi" in the codebase.
- Assistant
Let me look at the internal directory structure more closely, especially focusing on the installer and TUI components.
- Assistant
Let me look at the TUI directory which likely contains the installer UI, and the installcmd directory.
- Assistant
Let me search for "Pi" related terms and "back" navigation in the codebase.
- Assistant
Let me examine the TUI model and router to understand the navigation flow.
- Assistant
Let me look for the screen navigation logic and specifically how the "Back" button works.
- Assistant
Let me search for "back" or "previous" related navigation logic.
- Assistant
Let me look for the navigation function that handles "Back" button in the installer.
- Assistant
Let me find the
goBack()function. - Assistant
Let me examine the goBack function to understand how it works.
- Assistant
Let me continue reading the goBack function.
- Assistant
Let me continue reading the goBack function.
- Assistant
Let me look at the PreviousScreen function and the routing logic.
- Assistant
Let me look for the PreviousScreen function in other files.
- Assistant
Let me examine the router.go file.
- Assistant
Now I understand the structure. The issue is about back navigation from Pi-only install. Let me look at the ScreenAgents screen which seems to be where Pi would be selected as an installation target.
- Assistant
Let me look at the
isPiOnlyAgentsfunction and how it's used in the navigation flow. - Assistant
Now let me look at what happens when Pi-only agents are selected - specifically the forward navigation from ScreenAgents.
- Assistant
Let me trace through the navigation flow more carefully. When Pi-only is selected, it goes directly to
ScreenDependencyTree. Let me check what happens when going back fromScreenDependencyTreein thegoBack()function. - Assistant
Let me check what the Preset is set to in the Pi-only path and what
shouldShow*functions return. - Assistant
Let me look at the
shouldShow*functions to understand what they check. - Assistant
Let me check these functions to understand what conditions they check.
- Assistant
Let me look at the
shouldShowStrictTDDScreenandshouldShowClaudeModelPickerScreenfunctions. - Assistant
Let me look at how the initial model is created and what happens with the Pi-only path.
- Assistant
Let me look at the
confirmSelectionfunction and how the navigation flows fromScreenDependencyTree. - Assistant
Now I understand the issue. Let me trace the flow:
- When only Pi is selected as the agent (
isPiOnlyAgents()returns true), the flow goes directly fromScreenAgents→ScreenDependencyTree(skipping Persona, Preset, etc.) - The
Presetis still set tomodel.PresetFullGentleman(from initial model setup) - When pressing Back from
ScreenDependencyTree, thegoBack()function checks if Preset != Custom (true), then checksshouldShowStrictTDDScreen()etc. - Since
piOnlyComponents()only includesComponentEngram, none of the conditions match - It falls through to
PreviousScreen(m.Screen)which returnsScreenPreset(from linearRoutes) ScreenPresetshows TDD configuration, multi-agent setup, etc. - unrelated to Pi-only installation
The fix should be: when going back from
ScreenDependencyTreewith Pi-only agents, navigate toScreenAgentsinstead ofScreenPreset.Let me first look at the relevant section of the goBack function more closely to understand the exact fix location:
- When only Pi is selected as the agent (
- Assistant
Now let me look at the
confirmSelectionfunction to see howScreenDependencyTreeis handled for Pi-only: - Assistant
Let me check the existing tests for this scenario:
- Assistant
Let me search for test cases related to the Pi-only flow and back navigation.
- Assistant
Let me look at those tests to understand the expected behavior better.
- Assistant
Let me also check the tests for back navigation from DependencyTree:
- Assistant
Now I have a clear understanding of the issue. Let me trace through the problem:
-
When only Pi is selected as the installation target, the code at line 1489-1493 detects this via
isPiOnlyAgents()and jumps directly toScreenDependencyTree, skippingScreenPersona,ScreenPreset, etc. -
When the user presses Back from
ScreenDependencyTree, thegoBack()function is called. -
In
goBack(), the code checks:- If we're on
ScreenDependencyTreeand preset is not custom (line 2436), it tries to navigate toStrictTDD,ClaudeModelPicker, etc. if they should be shown - Since only Pi is selected (not Claude, not OpenCode), none of those
shouldShow*functions return true - So it falls through to the bottom of
goBack()where it usesPreviousScreen()(line 2590) PreviousScreen(ScreenDependencyTree)returnsScreenPreset(line 15 in router.go)
- If we're on
-
So when going back from in a Pi-only flow, it goes to , which shows TDD configuration, multi-agent setup, communication style, etc. - these are unrelated to Pi-only installation.
-
- Assistant
Now I understand the exact issue. The fix needs to be in the
goBack()function. When we're onScreenDependencyTreeand the user is in a Pi-only flow (i.e.,isPiOnlyAgents(m.Selection.Agents)is true), pressing Back should go toScreenAgentsinstead of falling through toScreenPreset.Let me add this fix:
- Assistant
Now I understand the issue completely. The problem is:
- When only Pi is selected, the installer skips directly to
ScreenDependencyTree(line 1491). - When pressing Back on
ScreenDependencyTree, thegoBack()function falls through because none of theshouldShow*checks match for Pi-only, and eventually hitsPreviousScreen(m.Screen)which returnsScreenPreset— showing TDD config, multi-agent setup, speaking style, etc.
The fix is to add a Pi-only check at the top of the
ScreenDependencyTreeback navigation block so it goes back toScreenAgentsinstead. - When only Pi is selected, the installer skips directly to
- Assistant
Now let me also check the
confirmSelection()forScreenDependencyTreebecause the comment says to keep it in sync. Let me look at that: - Assistant
Let me look at the
confirmSelection()forScreenDependencyTree: - Assistant
Let me look at the full back logic in
confirmSelection()forScreenDependencyTree: - Assistant
I also need to fix the
confirmSelection()forScreenDependencyTreeto handle Pi-only. Let me look at that section: - Assistant
I need to fix this section too. The
elsebranch at line 1825 falls back toScreenPreset, but for Pi-only it should go toScreenAgents: - Assistant
Let me check the context around the edit to make sure the code is correct:
- Assistant
I see there's a duplicate comment and the code structure seems broken. Let me check the original structure and fix this. First let me look at what the original code looked like:
- Assistant
I see the issue - my first edit accidentally removed the
case ScreenSkillPicker:line. Let me fix this: - Assistant
Now let me re-apply both changes properly. First the
goBack()function: - Assistant
Let me fix the
goBack()function for theScreenDependencyTreecase: - Assistant
Good. Now let me fix the
confirmSelection()forScreenDependencyTree. Let me look at that section: - Assistant
Now let me fix lines 1804-1823 in the
confirmSelection()function: - Assistant
Now let me verify the changes look correct by checking the diff:
- Assistant
Good, the changes look correct. Now let me run the existing tests to make sure I haven't broken anything:
- Assistant
Let me check the Go environment setup:
- Assistant
The go module cache is not found. Let me set the GOPATH properly.
- Assistant
Now let me run the existing tests to make sure I haven't broken anything:
- Assistant
Let me set HOME as well.
- Assistant
All tests pass. Let me run the full test suite to make sure I haven't broken anything:
- Assistant
All tests pass. Let me also run the full test suite for the whole project to be thorough:
- Assistant
The full test suite timed out. The TUI tests already passed. Let me run a quick check on the most relevant packages:
- Assistant
All TUI tests pass. Let me verify the build compiles:
- Assistant
Build compiles successfully. Let me review the final diff one more time to make sure everything is clean:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.