- Improved preview output columns: Removed id and tag columns, added Title (from metadata.summary.text), First Message (first user message), and human-readable Updated date
- Reordered columns for clarity: Updated, Msgs (fixed width), Title, First Message, Path
- Added --message=PATTERN filter option for fuzzy matching on first user message (case-insensitive)
- Fixed deletion count to use actual session count instead of result.changes (which included CASCADE deleted messages)
- Added helper functions: formatDate(), truncate(), extractUserText()
Implement a visibility-aware notification system that delivers toast messages via SSE to visible browser tabs instead of sending push notifications, reducing unnecessary push requests. Includes VisibilityTracker for monitoring connection visibility, toast UI components, and enhanced SSEManager with toast delivery capability.
Add configurable host binding for the Mini App HTTP server through:
- New `webappHost` configuration (defaults to 127.0.0.1 for security)
- CLI arguments `--host` and `--port` with flexible parsing (--host=value or --host value)
- Priority order: CLI args > env vars > settings.json > defaults
- Updated Bun.serve() to bind to the configured hostname
Modified:
- server/src/config/settings.ts
- server/src/config/serverSettings.ts
- server/src/configuration.ts
- server/src/web/server.ts
- server/src/index.ts
- cli/src/commands/server.ts
Extract permission and model mode validation into reusable functions utilizing
@hapi/protocol schemas. Use isPermissionModeAllowedForFlavor and
isModelModeAllowedForFlavor to validate modes based on session flavor (claude/codex).
Replace inline type definitions with shared types from @hapi/protocol.
Extract permission mode display logic into shared utilities for better reusability and maintainability. Add PermissionModeTone type and related helpers to centralize mode-based styling rules across components. Update components to use new PermissionModeOption type for consistent permission mode presentation.
Extracted five focused modules from SyncEngine to improve maintainability
and separation of concerns:
- EventPublisher: handles event broadcasting and listener management
- SessionCache: manages session state and lifecycle
- MachineCache: manages machine state and lifecycle
- MessageService: handles message storage and retrieval
- RpcGateway: handles RPC communication with sessions and machines
- aliveTime: utility for clamping and validating alive timestamps
Removed unused members (sessionMessages cache, fetchMessages,
getSessionMessages, setPermissionMode, setModelMode) that added
complexity without clear value.
SyncEngine now orchestrates these services as a lightweight facade,
improving code organization and testability.
Instead of throwing a schema mismatch error when version is 0 but tables already exist, set the version and return. This allows the database to properly initialize without erroring.
Replace legacy migration logic (ALTER TABLE, missing column checks) with explicit
schema version tracking. This prevents silent schema mismatches and simplifies the
database lifecycle—users must rebuild or offline-migrate on version mismatch.
Changes:
- Add SCHEMA_VERSION and REQUIRED_TABLES constants
- Refactor initSchema() to check version and table presence
- Extract createSchema() and helper methods (getUserVersion, setUserVersion, etc)
- Add compound indexes for better query performance (tag+namespace, platform+namespace)
- Store dbPath for better error messages
Extract notification logic from PushNotifier into a modular architecture
with NotificationHub as the central coordinator and NotificationChannel
interface for different notification providers (push, telegram). This
enables better separation of concerns and easier addition of new
notification channels in the future.
- Create NotificationHub to coordinate multiple notification channels
- Create NotificationChannel interface for channel implementations
- Move push notification logic to PushNotificationChannel
- Update HappyBot to implement NotificationChannel
- Simplify HappyBot by removing sync event handling (delegated to hub)
- Add notification helper utilities (sessionInfo, eventParsing)
- Update index.ts to use new notification architecture
Allow updateSessionMetadata to conditionally update the updated_at timestamp
by adding an optional touchUpdatedAt flag. When set to false, the timestamp is
not modified, enabling metadata updates without changing the last modified time.
Implement push notification system with VAPID keys, client service worker integration, and push subscription management. Includes server-side PushService for sending notifications and PushNotifier for reactive event handling, plus client-side usePushNotifications hook and service worker support.
Implements comprehensive session lifecycle management with user-friendly interactions:
Rename: Update session metadata.name via PATCH endpoint with conflict detection
Archive: Abort active sessions via DELETE endpoint with validation
Delete: Permanently remove inactive sessions with cascade cleanup
Backend:
- Store.deleteSession() removes session and cascade-deletes messages
- SyncEngine.renameSession() with concurrency error handling
- SyncEngine.deleteSession() with active session validation
- PATCH /sessions/:id for rename, DELETE /sessions/:id for delete
Frontend Components:
- RenameSessionDialog: Text input with auto-focus and error display
- SessionActionMenu: Modal with rename, archive, delete buttons
- ConfirmDialog: Reusable confirmation with error feedback
- SessionHeader: Menu button (⋮) triggering action menu
- SessionList: Long-press detection triggering item actions
Interactions:
- Long-press on session list items (500ms threshold) opens action menu
- Menu button in session header (non-Telegram environments only)
- Confirmation dialogs with descriptive warnings for destructive actions
- Real-time error display in dialogs on operation failure
- Haptic feedback on long-press via usePlatform hook
Accessibility:
- Keyboard support (Enter/Space) for long-press handler
- Focus management in RenameSessionDialog
- Proper ARIA labels and semantic HTML
- Added /health endpoint to server for readiness checks (no auth required)
- Created autoStartServer module that auto-starts server when:
- HAPI_SERVER_URL not set (using default localhost:3006)
- cliApiToken exists in settings (server previously used)
- Port 3006 is not currently listening
- Server runs as child process (not daemon) and exits when CLI exits
- Integrated maybeAutoStartServer() into hapi, codex, and gemini commands
Implement namespace support across sessions, machines, and users for multi-user server deployments. Add access control with specific error reasons (namespace-missing, access-denied, not-found) and database schema updates with namespace columns and indexes.
- Add LICENSE file to root and cli/ directories with LGPL-3.0-or-later text
- Create cli/NOTICE file with MIT attribution for happy-cli derived code
- Update license field in cli/, server/, and web/ package.json to "LGPL-3.0-or-later"
- Add NOTICE to cli/package.json files array for npm publishing
Implements bidirectional sync of permission/model modes between CLI sessions and web app. Adds Codex-specific permission modes (read-only, safe-yolo, yolo) alongside Claude's modes. Web can now control CLI session state via RPC set-session-config handler, while CLI broadcasts state changes through keep-alive payloads. UI controls are flavor-aware, showing appropriate modes for Claude vs Codex vs Gemini. Type centralization in api/types eliminates circular dependencies.
Implements full-stack slash command autocomplete with agent-specific built-in commands and user-defined command discovery. Includes React Strict Mode fix for suggestion handling.
Implement comprehensive worktree session support allowing users to spawn sessions in temporary git worktrees. Includes backend worktree management, full-stack integration, and refined UI for session type selection.
Backend:
- Add worktree creation/removal utilities with branch management
- Track worktree metadata (basePath, branch, name, path) in session metadata
- Automatic cleanup of worktrees when sessions fail or exit
- Enhanced error handling with stderr tail logging
UI improvements:
- Redesign session type toggle with improved alignment and spacing
- Move worktree description inline with label for cleaner layout
- Add branch name input field that appears when worktree mode selected
- Auto-focus on worktree input when switching modes
- Reduce gap between radio options from gap-3 to gap-1.5
- Update descriptive text and placeholders for clarity
Integration:
- Thread worktree parameters through API client, RPC handlers, and daemon
- Add worktreeEnv utility to read worktree info from environment
- Update session spawning to support both simple and worktree modes
* fix: use timing-safe comparison for CLI API token validation
Replace direct string comparison (===) with constant-time comparison
using crypto.timingSafeEqual to prevent timing attacks that could
leak information about the token character by character.
Affected locations:
- server/src/web/routes/auth.ts (accessToken validation)
- server/src/web/routes/cli.ts (bearer token middleware)
- server/src/socket/server.ts (socket.io /cli namespace auth)
* Update server/src/utils/crypto.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Add shared isBunCompiled() function for consistent runtime detection
- Support Windows virtual filesystem paths (/~BUN/) alongside Linux/macOS (/$bunfs/)
- Use Bun.main for reliable detection instead of process.argv[1]
- Remove redundant $bunfs checks from cli/src/index.ts
- Update cli/src/utils/bunRuntime.ts to use shared detection function
- Create server/src/utils/bunCompiled.ts for server-side compilation check
Updates ModelContextProtocol SDK and multiple dependent libraries to latest versions. Refactors TypeScript schemas to avoid instantiation depth issues by widening Zod types and using explicit type parameters.
- Add CLI-side terminal management via Bun.Terminal with TerminalManager
- Implement server-side Socket.IO proxy for terminal I/O between web and CLI
- Create web terminal UI component with xterm.js and support for resize/reconnect
- Add terminal route and navigation button in session chat
- Include comprehensive terminal implementation plan and architecture docs
Adds support for hosting the web UI separately from the hapi server on static hosts (GitHub Pages, Cloudflare Pages). Users can now set a custom server origin via a dialog on the login screen, with the ability to return to same-origin behavior.
Changes include:
- New useServerUrl hook for managing server URL configuration and storage
- Updated API client to support baseUrl parameter for all requests
- Enhanced login UI with server picker dialog (top-right button)
- Auth system now keys tokens per baseUrl to support multiple servers
- SSE connection updated to use configured baseUrl
- Documentation updates for standalone hosting setup