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.Interface
No new interfaces are introduced.
Assistant
Let me start by exploring the repository structure to understand how the installer works and find the relevant code for the back navigation issue.
Assistant
The repository might not use Python. Let me explore more broadly.
Assistant
This is a Go project. Let me explore the installer-related files.
Assistant
Let me find the installer-related files more specifically.
Assistant
I need to find the installer-related files, particularly the one that handles the back navigation. Let me search for the installer logic more specifically.
Assistant
Let me look at the
installcmddirectory and search for back navigation logic.Assistant
Let me read the resolver.go file to understand the installation resolution logic.
Assistant
Let me look at the TUI screens for the installer flow, particularly around "back" navigation and Pi-only installation.
Assistant
<tool_call> <function=bash_terminal> <parameter=command> ls -la /gentle-ai/internal/tui/screens/ </tool_call>
Assistant
Let me look at the screens directory and understand the structure.
Assistant
Let me look at the model.go file, which is likely the main file handling navigation and state management. It's large (121266 bytes), so I'll look at specific parts related to back navigation and Pi installation.
Assistant
Let me search for the Pi installation flow and back navigation more specifically.
Assistant
Let me look for the screens and navigation flow, especially around Pi installation:
Assistant
Let me look at the screen types and how the back navigation works:
Assistant
Let me look at the specific areas around the Pi-only agent selection and back navigation:
Assistant
Let me look at what happens when Back is pressed on ScreenDependencyTree:
Assistant
Now let me look at the ScreenDependencyTree case in the Update function to understand what happens when Back is pressed:
Assistant
Now I need to understand the
shouldShowStrictTDDScreen(),shouldShowSDDModeScreen(), and similar functions, since these are the ones causing the unexpected navigation:Assistant
Let me find the definitions of these
shouldShow*functions:Assistant
Now let me look at the shouldShowStrictTDDScreen function and related functions, since these are the ones causing the unexpected navigation back to TDD configuration when pressing Back from Pi-only install:
Assistant
Let me look at the DependencyTree screen and how it handles Back navigation more closely:
Assistant
Assistant
Let me try the grep command again.
Assistant
Let me look at how Selection is initialized and what the default preset is:
Assistant
Let me look at the NewModel function to see how the Selection is initialized, especially what the Preset field is set to.
Assistant
Assistant
The function
isPiOnlyAgentsis defined at the package level in model.go (line 3134), so it's accessible from the Update function. Let me look at the test file to understand the expected behavior better before making changes.Assistant
Now I have a good understanding of the issue. Let me look at the existing tests for Pi-only to understand the expected behavior, and then I'll create a fix.
Let me look at the TestPiOnlyAgentContinueSkipsPromptsAndIncludesEngram test:
Assistant
Now I have a clear understanding of the issue. Let me summarize:
Root Cause: When selecting only Pi as the installation target, the user is taken directly from
ScreenAgentstoScreenDependencyTree(skipping Persona and Preset screens). When pressing "Back" onScreenDependencyTree, the code checks theshouldShow*functions, all of which return false for Pi-only installs (since SDD is not selected). This causes the code to fall through tom.setScreen(ScreenPreset), which is wrong because the user never went through the preset selection screen.Fix: In the
ScreenDependencyTreeBack handler, check if this is a Pi-only install first. If so, navigate back toScreenAgentsinstead ofScreenPreset.Let me implement the fix:
Assistant
Let me implement the fix. The issue is that when pressing Back from
ScreenDependencyTreefor a Pi-only install, the code falls through tom.setScreen(ScreenPreset)because none of theshouldShow*functions return true. The fix is to add a check for Pi-only installs before the shouldShow* chain.Assistant
I need to use the proper edit command format. Let me use the edit command with the correct syntax.
Assistant
I need to edit lines 1804-1823 in the model.go file to add the Pi-only check. Let me use the edit command with the correct syntax.
Assistant
Let me try using sed to make the edit instead:
Assistant
Let me try a different approach using a sed command to make the replacement:
Assistant
Let me use a simpler approach with sed to insert the new check:
Assistant
Let me verify the change was applied correctly:
Assistant
The change has been applied. Now I need to check if there's a
goBack()function that also needs to be updated, since the comment says "NOTE: Back logic also in goBack() — keep in sync."Assistant
I need to check the
goBack()function since the comment mentions keeping it in sync:Assistant
Let me see the rest of the goBack function's ScreenDependencyTree handling:
Assistant
I need to also update the
goBack()function since the comment says "Back logic also in goBack() — keep in sync." The goBack function is called when the user presses Esc to go back. Let me add the same Pi-only check there.Assistant
I need to also update the goBack() function to handle Pi-only installs. Let me add the same check for Pi-only agents at the beginning of the ScreenDependencyTree handling in goBack().
The current code in goBack() for ScreenDependencyTree:
if m.Screen == ScreenDependencyTree && m.Selection.Preset != model.PresetCustom { if m.shouldShowOpenCodePluginsScreen() { m.setScreen(ScreenOpenCodePlugins) return m } if m.shouldShowStrictTDDScreen() { // ... } if m.shouldShowClaudeModelPickerScreen() { m.setScreen(ScreenClaudeModelPicker) return m } }I need to add a Pi-only check first:
if m.Screen == ScreenDependencyTree && m.Selection.Preset != model.PresetCustom { if isPiOnlyAgents(m.Selection.Agents) { m.setScreen(ScreenAgents) return m } if m.shouldShowOpenCodePluginsScreen() { // ... } // ... }Assistant
I need to add the same Pi-only check in the
goBack()function to keep it in sync. Let me insert the check after the ScreenDependencyTree condition:Assistant
Let me verify the changes to both locations:
Assistant
The changes to the first location (ScreenDependencyTree handler in Update function) look correct. Now let me verify the second location (goBack function).
Assistant
Both changes have been applied. Let me verify the code compiles correctly and run the existing tests.
Assistant
The user wants me to continue fixing the issue. Let me try building with different Go environment settings.
Assistant
The user wants me to continue with my work. Let me try to build the Go project with a proper GOPATH set up.
Assistant
The user wants me to continue fixing the issue. Let me try to build with proper Go environment variables set.
Assistant
The code compiles successfully. Now let me run the existing tests to make sure the fix doesn't break anything.
Assistant
All existing tests pass. Now let me add a specific test to verify the fix for the Pi-only back navigation issue.
Assistant
Let me add a specific test for the Pi-only back navigation fix and run all existing tests:
Assistant
I need to add a test case to verify the fix works correctly. Let me find the right place to add it and then run all the tests.
Assistant
I need to add a test case to verify the Pi-only back navigation fix. Let me first examine the test file structure to understand the test patterns used.
Assistant
Now let me add a test case to verify the Pi-only back navigation fix. I'll add it right after the existing TestPiOnlyAgentContinueSkipsPromptsAndIncludesEngram test:
Assistant
Now let me add a test case to verify the Pi-only back navigation fix. I'll insert it after line 261:
Assistant
Now let me add these test cases to the test file by inserting them after the existing TestPiOnlyAgentContinueSkipsPromptsAndIncludesEngram test:
Assistant
Let me add the test cases to verify the fix by inserting them into the test file:
Assistant
Let me run the new test cases to verify the fix works:
Assistant
The first new test passes. Let me run the Esc (goBack) test and all existing tests:
Assistant
Both new tests pass. Now let me run all the existing tests to ensure the fix doesn't break anything:
Assistant
All tests pass. Let me get a clearer summary of the test results:
Assistant
All tests pass. Let me verify the complete changes made to fix the issue:
Assistant
Let me check the test file changes and verify the complete diff:
Assistant
The user wants me to continue with the fix. Let me run all the tests to make sure everything passes and verify the fix is complete.
Assistant
The user wants me to continue with the fix. Let me run all tests without cache to make sure everything passes and verify the fix is complete.
Assistant
All tests pass. Let me verify the complete summary of changes made:
Summary of Changes
Problem
When selecting only
Pias the installation target in the gentle-ai installer, pressingBackon theDependencyTreescreen incorrectly navigated to unrelated configuration screens (TDD, multi-agent setup, communication style, etc.) instead of returning to the agent selection screen (ScreenAgents).Root Cause
For Pi-only installs, the installation flow skips
ScreenPersonaandScreenPresetand goes directly fromScreenAgentstoScreenDependencyTree. WhenBackwas pressed onScreenDependencyTree, the code checked variousshouldShow*functions (which all returnedfalsesince SDD wasn't selected), causing it to fall through to . From there, the user would be shown preset options and other configuration screens that don't apply to the Pi-only path.Assistant
All tests pass successfully. Let me do a final verification by running the full test suite and confirming the changes are complete:
Assistant
The full test suite is taking too long, but I've already verified that all the TUI tests pass, which are the relevant tests for this fix. Let me confirm the final state of the changes:
Assistant
Let me verify all the relevant tests pass and check the final state of the changes:
Assistant
All tests pass. The fix is complete. Let me submit the changes.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.