Skip to content

feat: selective reconfigure menu for install.sh#42

Merged
dasirra merged 12 commits into
developfrom
build/40-selective-reconfigure-for-install-script
Mar 26, 2026
Merged

feat: selective reconfigure menu for install.sh#42
dasirra merged 12 commits into
developfrom
build/40-selective-reconfigure-for-install-script

Conversation

@dasirra

@dasirra dasirra commented Mar 25, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a two-level TUI menu to install.sh that activates when .env already exists, letting returning users jump directly to any agent/integration setting instead of walking through the full sequential wizard. Fresh installs are completely unchanged.

Source

Closes #40

What Changed

install.sh

  • New entry-point branch: if .env exists, sources all integration modules, runs run_reconfigure_menu + run_reconfigure_summary, then exits — the sequential wizard is never reached
  • _integration_status AGENT_ID INTG — returns "configured" / "not configured" based on env tokens or GWS credentials file; defined globally so tests can reference it
  • _run_git_identity — extracts Screen 3 git identity prompts into a reusable function; Screen 3 now calls it
  • _run_agent_submenu AGENT_ID NAME — per-agent submenu loop with integration status annotations; dispatches to existing module functions; guards run_discord_shared behind a guild-already-set check
  • run_reconfigure_menu — top-level agent menu loop; builds id|name map once per invocation (single jq call) to avoid redundant subprocesses
  • run_full_agent_setup AGENT_ID — runs full setup for an agent marked "(not installed)"
  • run_reconfigure_summary — shows configured agents/integrations, creates runtime dirs, offers make restart
  • Removed stale comment ("In reconfigure mode, we'll just show all options") from Screen 2

tests/reconfigure.bats (new)

  • 18 tests for _integration_status covering all integration types (discord, github, claude, gws, xurl) plus agent-id uppercasing and unknown integration fallback

Tasks

Task Status Notes
Implement reconfigure menu in install.sh DONE
Add bats tests for _integration_status DONE 18 tests, all passing
Run make test DONE 103/103 pass
Code review + fixes DONE Fixed unconditional run_discord_shared, duplicate local declaration, stale comment, redundant jq passes, added sync comment in test file

Code Review

Two MUST_FIX issues found and resolved:

  1. run_discord_shared was called unconditionally in reconfigure mode — now guarded by [ -z "$(env_get "DISCORD_GUILD")" ] in both _run_agent_submenu and run_full_agent_setup
  2. local aid_upper token_val was declared twice in the same function scope in run_reconfigure_menu — removed redundant second declaration

Three SHOULD_FIX issues also resolved: stale comment removed, jq pass count halved via id|name map, sync comment added to test file.


Built autonomously by /build

dasirra and others added 12 commits March 16, 2026 18:56
merge: develop into main
fix: remove legacy .initialized cleanup from entrypoint
When .env exists, show a two-level TUI menu letting users jump directly to any agent/integration setting instead of re-running the full sequential wizard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract _integration_status into installer/lib.sh so tests source the
real function instead of a duplicated copy. Switch sed to -E (ERE) for
correct parentheses matching in the reconfigure submenu.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Resolve submenu labels via manifest lookup instead of hardcoded strings
- Validate non-empty git name/email before saving in _run_git_identity
- Add Discord status to reconfigure summary
- Ensure OPENCLAW_GATEWAY_TOKEN exists in .env during reconfigure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dasirra dasirra marked this pull request as ready for review March 26, 2026 08:40
@dasirra dasirra merged commit 1cd1438 into develop Mar 26, 2026
1 check passed
@dasirra dasirra deleted the build/40-selective-reconfigure-for-install-script branch March 26, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant