Skip to content

Conversation

@GrocerPublishAgent
Copy link
Contributor

@rrnewton forked happy-server, happy-expo-app, and happy-cli,
then built a mon-repo that pulled them together as submodules.
on top of that they added scripts for e2e testing.

I have since made a mono-repo with a slightly different layout.
this commit merges only their top-level scripts. the paths
they reference are wrong for our structure, but nothing calls
these scripts yet, so nothing breaks.

merging now so we can fix paths together in main. no sense
having Ryan chase a moving target in their own fork
when we will need to adjust things anyway.

next:

  • merge their happy-server fork
  • merge their happy-expo-app fork
  • merge their happy-cli fork
  • update paths in scripts to match our layout

rrnewton and others added 30 commits November 30, 2025 12:08
Create beads tracking issue for E2E testing work with summary of:
- Completed infrastructure setup
- Current test coverage
- Future work items
- Architecture decisions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The status command was incorrectly using system-wide process detection
(pgrep -f) which couldn't distinguish between slots. For example, when
checking slot 2 status, it would find slot 1's processes and report
"Process running but not responding".

Changes:
- Add is_slot_service_running() function that checks PID files
- Clearly separate "Shared Services" (PostgreSQL, Redis) from slot-specific
- Shared services now labeled as "shared" in output
- Slot-specific services checked via PID files + port listening
- Fallback to port-only check for externally started services

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Each slot now uses its own database to prevent test/production data conflicts:
- Slot 0 (production): uses 'handy' database
- Slot N (test): uses 'handy_test_N' database

Changes:
- Add DATABASE_NAME and DATABASE_URL variables based on slot
- Update ensure_postgres_ready() to create slot-specific databases
- Update start_server() to use slot-specific DATABASE_URL
- Update status output to show database info
- Update env command to export DATABASE_URL and DATABASE_NAME
- Update help text to explain database isolation
- Add note to CI workflow about automatic slot database creation

This ensures E2E tests running on slot 1+ cannot accidentally corrupt
production data in the 'handy' database.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add shared get_active_slots() function to enumerate slots with PID or log dirs
- Refactor cleanup to use get_active_slots() (no code duplication)
- Add show_slot_services_status() helper for slot-specific status display
- Add show_all_slots_status() to show status of all active slots
- Update status command to accept --all-slots flag
- Update help text with new option and example

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- `start` now starts all services (backend + webapp)
- Add `start-backend` for starting just backend services
- `start-webapp` continues to start just the webapp
- Update header comments and help text
- Update E2E test helper to use new `start` command
- restart-all now uses `start` instead of `start-all`

This makes the default command more intuitive: "start" starts everything.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Shows for each repo (parent + 3 submodules):
- Branch name and tracking status (+ahead/-behind)
- git status --short (modified/untracked files)
- git diff --stat for unstaged changes
- git diff --cached --stat for staged changes

This makes it much easier to see the state across all 4 repos at once.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add E2E test for logout redirect (verifies page shows login content after logout)
- Add E2E test for restore redirect (verifies redirect to dashboard after
  successful secret key restore)
- Update happy submodule with redirect fixes:
  - Logout now redirects to home/login page instead of staying on settings
  - Restore now redirects to dashboard after successful login

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add error-banners.test.ts that verifies error status is shown when
  server connection fails
- Fix type error in create-account.test.ts (networkFailures is string[])

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add explicit test timeout (180s) for first test that includes account creation
- Use PID file from .pids-slot-N/server.pid to reliably kill server process
- Add multiple fallback methods (PID file, lsof, fuser) to ensure server stops
- Verify server is actually down before testing disconnected state
- Increase wait times for socket.io disconnection detection
- Add better logging for debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ossible

The test is flaky because:
- Killing the server PID doesn't fully stop it (respawns or child processes)
- Server continues responding even after kill -9
- Need a better approach like network interception or server-side test endpoint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
… support

- Add voice_agent/ directory with scripts to create/manage ElevenLabs agents
  - setup-agent.sh: Idempotent agent creation with client tools configured
  - list-agents.sh, get-agent.sh, delete-agent.sh: Agent management utilities
  - system_prompt.md: Voice assistant personality and instructions
- Update happy submodule: private voice agent with server-side token generation
- Update happy-server submodule: improved voice token error handling

Enables self-hosted deployments to configure their own ElevenLabs voice agent.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove voice_agent/ directory (scripts now obsolete, functionality moved to webapp)
- System prompt embedded in happy/sources/sync/apiVoice.ts as single source of truth

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update Makefile targets to use happy-launcher.sh
- Make `stop` target stop daemon and cleanup all slots
- Update start-server.sh to wrap happy-launcher.sh
- Update .devcontainer/Makefile server target
- Expand QUICKSTART in README with full self-hosting steps:
  - Create account in webapp
  - Get secret key
  - Install CLI on dev machines
  - Authenticate with backup key
  - Start daemon
  - Optional voice assistant setup
- Update all documentation to reference happy-launcher.sh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- README.md: Minimal intro with links to guides
- QUICKSTART.md: Self-hosting setup with architecture diagram
- CONTRIBUTING.md: Developer guide with workflow details
- docs/DEPENDENCIES.md: Moved reference docs

Deleted obsolete files:
- DEBUG_WEB_AUTH.md
- E2E_TESTING.md (covered by CONTRIBUTING)
- SELF_HOSTED_SETUP.md (replaced by QUICKSTART)
- SETUP_COMPLETE.md
- WEB_CLIENT_GUIDE.md
- docs/E2E_TESTING_PLAN.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- --debug flag enables DANGEROUSLY_LOG_TO_SERVER_FOR_AI_AUTO_DEBUGGING
- Server gets the env var directly
- Webapp gets PUBLIC_EXPO_DANGEROUSLY_LOG_TO_SERVER_FOR_AI_AUTO_DEBUGGING=1 and EXPO_PUBLIC_DEBUG=1
- Voice session logs now gated by debug flag

Usage: ./happy-launcher.sh --debug start

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

3 participants