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 logic.
- Assistant
Let me explore the repository structure more thoroughly.
- Assistant
Let me explore the cmd and internal directories to understand the installer flow.
- Assistant
Let me look at the internal directory structure more broadly.
- Assistant
Let me explore the TUI screens directory and the installer flow more thoroughly.
- Assistant
Let me search for relevant terms related to Pi installation and back navigation.
- Assistant
Let me look at the TUI model and router to understand the flow management.
- Assistant
Let me look at the model.go to understand the flow and how the installer screens work.
- Assistant
Let me look at the preset flow test to understand the flow better.
- Assistant
Let me look at the agents screen and the model for understanding the flow.
- Assistant
Now let me look at the model.go for the flow logic when Pi is selected and back navigation.
- Assistant
Let me look at the Update function to understand the flow logic.
- Assistant
Let me search for the handleKeyPress function.
- Assistant
Let me examine the handleKeyPress function to understand how back navigation works.
- Assistant
Let me see the goBack function.
- Assistant
Let me look at the goBack function. userdata
- Assistant
Let me look at the goBack function.
- Assistant
Let me continue reading the goBack function and understand the agents catalog.
- Assistant
Let me look at the catalog to see what agents are available, especially Pi.
- Assistant
Let me look at the model types to understand the AgentID constants.
- Assistant
Now let me look at the flow after selecting agents, particularly the shouldShow methods and the persona/preset flow.
- Assistant
Let me look at the
shouldShowSDDModeScreen(),shouldShowStrictTDDScreen(),shouldShowClaudeModelPickerScreen(),shouldShowKiroModelPickerScreen(), etc. functions to understand the routing logic. - Assistant
Now I can see the key logic. There are
isPiOnlyAgentsandpiOnlyComponentsfunctions. Let me understand the flow from agents selection to see how Pi-only mode is handled. - Assistant
Let me look at the confirmSelection for ScreenAgents and then the Preset handling for Pi-only case.
- Assistant
Now I understand the issue! Let me look at the
goBack()function specifically for theScreenDependencyTreecase and understand how Pi-only flows. - Assistant
Now let me check the
optionCountfunction and how the preset/persona screens are rendered with back option. - Assistant
Let me look at the confirmSelection for ScreenDependencyTree and the full goBack logic for this screen.
- Assistant
Let me look at the confirmSelection for ScreenDependencyTree.
- Assistant
Now I understand the issue. When Pi is the only agent selected, the flow skips ScreenPersona and ScreenPreset and goes directly to ScreenDependencyTree. But when pressing Back from ScreenDependencyTree, it falls through to ScreenPreset, which shows unrelated Gentle AI configuration options.
Let me look at the goBack function for ScreenDependencyTree more closely.
- Assistant
Now I need to understand the flow. When only Pi is selected:
ScreenAgents→ Continue →ScreenDependencyTree(skipping Persona and Preset)ScreenDependencyTree→ Back → falls through toScreenPresetvialinearRoutes
The fix should handle Pi-only case in both
goBack()and the confirmSelection "Back" option onScreenDependencyTree. Let me also check the option count for DependencyTree. - Assistant
Let me look at the optionCount and the "Back" logic on the dependency tree.
- Assistant
Let me also look at the confirmSelection for ScreenDependencyTree to understand the "Back" handling.
- Assistant
Now I understand the issue clearly. Let me trace the flow:
- Pi-only path:
ScreenAgents→ Continue →ScreenDependencyTree(skipsScreenPersonaandScreenPreset) - When pressing Back from
ScreenDependencyTree, thegoBack()function checks variousshouldShow*conditions (all false for Pi-only), then falls through to the defaultPreviousScreen(ScreenDependencyTree)which returnsScreenPreset - This shows the preset selection screen ("Full Gentleman", "Ecosystem Only", etc.) which is unexpected for Pi-only
Let me first create a test to reproduce the issue, then fix it.
- Pi-only path:
- Assistant
Let me check the Go environment.
- Assistant
The GOMODCACHE and GOPATH are not set. Let me try setting them.
- Assistant
Need to set HOME and GOCACHE as well.
- Assistant
Good, tests pass. Now let me look at the dependency tree options and how "Back" works on that screen.
- Assistant
Let me look at the dependency_tree.go file to understand what options are shown.
- Assistant
Now I have a clear picture of the bug. Let me trace the full flow:
- ScreenAgents → User selects only Pi, presses Continue →
isPiOnlyAgentsis true → skips Persona/Preset → goes to ScreenDependencyTree - On ScreenDependencyTree, user presses "Back" → falls through all the
shouldShow*checks (all false for Pi-only) → lands on ScreenPreset which shows unrelated config
The fix needs to be in two places:
goBack()for Esc key handling, andconfirmSelection()for the "Back" button on ScreenDependencyTree.Let me fix
goBack()first: - ScreenAgents → User selects only Pi, presses Continue →
- Assistant
Now I'll add the Pi-only check in
goBack(). The fix needs to check if only Pi is selected and go back toScreenAgentsinstead of falling through toScreenPreset. - Assistant
Good. Now I need to fix the same issue in
confirmSelection()for the ScreenDependencyTree "Back" button case. Let me find that code. - Assistant
Let me see more of the confirmSelection for ScreenDependencyTree:
- Assistant
Now I'll fix the same issue in
confirmSelection(). Theelsebranch at the end of the ScreenDependencyTree back logic needs the Pi-only check: - Assistant
Wait, I need to verify the structure of the code. The
if isPiOnlyAgentscheck should be inside the "Back" branch (when cursor != 0). Let me check the current state of the code. - Assistant
There's a structural problem! My edit accidentally removed the closing
}of theif m.Cursor == 0block. Let me fix this. - Assistant
Good. Now let me verify the goBack logic for ScreenReview in the Pi-only flow. Let me check what happens when going back from ScreenReview in Pi-only mode:
- Assistant
Let me check the goBack logic for ScreenReview. When Pi-only path reaches ScreenReview and user presses Esc:
- Assistant
Good. The
goBackforScreenReviewonly has special handling formodel.PresetCustom. For Pi-only, it will fall through toPreviousScreen(ScreenReview)which returnsScreenDependencyTree— that's correct since the dependency tree is the previous screen in the Pi-only flow.Now let me run the existing tests to verify nothing is broken.
- Assistant
All existing tests pass. Let me also check if there are any existing tests specifically about Pi-only flow:
- Assistant
Let me look at the existing test for Pi-only flow:
- Assistant
Let me check if there's a test for back navigation from dependency tree for Pi-only:
- Assistant
There's no existing test for the back navigation from Pi-only DependencyTree. Let me also check the
goBackFromOpenCodePluginsfunction: - Assistant
Now let me run all the tests to make sure my fix doesn't break anything.
- Assistant
Let me see the tui model tests more specifically:
- Assistant
Let me check for any failures specifically:
- Assistant
All tests pass. Now let me create a quick test to verify my fix works correctly. Let me write a test that simulates the exact issue:
- Assistant
Let me write a quick script to verify the fix:
- Assistant
Actually, I can't use unexported types from outside the package. Let me delete that file and instead verify by running the existing tests:
- Assistant
Let me verify the diff of my changes:
- Assistant
I notice an issue - a comment line and blank line got removed accidentally. Let me fix that:
- Assistant
I need to restore the missing comment and blank line. Let me fix that:
- Assistant
Good, the comment is now restored. Let me verify the final diff:
- Assistant
The diff looks clean. Let me run all tests one final time to confirm everything passes:
- Assistant
The full test suite timed out. Let me run just the tui tests:
- Assistant
All tui tests pass. Let me also run some other relevant tests:
- Assistant
Let me try with exact test names:
- Assistant
Let me run a broader set of navigation-related tests:
- Assistant
All tests pass. Let me also check the
screensAgentOptionsfunction used in the test file: - Assistant
Let me look at the
screensAgentOptionshelper function: - Assistant
Now let me review the final diff one more time and run all the tests:
- Assistant
Let me run the full test suite one more time to be thorough:
- Assistant
No failures. Let me also verify the code compiles:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.