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.
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
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /gentle-ai, current file: none) bash-$
- Assistant
I’ll first map the installer’s flow and locate the target-selection and Back-navigation logic. Then I’ll reproduce the state transition in the smallest practical way, patch it without changing tests, and run the relevant test suite plus focused verification.
- Assistant
The broad search was dominated by generated golden files, but the repository is a Go CLI. I’ll narrow inspection to
internalandcmd, especially Bubble Tea models/screens and their tests, and read the repository guidance before editing. - Assistant
There is no special implementation skill required for this bug. The previous file listing was truncated before the UI package, so I’ll enumerate UI-related directories directly and inspect screen transitions and existing navigation tests.
- Assistant
The relevant flow is in
internal/tui. I’ll now read the router’s transition table, the model’s message handling, and preset/agent-selection screens to identify why a Pi-only path inherits the generic configuration predecessor. - Assistant
The static router says Agents → Persona, which is correct for normal Gentle AI installs but suspicious for Pi-only because Pi likely has a dedicated handoff. I’ll isolate all conditional routing helpers and every Pi reference in the TUI, then inspect the exact
Updatebranches around agent selection and Back handling. - Assistant
The code already has
isPiOnlyAgentsand a special forward transition at agent confirmation. The likely defect is that the next screen’s generic Back route ignores that special entry path. I’ll inspect those exact functions and existing tests around Pi-only behavior before deciding whether to fix the centralizedgoBack, track history, or add a narrow conditional. - Assistant
This reproduces structurally: Pi-only Continue sets
ScreenDependencyTree; both Esc (goBack) and the screen’s Back row eventually use generic DependencyTree → Preset behavior, exposing unrelated setup. I’ll inspect the entiregoBackand DependencyTree confirmation branches to ensure both navigation mechanisms are fixed consistently, then run the existing Pi test as the pre-fix baseline. - Assistant
The focused tests are currently blocked by environment configuration (
GOMODCACHEandGOPATHare both unset), not by code. Before addressing that, I’ll capture the omitted beginning ofgoBackand exact DependencyTree branch. This will show whether the fix needs to cover Esc and explicit Back separately, as expected. - Assistant
Both navigation paths independently route Pi-only DependencyTree back into generic configuration. A narrow Pi-only guard in each path is appropriate and preserves the existing conditional routing for mixed-agent installs. I also noticed an edge case: if a user returns after choosing Custom, then changes to Pi-only, the stale
PresetCustommakes the supposedly Pi-only DependencyTree act as the component picker. I’ll inspect rendering and selection mutation to ensure the fix normalizes that stale state rather than only masking the reported default case. - Assistant
The stale-Custom edge is real because rendering branches solely on
Selection.Preset. The cleanest normalization is to assign the existing Minimal preset when entering Pi-only (its defined meaning is “Just Engram”), then route Back directly to Agents. This keeps the plan read-only and ensures any subsequent re-entry doesn’t revive unrelated prior configuration. I’ll verify CLI precedent for Pi defaults, then patch both explicit Back and Esc while keeping mixed Pi+other-agent behavior untouched. - Assistant
I’ll implement three coordinated safeguards in production code only: normalize Pi-only to
PresetMinimalon Continue, handle Pi-only DependencyTree confirmation before generic/custom logic, and handle Esc before generic route lookup. The second safeguard also makes manually restored/stale Pi-only state safe, while mixed-agent flows still use all existing routing. - Assistant
The patch is formatted and passes
git diff --check. To verify without adding tests, I’ll run the existing focused tests with an explicit temporary Go cache configuration, then create a temporary in-package test file (removed immediately afterward) that reproduces both reported Back mechanisms plus the stale-Custom edge. This complies with the constraint not to add repository tests because the temporary file will not remain in the change. - Assistant
Existing Pi-only and mixed-agent tests pass. I’ll now execute a disposable focused regression test that drives the exact sequence: Agents with only Pi → Continue → DependencyTree → explicit Back and Esc, asserting both return to Agents. It will also assert a stale Custom preset is normalized and does not render the generic component selector.
- Assistant
The exact reproduction now passes for both explicit Back and Esc, including the stale-Custom edge, and the temporary test was removed. I’ll run the complete TUI package suite first, then the repository-wide Go test suite to catch routing or selection regressions outside the focused path.
- Assistant
All TUI and screen tests pass. I’ll now run all Go packages; afterward I’ll inspect the final diff and ensure no temporary or generated files remain.
- Assistant
The repository-wide suite exceeded the command time limit after many packages passed; no failure was reported before termination. Since the changed code is isolated to TUI routing, the complete TUI suite is the primary verification. I’ll additionally run the directly used model/planner/CLI packages in a bounded batch, then perform final diff/status checks.
- Assistant
Model and planner tests pass. CLI’s single failure is caused by the temporary GOPATH not being included in
PATH—the test correctly expected its guidance text to mention that missing path. I’ll rerun CLI with/tmp/gopath/bininPATH, which matches a normal configured Go environment, then inspect final state independently (the prior&&prevented those checks after the environment-related failure). - Assistant
The CLI test intentionally overrides PATH internally, so external PATH changes cannot satisfy it; it expects the default GOPATH suffix
go/bin, whereas the temporary GOPATH is/tmp/gopath. This package is unrelated to the patch, and its failure is an environment artifact. I’ll confirm that from the test source, then run the final focused suite once more and prepare submission with the required checklist accounting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.5-35B-A3BCompare side by side →