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
Let me start by exploring the repository structure to understand the codebase and locate the installer-related files.
Assistant
This is a Go project. Let me search for the installer-related files, particularly for "gentle-pi" installer.
Assistant
Let me search for the TUI-related files, as the issue mentions an installer that seems to have a UI/navigation component.
<tool_call> <function=bash_terminal> <parameter=command> find . -type f -name "*.go" | xargs grep -l "gentle-pi" 2>/dev/null | head -20 </tool_call>
Assistant
Let me search for gentle-pi related files in the repository.
Assistant
The issue seems to be about an installer UI flow. Let me look at the TUI (Terminal User Interface) related files, especially the screens directory which likely contains the installer navigation logic.
<tool_call> <function=bash_terminal> <parameter=command> ls -la internal/tui/screens/ </tool_call>
Assistant
Let me try again with a proper function call.
Assistant
Let me look for "Back" navigation functionality and "TDD" related code to understand the navigation flow.
<tool_call> <function=bash_terminal> <parameter=command> grep -r "Back" --include="*.go" internal/tui/screens/ | head -30 </tool_call>
Assistant
Let me try again with the search command.
Assistant
Let me search for the TDD-related files since the issue mentions "TDD configuration" as one of the screens that shouldn't appear.
<tool_call> <function=bash_terminal> <parameter=command> grep -r "TDD" --include="*.go" internal/tui/screens/ | head -30 </tool_call>
Assistant
I need to use the proper function call format. Let me try again with the search.
Assistant
Now let me look at the main model file to understand the navigation flow and state machine of the TUI.
<tool_call> <function=bash_terminal> <parameter=command> cat internal/tui/model.go | head -200 </tool_call>
Assistant
I need to use the proper function call format to run terminal commands. Let me do that.
Assistant
Let me look at more of the model file and understand the navigation flow.
Assistant
Let me search for the Back navigation handling in the model file.
<tool_call> <function=bash_terminal> <parameter=command> grep -n "Back" internal/tui/model.go | head -50 </tool_call>
Assistant
I need to use the proper function call format to run the grep command.
Assistant
Let me search for the Back button handling in the model file to understand the navigation flow.
Assistant
Now let me look at the
shouldShowStrictTDDScreenfunction to understand how the TDD screen is shown, and also look at the back navigation logic.<tool_call> <function=bash_terminal> <parameter=command> grep -n "shouldShowStrictTDDScreen" internal/tui/model.go </tool_call>
Assistant
The terminal tool seems to be having issues. Let me try again with a simpler command.
Assistant
Now let me look at the
shouldShowStrictTDDScreenfunction and understand how the navigation works.Assistant
Let me understand the issue better. The bug is about the installer navigation showing incorrect screens after selecting "Back" when in a Pi-only installation flow. Let me look at the
NewModelfunction andpiOnlyComponentsfunction to understand how the Pi-only installation is handled.Assistant
Let me look at the
piOnlyComponentsandisPiOnlyAgentsfunctions, as well as understand what components are included.Assistant
Now I see the issue! The
piOnlyComponentsfunction only returns[model.ComponentEngram]but theshouldShowStrictTDDScreen()function checks formodel.ComponentSDD. This means if the SDD component was somehow selected alongside the Pi agent, it would show the Strict TDD screen which is wrong for Pi-only installations.Let me look at how the installation flow navigates and what the issue might be. Let me search for where the Back navigation is handled and how the screens flow works.
<tool_call> <function=bash_terminal> <parameter=command> sed -n '780,950p' internal/tui/model.go </tool_call>
Assistant
I need to keep using the proper function call format for bash commands. Let me try again.
Assistant
Now let me understand the issue better. The issue mentions that when:
- Start the gentle-ai installer
- Select only Pi as the installation target
- Continue to the next step
- Select Back
The installer should return to the installation target selection screen, but instead it shows configuration screens for TDD, multi-agent installation, etc.
Let me look at how the agents screen works and how the back navigation from subsequent screens should work.
<tool_call> <function=bash_terminal> <parameter=command> cat internal/tui/screens/agents.go </tool_call>
Assistant
Let me try a different approach to look at the agents.go file.
Assistant
Now let me understand the flow better. The issue is that when you go back from subsequent screens, it doesn't go back to the correct screen. Let me look at how the back button is handled from the agent builder and other screens.
Let me look at more of the model.go file to see how back navigation works.
Assistant
Now let me look at the
goBackfunction to understand how the navigation history is handled.Assistant
Let me look at the
goBackfunction to see how it determines the previous screen.Assistant
Let me continue reading the goBack function to understand how it handles the case when going back from SDDMode and other screens.
<tool_call> <function=bash_terminal> <parameter=command> sed -n '2500,2600p' internal/tui/model.go </tool_call>
Assistant
The terminal seems to be having issues with the function call. Let me try with a different approach to get the goBack function content.
Assistant
Now let me understand the issue better. The issue is that when going back from the StrictTDD screen, the navigation doesn't correctly handle the case where only Pi is selected.
Let me look at the
shouldShowStrictTDDScreenfunction again and understand how the back navigation should work.<tool_call> <function=bash_terminal> <parameter=command> sed -n '3213,3225p' internal/tui/model.go </tool_call>
Assistant
Let me try with a simpler sed command to see the shouldShowStrictTDDScreen function.
Assistant
Let me now understand the bug better. The issue says:
- User selects only "Pi" as the installation target
- Continues to next step
- Presses "Back"
Assistant
Let me try using the function call to get the grep results.
Assistant
Let me look at where the StrictTDD screen is shown in the forward flow. I need to find the
shouldShowStrictTDDScreencalls to see when it's shown.<tool_call> <function=bash_terminal> <parameter=command> grep -n "shouldShowStrictTDDScreen" internal/tui/model.go </tool_call>
Assistant
The terminal tool seems to be having issues. Let me try again with a different approach - maybe using a smaller search range or different command.
Assistant
Now I can see the search results. Let me look at the forward flow code to understand when the StrictTDD screen is shown.
Assistant
I need to understand the forward flow better. Let me look at more of the code to see how the StrictTDD screen is shown in the forward direction.
Let me also understand the
shouldShowSDDModeScreenfunction and how it relates to the Pi-only flow.Assistant
Let me look at the
shouldShowSDDModeScreenfunction:Assistant
Now let me understand the issue better. Looking at the code:
shouldShowSDDModeScreen()returns true only whenAgentOpenCodeis selected ANDComponentSDDis selectedshouldShowStrictTDDScreen()returns true only whenComponentSDDis selectedpiOnlyComponents()returns only[model.ComponentEngram], meaning no SDD component
So for Pi-only installations:
isPiOnlyAgents([model.AgentPi])returns truepiOnlyComponents()returns[model.ComponentEngram]shouldShowStrictTDDScreen()returns false (because no SDD component)shouldShowSDDModeScreen()returns false (because AgentPi != AgentOpenCode)
This should be correct behavior - the StrictTDD screen should never be shown for Pi-only installations.
However, the bug report says the user sees TDD, multi-agent, and communication style configuration screens when going back. This suggests the user might have had SDD component selected even though they selected Pi-only.
Let me look at how the Preset screen works and how the components are updated when the Preset is selected.
Assistant
The terminal tool is having issues again. Let me try a different approach.
Assistant
I see many references to ScreenPreset. Let me look at how the Preset screen confirms selections and how it handles going back to the agents screen.
<tool_call> <function=bash_terminal> <parameter=command> sed -n '1503,1550p' internal/tui/model.go </tool_call>
Assistant
I need to keep using the function call format for the terminal commands. Let me try again.
Assistant
Now I see the flow! When the user selects a preset:
- The
ScreenPresetcase checks various conditions in order:shouldShowClaudeModelPickerScreen()- checks for Claude agent + SDD componentshouldShowKiroModelPickerScreen()- checks for Kiro agent + SDD componentshouldShowSDDModeScreen()- checks for OpenCode agent + SDD componentshouldShowStrictTDDScreen()- checks for SDD component only
The problem is that
shouldShowStrictTDDScreen()only checks for the SDD component, not for which agent is selected. For Pi-only installations, the SDD component should not be selected at all (only Engram component is selected viapiOnlyComponents()).Let me check if there's an issue with how the components are updated. Looking at line 469-470:
- The
Assistant
The terminal tool is having issues with the sed command. Let me try a different approach to look at the Preset screen handling.
Assistant
Now I see the flow better. Looking at the
ScreenPresetcase:- When a preset is selected,
m.Selection.Components = componentsForPreset(options[m.Cursor])is called - Then it checks various conditions like
shouldShowClaudeModelPickerScreen(),shouldShowSDDModeScreen(),shouldShowStrictTDDScreen(), etc.
The problem is that the code doesn't check for Pi-only agents before showing these screens! When the user selects Pi only:
isPiOnlyAgents([model.AgentPi])returns true- The components should be updated to
piOnlyComponents()which is only[model.ComponentEngram]
But the
ScreenPresetcase always sets components based on the preset, not based on whether Pi-only agents are selected.Let me check the
componentsForPresetfunction to see what components are returned for different presets:- When a preset is selected,
Assistant
Now I see the problem more clearly! The
componentsForPresetfunction returns different components based on the preset:PresetMinimal:[model.ComponentEngram](no SDD)PresetEcosystemOnly:[model.ComponentEngram, model.ComponentSDD, ...](has SDD)- Default (PresetFullGentleman): has SDD
So when the user selects a preset that includes SDD component (like
PresetEcosystemOnlyorPresetFullGentleman), the SDD component is selected. But when the user selects only the Pi agent, the components should be overridden to only include[model.ComponentEngram].Let me check the code that handles the agents screen to see if the components are updated when agents change:
<tool_call> <function=bash_terminal> <parameter=command> sed -n '1485,1510p' internal/tui/model.go </tool_call>
Assistant
Let me try the sed command again to see the agents screen handling.
Assistant
Ah, I found it! In the
ScreenAgentscase, when the user presses "Continue" (not "Back"), the code checks:goif isPiOnlyAgents(m.Selection.Agents) { m.Selection.Components = piOnlyComponents() m.buildDependencyPlan() m.setScreen(ScreenDependencyTree) return m, nil }This correctly updates the components to
piOnlyComponents()when only Pi is selected. However, this only happens when the user presses "Continue" from the agents screen.But the bug is about what happens when the user:
- Starts the installer
- Selects only Pi as the installation target
- Continues to the next step
- Presses Back
Looking at the flow:
Assistant
Let me try again with a simpler command to see the DependencyTree back navigation logic.
Assistant
Assistant
Let me keep using the proper function call format for the terminal commands.
Assistant
I need to continue reading the goBack function to see what happens after ScreenSDDMode.
<tool_call> <function=bash_terminal> <parameter=command> sed -n '2500,2560p' internal/tui/model.go </tool_call>
Assistant
I need to continue reading the goBack function. Let me use the sed command to get the lines I need.
Assistant
The terminal tool is having issues with the sed command. Let me try a different approach - using a Python script or a different shell command to read the file.
Let me try to look at the complete goBack function using grep to find the end of the function and then extract the relevant parts.
Actually, looking at the code flow I've seen so far, I think the issue is clear now:
-
When the user starts the installer and selects only Pi:
m.Selection.Components = piOnlyComponents()is set to[model.ComponentEngram]m.Selection.Presetremains whatever preset was selected (e.g.,PresetFullGentleman)
-
When going back from
ScreenDependencyTree:- The code checks
m.shouldShowOpenCodePluginsScreen(),m.shouldShowStrictTDDScreen(), etc.
- The code checks
-
Assistant
The terminal tool is having issues again. Let me try again with the proper function call format.
Assistant
Now I see the PreviousScreen references. Let me look for where
PreviousScreenis defined as a function.<tool_call> <function=bash_terminal> <parameter=command> grep -n "func PreviousScreen" internal/tui/model.go </tool_call>
Assistant
The terminal tool keeps having issues. Let me try a different approach to search for the PreviousScreen function.
Assistant
It seems the function doesn't exist as a package-level function. Let me check how PreviousScreen is used in the code.
<tool_call> <function=bash_terminal> <parameter=command> grep -n "PreviousScreen|previous," internal/tui/model.go | head -20 </tool_call>
Assistant
The terminal tool seems to be having issues with my commands. Let me try a different approach and just use the basic bash commands directly.
Assistant
It seems the
PreviousScreenis being called as a function. Let me search for its definition.<tool_call> <function=bash_terminal> <parameter=command> grep -rn "func PreviousScreen" internal/tui/ </tool_call>
Assistant
The terminal tool seems to be having issues. Let me try using cat with a line range instead of grep.
Assistant
The PreviousScreen function is defined in internal/tui/router.go. Let me look at it.
<tool_call> <function=bash_terminal> <parameter=command> cat internal/tui/router.go </tool_call>
Assistant
The terminal tool is having issues with my commands. Let me try again with a proper function call format.
Assistant
Assistant
The terminal tool is having issues with my commands. Let me try a different approach to find the shouldShowOpenCodePluginsScreen function.
Assistant
Let me look at the shouldShowOpenCodePluginsScreen function to understand what it checks.
Assistant
Now I understand better. The
shouldShowOpenCodePluginsScreen()checks ifAgentOpenCodeis selected, which is not the case for Pi-only.Let me think about this more carefully. The bug says:
- User selects only Pi as the installation target
- User continues to the next step
- User presses Back
- User sees configuration screens (TDD, multi-agent, etc.)
The "next step" after selecting Pi-only is
ScreenDependencyTree. When the user presses Back from :Assistant
Assistant
The terminal tool is having issues with my commands. Let me try again with the proper function call format.
Assistant
Now I have a better understanding of the issue. The bug is about navigation flow when only Pi agent is selected. Looking at the code:
- When Pi-only is selected, the flow goes:
ScreenAgents→ScreenDependencyTree(skipping Persona/Preset) - When pressing Back from
ScreenDependencyTree, the current code checks for SDD-related screens but then falls through toScreenPresetinstead of going back toScreenAgents - This causes the user to land on
ScreenPreset(with the default preset) and then see configuration screens
The fix should add a check for Pi-only agents when going back from
ScreenDependencyTreeto navigate directly toScreenAgents.Let me first check the exact location and structure of the code to make the proper fix:
- When Pi-only is selected, the flow goes:
Assistant
Now I understand the issue. The problem is that when the user selects only Pi agent and presses Back from
ScreenDependencyTree, the code doesn't properly handle the Pi-only flow and falls through toScreenPresetinstead of going back toScreenAgents.The fix should add a check for Pi-only agents in the
goBackfunction forScreenDependencyTree. Let me make the fix:Assistant
Now I need to add a check for Pi-only agents in the goBack function. The issue is that when the user selects only Pi and presses Back from
ScreenDependencyTree, the code should navigate toScreenAgentsinstead of following the normal flow that leads to configuration screens.Let me make the fix by adding the Pi-only check:
Assistant
Let me add the Pi-only check right after the existing checks in the ScreenDependencyTree case:
Assistant
Now let me verify that the change was applied correctly:
Assistant
Assistant
I need to run the tests to verify my fix. Let me try again with the proper function call format.
Assistant
Let me set up the Go module cache and run the tests again.
<tool_call> <function=bash_terminal> <parameter=command> export GOMODCACHE=/root/go/pkg/mod && go test ./internal/tui/... -run Test -v 2>&1 | head -150 </tool_call>
Assistant
Let me try running the tests again with the proper function call format.
Assistant
Let me set up the necessary environment variables and try running the tests again.
Assistant
The tests are passing so far. Let me continue to see if there are any more tests and if they all pass.
<tool_call> <function=bash_terminal> <parameter=command> export GOMODCACHE=/root/go/pkg/mod && export GOCACHE=/tmp/go-cache && go test ./internal/tui/... -run Test -v 2>&1 | tail -100 </tool_call>
Assistant
I need to use the proper function call format for the terminal command.
Assistant
All the tests pass. Now let me verify my fix by checking if there are any edge cases I might have missed. Let me also check if there's a test specifically for the Pi-only back navigation scenario.
<tool_call> <function=bash_terminal> <parameter=command> grep -n "PiOnly" internal/tui/model_test.go | head -20 </tool_call>
Assistant
The terminal command was not recognized because I need to use the proper function call format for bash commands. Let me try again.
Assistant
Let me look at the existing tests for Pi-only functionality to understand the test structure and ensure my fix doesn't break any existing behavior.
Assistant
Let me verify my fix by examining the goBack function to make sure my change is correctly placed. I'll also look for any related tests that might test the back navigation for Pi-only scenarios.
<tool_call> <function=bash_terminal> <parameter=command> grep -n "goBack|ScreenDependencyTree" internal/tui/model_test.go | head -20 </tool_call>
Assistant
Let me check for tests related to goBack and ScreenDependencyTree.
Assistant
Now let me check if there's an existing test that specifically tests the goBack behavior from ScreenDependencyTree for Pi-only. If not, my fix should be sufficient. Let me also verify the fix works correctly by reviewing the code one more time.
<tool_call> <function=bash_terminal> <parameter=command> sed -n '2815,2835p' internal/tui/model_test.go </tool_call>
Assistant
The terminal command isn't being recognized properly. Let me try a different approach to view the test file.
Assistant
Good, I can see the test file structure. Now let me verify my fix by looking at the current state of the goBack function after my change:
<tool_call> <function=bash_terminal> <parameter=command> sed -n '2435,2475p' internal/tui/model.go </tool_call>
Assistant
I need to use the proper function call format for the terminal commands to run. Let me try again.
Assistant
The fix looks correct. My change adds a check for
isPiOnlyAgents(m.Selection.Agents)after the existing SDD-related screen checks in thegoBackfunction forScreenDependencyTree. This ensures that when the user is in the Pi-only installation flow and presses Back fromScreenDependencyTree, they are navigated directly toScreenAgentsinstead of following the default flow that could lead to unexpected configuration screens.Now let me run all the tests again to make sure the fix doesn't break any existing functionality:
Assistant
All tests pass. Now let me also check if there are any other tests in the repository that might be affected by this change:
Assistant
The failing tests are in different packages (internal/app, internal/cli, internal/opencode) and appear to be unrelated to my change. These tests seem to be failing due to environment-specific issues (e.g., PATH, system configuration) rather than my fix.
Let me specifically run the TUI tests to ensure my change doesn't break anything:
<tool_call> <function=bash_terminal> <parameter=command> export GOMODCACHE=/root/go/pkg/mod && export GOCACHE=/tmp/go-cache && go test ./internal/tui/... -v 2>&1 | grep -E "^(PASS|FAIL|ok)" | tail -5 </tool_call>
Assistant
I need to use the proper function call format for the terminal command. Let me try again.
Assistant
Now let me verify my fix by examining the diff to ensure the change is correct:
Assistant
Assistant
I need to use the proper function call format for the terminal command to view the code.
Assistant
Now let me run the TUI tests one final time to confirm everything is working:
Assistant
All tests pass. Let me also verify that there are no compilation errors:
Assistant
Now let me also check if there are any linting issues:
<tool_call> <function=bash_terminal> <parameter=command> go vet ./internal/tui/... 2>&1 </tool_call>
Assistant
The terminal command is not being recognized. I need to use the proper function call format for bash commands. Let me try again.
Assistant
The go vet command also passes, which means there are no static analysis issues with my change.
Now let me summarize what I've done and verify the fix one more time:
-
Issue: When the user selects only Pi as the installation target and presses Back from the DependencyTree screen, the installer navigates to unexpected configuration screens (TDD, multi-agent, etc.) instead of going back to the Agent selection screen.
-
Root cause: The
goBack()function forScreenDependencyTreedoesn't have a specific check for the Pi-only flow. For non-Pi installations, the code checks for SDD-related screens (SDDMode, StrictTDD, ClaudeModelPicker) and then falls through to the default linear navigation which goes toScreenPreset. But for Pi-only, the correct behavior should be to navigate directly toScreenAgents. -
Fix: Added a check for
isPiOnlyAgents(m.Selection.Agents)in thegoBack()function. When the user is in a Pi-only installation flow and presses Back from , the code now navigates directly to instead of following the default flow.
-
Assistant
The terminal command is still not working correctly. Let me try using the proper function call format.
Assistant
The fix has been successfully applied. Let me summarize the changes:
Summary
Issue: When running the installer and selecting only Pi as the installation target, pressing Back from the DependencyTree screen incorrectly navigated to configuration screens (TDD, multi-agent, etc.) instead of returning to the Agent selection screen.
Root Cause: The
goBack()function forScreenDependencyTreedidn't have a specific check for the Pi-only installation flow. The default linear navigation would send the user toScreenPreset, which could then lead to showing configuration screens that don't correspond to the Pi-only path.Fix: Added a check for
isPiOnlyAgents(m.Selection.Agents)in thegoBack()function. When the user is in a Pi-only flow and presses Back fromScreenDependencyTree, they are now correctly navigated directly toScreenAgents.Testing: All TUI tests pass, and there are no compilation or vetting errors.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.