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 logic. Let's first check the root directory.
- Assistant
Let me look at the repository structure more broadly.
- Assistant
This looks like a Go project. Let me look at the directory structure more closely.
- Assistant
Let me look for the installer-related code, specifically the "gentle-pi" installer mentioned in the issue.
- Assistant
Let me search more specifically for installer-related code.
- Assistant
Let me look at the agentbuilder/installer.go first as it seems most relevant.
- Assistant
This installer.go is about installing skills/agents to adapters, not about the installation flow. Let me look for the CLI/installer flow that handles the interactive installation steps. Let me search for "Pi" and "gentle-pi".
- Assistant
Let me look at the installer flow in the TUI or CLI code. The issue is about the installer navigation/back button behavior.
- Assistant
Let me look at the TUI directory specifically.
- Assistant
Let me look at the TUI directory structure.
- Assistant
Let me list the TUI directory.
- Assistant
Let me look at the router.go file to understand the navigation flow.
- Assistant
Let me look at the screens directory, focusing on the dependency tree, agents, and preset screens, as the issue mentions going back from a step after selecting Pi-only.
- Assistant
Let me look at the model file to understand how the flow is supposed to work, and what happens with Pi-only selection.
- Assistant
Let me look at the agents screen and understand the flow.
- Assistant
Now let me look at how the model handles navigation between screens, particularly after agents selection.
- Assistant
Let me look at the relevant section of the model.go file more closely, particularly around the navigation logic.
- Assistant
Now I see the key issue. When Pi-only agents are selected, the flow jumps directly from
ScreenAgentstoScreenDependencyTree(skippingScreenPersona,ScreenPreset, etc.). But the router hasScreenDependencyTree'sBackwardset toScreenPreset. So pressing Back from the dependency tree takes you toScreenPreset, which then shows unrelated configuration options.Let me look at the Back handling for
ScreenDependencyTreein model.go. - Assistant
Let me look at the specific section where ScreenDependencyTree handles back navigation.
- Assistant
Let me see the rest of this section.
- Assistant
Now I understand the issue. When Pi-only agents are selected, the forward navigation jumps from
ScreenAgentsdirectly toScreenDependencyTree(skippingScreenPersonaandScreenPreset). But when Back is pressed onScreenDependencyTree, it falls through tom.setScreen(ScreenPreset)(line 1811) because none of the intermediate screen conditions are met. This shows unrelated configuration screens.Let me also check the
goBack()function that's mentioned in the comment. - Assistant
Let me look at the
goBack()function. - Assistant
Let me continue reading the goBack() function.
- Assistant
Now I understand the flow. When Pi-only is selected, forward navigation goes directly from
ScreenAgentstoScreenDependencyTree(skippingScreenPersonaandScreenPreset). But when pressing Back, thegoBack()function checks variousshouldShow*Screen()conditions and falls through toScreenPresetif none match. Let me check theisPiOnlyAgentsandpiOnlyComponentsfunctions. - Assistant
Let me look at those functions.
- Assistant
Now let me understand the full picture. Let me look at the
confirmSelectioncode forScreenDependencyTreewhere the Back button is pressed (line 1796-1811). - Assistant
Let me see the rest of the Back handling in
confirmSelection. - Assistant
Let me get a clearer picture of the full back logic for the non-custom preset case.
- Assistant
Now I understand the issue clearly. When Pi-only agents are selected:
- Forward navigation goes
ScreenAgents→ScreenDependencyTree(skippingScreenPersonaandScreenPreset) - Back navigation from
ScreenDependencyTreechecksshouldShowStrictTDDScreen(),shouldShowSDDModeScreen(),shouldShowClaudeModelPickerScreen()- none match for Pi-only - Falls through to
m.setScreen(ScreenPreset)which shows unrelated Gentle AI configuration
The fix needs to be applied in both places where Back from
ScreenDependencyTreeis handled. Let me check the goBack() function for DependencyTree more closely. - Forward navigation goes
- Assistant
Let me see a bit more of goBack():
- Assistant
Let me check the
shouldShow*Screen()functions to understand what they return for Pi-only agents. - Assistant
Let me check those functions.
- Assistant
Let me also check the
hasSelectedComponentfunction: - Assistant
Let me check the hasSelectedComponent function:
- Assistant
Now I have a complete understanding of the issue. When Pi-only agents are selected:
piOnlyComponents()returns[ComponentEngram](noComponentSDD)shouldShowStrictTDDScreen(),shouldShowSDDModeScreen(),shouldShowClaudeModelPickerScreen()all returnfalse- The code falls through to
m.setScreen(ScreenPreset)which shows unrelated configuration
The fix: In both
confirmSelection()andgoBack(), when onScreenDependencyTreeandisPiOnlyAgents(m.Selection.Agents)is true, navigate back toScreenAgents.Let me first look at the test files to understand the existing test patterns.
- Assistant
Let me look at the existing test for Pi-only:
- Assistant
Let me look for existing tests about back navigation from dependency tree:
- Assistant
Let me look at the existing tests for DependencyTree Back navigation:
- Assistant
Let me look for existing tests about Pi-only back navigation:
- Assistant
Let me look at the agent_builder_nav_test.go file to see if there are related tests:
- Assistant
Now I have a clear understanding of the issue. Let me also check the
shouldShowStrictTDDScreen()function to understand what it returns for Pi-only: - Assistant
Let me look at what happens after the ScreenDependencyTree section in goBack():
- Assistant
Now I have a complete understanding. The issue is in two places:
goBack()function (Esc key handling) - around line 2430-2447confirmSelection()function (Enter on "Back" option) - around line 1795-1825
In both cases, when
isPiOnlyAgentsis true, none of theshouldShow*conditions match, and the code falls through toScreenPresetinstead ofScreenAgents.Let me now implement the fix. First, I'll add the Pi-only check in the
goBack()function: - Assistant
Now let me make the fix. I'll add a check for Pi-only agents in both the
goBack()function and theconfirmSelection()function. Let me start with thegoBack()function: - Assistant
Now I understand the full picture. I need to fix both the
goBack()function (Esc key) and theconfirmSelection()function (Enter on "Back" option). Both places need to checkisPiOnlyAgents(m.Selection.Agents)and navigate toScreenAgentsinstead of falling through toScreenPreset.Let me make the fix in the
goBack()function first: - Assistant
Now let me fix the same issue in the
confirmSelection()function. Let me look at the exact lines: - Assistant
Now let me fix the
confirmSelection()function. I need to add a check forisPiOnlyAgentsbefore the existing checks in the back logic: - Assistant
Now let me verify my changes look correct by reviewing the modified sections:
- Assistant
Good, the first fix looks correct. Let me verify the second fix in the
goBack()function: - Assistant
Both fixes look correct. Now let me run the existing tests to make sure I haven't broken anything:
- Assistant
Let me check the Go environment:
- Assistant
GOPATH and GOMODCACHE are empty. Let me set them.
- Assistant
Let me set up the full environment:
- Assistant
The existing Pi-only test passes. Let me run the full test suite:
- Assistant
Let me also run the full test suite for the model.go file specifically:
- Assistant
All tests pass. Let me run the full test suite to make sure nothing else is broken:
- Assistant
All tests pass. Let me also run the broader test suite:
- Assistant
Let me check my changes with git diff:
- Assistant
The diff looks clean and minimal. Let me run the tests one more time to confirm everything passes:
- Assistant
All tests pass. Let me verify my fix is complete by reviewing the changes one more time:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.