Recover gracefully when default agent setup or launch fails - #10675
Open
baseman70 wants to merge 1 commit into
Open
Recover gracefully when default agent setup or launch fails#10675baseman70 wants to merge 1 commit into
baseman70 wants to merge 1 commit into
Conversation
When an uninstalled agent is chosen, omarchy-default-agent --install launches the agent inline inside a floating terminal for its initial session and onboarding. If agent authentication or startup exits with an error (or the user cancels), the broken agent previously remained saved as the permanent default, and the terminal would abruptly exit. Revert ~/.config/omarchy/defaults/agent to its previous value (or remove it if none was set), report the failure, and offer to reopen the agent selection menu via gum confirm so the user can easily choose another.
baseman70
force-pushed
the
fix/agent-setup-error-recovery
branch
from
September 7, 2026 18:03
cf729bb to
b52bf7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When setting up or switching coding agents via
omarchy-default-agent --install <agent>(or selecting an uninstalled agent in the Omarchy menu), the script writes the selection to~/.config/omarchy/defaults/agentand executesomarchy-agent --inlineinside a floating terminal for the initial onboarding session.If the agent's authentication or startup fails (e.g. an expired token, missing credentials, deprecated OAuth endpoints, or a user aborting setup with Ctrl+C), the broken agent previously remained permanently set as the default, and the terminal would abruptly close with no graceful recourse.
Solution
previous_agentfrom~/.config/omarchy/defaults/agentbefore updating the selection.omarchy-agent --inline. If it fails:defaults/agenttoprevious_agent(or remove the file if no default was previously configured).Could not launch <Agent>to stderr.gum confirm "Would you like to select a different agent?".exec omarchy-menu summon setup.default.agent).test/shell.d/default-agent-test.shcovering:pi) on confirmation.1) when alternate selection is declined.\033[2J\033[3J\033[H) verification before launch attempt.OpenClaw).test/shell.d/default-agent-test.shand 108 tests in./test/clipass.