Commit Graph

981 Commits

Author SHA1 Message Date
Dex
1e544b4213 Update research_codebase.md 2025-08-05 19:26:51 -05:00
Sundeep Malladi
ad48d78d5d Automate Brew Cask Nightly Releases with Side-by-Side Support (#404)
* Phase 1: Build-Time Version Injection in Daemon

- Create internal/version package for build-time version management
- Update RPC server to use version.GetVersion() instead of hardcoded constant
- Update HTTP API handlers to use version package
- Configure workflow to inject version during build with -ldflags
- Update tests to use version package

This allows nightly builds to report version as "0.1.0-YYYYMMDD-nightly"
while dev builds show "0.1.0".

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

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

* Phase 2: Dynamic Tauri App Configuration

- Create nightly Tauri config with distinct productName and identifier
- Update workflow to use nightly config for scheduled builds
- Nightly builds will create CodeLayer-Nightly.app with separate identifier

This enables side-by-side installation of stable and nightly builds.

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

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

* Add pre-generated nightly icons with color rotation

* Phase 3: Update workflow to use nightly icons for scheduled builds

* Phase 4: Configure Daemon Paths and Ports via Build Flags

Configure the nightly daemon to use different default paths and ports by injecting them at build time using ldflags.

Changes:
- Make DefaultDatabasePath, DefaultSocketPath, and DefaultHTTPPort injectable via ldflags in hld/config/config.go
- Add setDefaults() function to handle string-to-int conversion for HTTP port
- Update release workflow to inject nightly configuration for scheduled builds:
  - Database: ~/.humanlayer/daemon-nightly.db
  - Socket: ~/.humanlayer/daemon-nightly.sock
  - HTTP Port: 7778
- Regular builds continue to use standard defaults

This allows nightly and stable daemons to run side-by-side without conflicts.

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

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

* Phase 5: Update Homebrew Cask for Side-by-Side Support

- Add automated nightly cask updates to release workflow
  - Calculate SHA256 and construct release URLs
  - Checkout homebrew tap repository
  - Generate codelayer-nightly.rb with proper configuration
  - Commit and push updates automatically
- Update nightly cask to support side-by-side installation
  - Renamed binaries with -nightly suffix
  - Uses nightly-specific data paths
  - No conflicts declared with stable cask
- Add TODO for future stable release automation

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

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

* Add test_nightly mode to workflow for testing nightly build behavior

* Fix nightly icons: Convert 32x32.png and Square30x30Logo.png to RGBA format

* Use HUMANLAYER_HOMEBREW_CASK_WRITE_GITHUB_PAT for homebrew tap authentication

* change test_nightly to release_nightly

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-05 14:08:29 -05:00
Dex
97b47729ef Merge pull request #403 from samdickson22/sam/eng-1774-pre-fill-session-launcher-directory-picker-with-on-first
Pre-fill session launcher directory picker with ~/ on first use
20250805-nightly-test 20250805-nightly 20250804_234935
2025-08-04 16:20:54 -07:00
Dex
08786747fe Merge pull request #400 from dexhorthy/wtpath
default worktree path
2025-08-04 15:59:41 -07:00
Dex
92e69c5fab Merge pull request #401 from samdickson22/sam/eng-1862-regression-directories-should-be-left-truncated-not-right
Sam/eng 1862 regression directories should be left truncated not right
2025-08-04 15:59:31 -07:00
samdickson22
5aac54e8d7 prettier 2025-08-04 15:45:18 -07:00
samdickson22
550de30c7d Pre-fill session launcher directory picker with ~/ on first use
- Set default working directory to ~/ for new users
- Focus directory field when it contains default value
- Focus prompt field for normal usage
- Add ref forwarding to SearchInput for programmatic focus
2025-08-04 15:27:29 -07:00
samdickson22
b36f75919d no forwardRef claude.md 2025-08-04 15:16:50 -07:00
samdickson22
de19ee3214 prettier 2025-08-04 14:31:34 -07:00
samdickson22
94fb2d2fdd comment added 2025-08-04 12:24:31 -07:00
samdickson22
02998e54ad ENG-1862: Right truncation with tilde fix 2025-08-04 11:56:22 -07:00
dexhorthy
ba9ea67c11 default worktree path 2025-08-04 11:34:41 -07:00
Dex
b872bd475e Merge pull request #399 from balanceiskey/linear-hack
Migrate Linear CLI
2025-08-04 11:23:17 -07:00
Dex
42b4b747f9 Delete hack/linear/linear 2025-08-04 12:43:34 -05:00
Sundeep Malladi
66b14f95b7 Migrate Linear CLI 2025-08-04 10:25:16 -07:00
Dex
0fa8b76479 Merge pull request #397 from dexhorthy/dexter/eng-1859-improve-release-notes-generation-in-macos-build-workflow-add
feat: automate release notes generation in macOS build workflow
20250804-nightly 20250803-nightly
2025-08-02 21:08:53 -07:00
Dex
b2984d18de Merge pull request #396 from balanceiskey/justify-end-scroll-something-or-other
restore random spinners
2025-08-02 21:08:44 -07:00
dexhorthy
2642a160fb feat: automate release notes generation in macOS build workflow
- Add cron schedule for daily nightly builds at 7am PT
- Update version format to prevent collisions:
  - Nightly builds: YYYYMMDD-nightly
  - Manual builds: YYYYMMDD_HHmmss
- Replace outdated manual installation instructions with brew cask instructions
- Remove separate daemon binary upload (now embedded in DMG)
- Change releases from draft to published for immediate availability
2025-08-01 16:32:12 -07:00
Sundeep Malladi
8e3cdb71bb restore random spinners 2025-08-01 17:36:03 -05:00
Dex
1637b72665 Merge pull request #395 from balanceiskey/justify-end-scroll-something-or-other
Justify end scroll something or other
20250802_000111
2025-08-01 15:34:14 -07:00
Sundeep Malladi
0a11ffc48e mct 2025-08-01 17:28:04 -05:00
Sundeep Malladi
c997cb4d09 Fix UI flash when continuing sessions by preserving session data
- Pre-fetch new session data before navigation to eliminate loading gap
- Pass session state through React Router navigation state
- Update activeSessionDetail immediately in Layout component
- Add KeyboardShortcut component for consistent kbd styling
- Minor UI improvements to feedback button and theme selector

This ensures smooth transitions when continuing sessions by maintaining
valid session data throughout the navigation flow, preventing the brief
flash of empty content.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 17:23:43 -05:00
Sundeep Malladi
c64086c0eb tweaks 2025-08-01 14:50:33 -05:00
Sundeep Malladi
f5745a8c88 this is making me dead inside 2025-08-01 14:36:36 -05:00
Dex
04f55b5c7d Delete hack/ralph.sh 2025-08-01 14:02:19 -05:00
Sundeep Malladi
08fafb344a First version of this that I'm going to throw out 2025-08-01 13:58:08 -05:00
Dex
87dd6d6e0f Merge pull request #394 from balanceiskey/sundeep/eng-1849-archive-tab-shows-non-archived-sessions-in-rest
List only archived sessions when flipping to archived view
2025-08-01 08:40:23 -07:00
Sundeep Malladi
52a04a2e59 List only archived sessions when flipping to archived view 2025-08-01 10:16:09 -05:00
Dex
dca3af3c2b Merge pull request #393 from humanlayer/dexter/eng-1786-i-keep-thinking-the-markdown-bullets-are-dropdowns
Update markdown-terminal.css
2025-07-31 14:34:09 -07:00
Dex
ae7e87da05 Update markdown-terminal.css 2025-07-31 16:28:27 -05:00
Dex
ca079a85bb Merge pull request #387 from dexhorthy/prompts
some dumb vibe-y prompt tweaks
2025-07-31 14:00:01 -07:00
Sundeep Malladi
02c697e833 fix(wui): standardize keyboard shortcuts for message submission
Make new session creation consistent with existing session messages by
using Cmd+Enter (Mac) or Ctrl+Enter (Windows/Linux) for submission.
This allows Enter to create new lines, supporting multiline input across
all text areas.

- Update CommandInput to use Cmd/Ctrl+Enter instead of plain Enter
- Add help text showing platform-specific keyboard shortcuts
- Remove misleading placeholder text suggesting Enter submits
- Document the consistent shortcut in the hotkey panel

Fixes ENG-1812
2025-07-31 15:52:05 -05:00
Sundeep Malladi
fd6739dffe Suppress approval notifications for already-approved messages (and some other stuff) (#391)
* Fix auto-accept edits toggle to update store directly

- Update SessionDetail shift+tab handler to directly update store
- Ensures immediate UI feedback when toggling auto-accept mode
- Add debug logging to track toggle behavior

* Add SessionSettingsChanged event for real-time settings updates

Implements a new event type to propagate session settings changes (like auto-accept edits)
from backend to frontend via SSE. This ensures the UI stays in sync when settings are
modified through any interface (REST API or RPC).

Key changes:
- Add EventSessionSettingsChanged constant to event bus types
- Add UpdateSessionSettings method to SessionManager interface to centralize event publishing
- Update REST API handler to use session manager instead of direct store updates
- Fix SSE handler to recognize and forward session_settings_changed events
- Add TypeScript types and event handling in frontend
- Wire up event handler in Layout.tsx to update local state
- Add make task for regenerating SDKs from OpenAPI specs

The implementation follows the existing architectural pattern where managers (not handlers
or stores) are responsible for publishing events to maintain consistency.

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

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

* Add approval notifications to Layout component

Implements proper notification handling for approval events in the main Layout component.
This ensures users are notified when AI agents request approval for tool usage.

Key changes:
- Add notification tracking with isItemNotified/addNotifiedItem to prevent duplicate notifications
- Implement onNewApproval handler to show notifications when approvals are requested
- Move session fetching outside completion block for better code reuse
- Add proper TypeScript types for event data
- Show tool-specific approval messages with fallback for error cases

The implementation follows the event-based notification pattern, as the investigation
showed that status-based notifications (waiting_input transitions) never occur in practice.

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

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

* Add delay to prevent notifications for auto-approved items

Implements a 100ms delay in the onNewApproval handler to check if an approval
was auto-resolved before showing a notification. This prevents the brief flash
of approval notifications for edit operations when auto-accept mode is enabled.

The solution works by:
- Waiting 100ms after receiving a new_approval event
- Checking if the session is still in waiting_input status
- Skipping the notification if the status has already changed (indicating auto-approval)

This handles the race condition where the backend sends both new_approval and
approval_resolved events in quick succession for auto-approved items.

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

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

* Fix auto-approval notification logic with approval cache

Replaces the flawed session status check with a proper approval resolution cache.
The previous approach incorrectly skipped notifications for manual approvals (like Bash)
because it checked session status before updating it to waiting_input.

The new implementation:
- Tracks resolved approvals in a cache when onApprovalResolved fires
- Checks this cache after 100ms delay to determine if an approval was auto-resolved
- Works correctly for both auto-approved (Edit tools) and manual approval cases

Also adds timestamps to console logs for better debugging of event timing.

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

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

* feat(wui): rework shift+tab to toggle auto-accept edits for selected sessions

- Add bulkSetAutoAcceptEdits method to store for bulk updating auto-accept settings
- Replace shift+tab view mode toggle with auto-accept toggle functionality
- Similar behavior to 'e' archive hotkey: works on selected sessions or focused session
- Shows success/error toast notifications for user feedback
- Intelligently toggles status: if all selected sessions have auto-accept enabled, disables it; otherwise enables it

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

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

* feat(wui): improve archive hotkey behavior and add auto-accept indicator

- Fix archive hotkey ('e') to properly handle mixed selection states
- Show warning when trying to bulk archive sessions with different archived states
- Add visual indicator (⏵⏵) for running sessions with auto-accept edits enabled
- Improve error handling and logging for archive operations

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

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

* MCT

* test tweaks

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-31 15:51:52 -05:00
Allison Durham
877ec27b0a Allison/eng 1784 bundle daemon and cli with wui for single installation (#385)
* feat(daemon): add dynamic port allocation support

- Always create HTTP server regardless of port configuration
- Support port 0 for dynamic allocation
- Output actual port to stdout when using dynamic allocation
- Enable WUI to start daemon on any available port

* feat(wui): add daemon process management infrastructure

- Add Tauri shell and store plugins for process and state management
- Implement Rust daemon manager with automatic startup on app launch
- Add branch-based daemon isolation for development environments
- Create TypeScript services and hooks for daemon lifecycle management
- Add debug panel UI for manual daemon control in dev mode
- Support automatic daemon connection with managed port discovery
- Handle graceful daemon shutdown on app close
- Implement retry logic for daemon connection during startup

* feat(wui): add daemon process management infrastructure

* chore(wui): update gitignore for daemon artifacts

* build(wui): update Tauri bundle configuration

* build: add homebrew formula and update CI for daemon bundling

* formatting

* makefile to build daemon too (when run wui on dev)

* refactor: improve daemon management in WUI with async/await and better error handling

- Convert daemon start/stop operations to async/await pattern
- Switch HTTP host from 127.0.0.1 to localhost for better compatibility
- Add debug URL override support for development
- Improve error handling and startup behavior
- Fix path resolution for development mode when running from src-tauri

* daemon no longer randomly crashes
Needed to do weird stdout things

* Parse daemon log levels to improve dev logging output

Previously all daemon stderr output was logged as ERROR level, causing confusion
and double timestamps. Now we parse slog format to extract actual log levels
(INFO, WARN, ERROR, etc.) and route them to appropriate tracing levels.

* Integrate debug panel into status bar with theme-aware colors

- Move debug panel button from floating bottom-left to status bar bottom-right
- Replace Settings icon with Bug icon and match styling of other status controls
- Update connection status colors to use CSS variables for theme consistency
- Refactor DebugPanel to accept open/onOpenChange props for controlled state

* Remove local homebrew tap files - moved to separate repository

The homebrew tap is now properly maintained in its own repository
at humanlayer/homebrew-humanlayer for public distribution.

* Migrate WUI backend from tracing to log crate with tauri-plugin-log

- Replace tracing with log crate for consistency
- Add tauri-plugin-log with file rotation (50MB) and proper formatting
- Configure LogDir, Stdout (dev), and Webview targets
- Add proper prefixes: [Tauri] for WUI logs, [Daemon] for daemon logs
- Add log:default permission to capabilities

* Add frontend logging infrastructure for WUI

- Install @tauri-apps/plugin-log and @tauri-apps/api dependencies
- Create logging service with JSON serialization for objects
- Add log location notification for production builds
- Initialize attachConsole to display Rust logs in browser console
- All frontend logs will use [Console] prefix

* Migrate all console calls to use logger throughout WUI

- Replace 94 console.* calls with logger.* across 24 files
- Ensures all frontend logs are captured in production log file
- Maintains browser console output in development mode
- High-traffic files: NotificationService (22), AppStore (21), useSubscriptions (10)

* git ignore of compiled things

* fix it to not be annoyed

* Implement branch-based logging for WUI

- Extract branch detection logic (get_git_branch, extract_ticket_id, get_branch_id)
  into shared functions in lib.rs
- Configure tauri-plugin-log to use branch-based folders in development:
  ~/.humanlayer/logs/wui-{branch-id}/codelayer.log
- Update daemon.rs to use shared branch detection functions
- Add get_log_directory Tauri command to expose log paths to frontend
- Update log notification service to handle branch-based directories
- All log sources (WUI backend, daemon stderr, frontend console) now write
  to a single rotated log file per branch with clear source prefixes

* Update documentation and simplify Makefile for new logging structure

- Remove tee command from wui-dev target in Makefile since logging is now
  handled by tauri-plugin-log
- Update DEVELOPMENT.md to show new WUI log paths in environment overview
- Update CLAUDE.md files to document branch-based log locations:
  - Dev: ~/.humanlayer/logs/wui-{branch}/codelayer.log
  - Prod: Platform-specific directories
- Document that logs include all sources with prefixes: [Tauri], [Daemon], [Console]

* formatting

* add touch to bins

* ci: align GitHub Actions workflows with local development setup

- Simplify main.yml workflow to use unified setup process
- Add CI detection to setup_repo.sh for conditional tool installation
- Install CI-specific tools (Claude Code CLI, UV, golangci-lint) only in CI
- Add setup-ci and ci-tools targets to Makefile for explicit CI setup
- Parallelize npm and bun dependency installations for faster setup
- Add Go and Rust tool caching to improve CI performance
- Create platform-specific dependency script for future expansion

This change reduces workflow complexity from 75+ to ~50 lines per job while
maintaining all functionality. CI and local development now share the same
setup process, improving maintainability and consistency.

* sdk needs to build in order for wui to check
2025-07-31 12:10:26 -07:00
Dex
a204045376 Merge pull request #388 from dexhorthy/dexter/eng-1784-hlyr-bundle-compiletime
dexter/eng 1784 hlyr bundle compiletime
2025-07-31 09:28:50 -07:00
dexhorthy
59c2cb50ee fix(hlyr): inject version at build time to fix Bun bundling
Read package.json version during build instead of runtime to resolve
ENOENT errors when running bundled binary. The Bun virtual filesystem
(bunfs) doesn't include external files, causing package.json reads to
fail in bundled environments.

- Add tsup config to inject version as env var during build
- Replace runtime package.json reading with build-time VERSION constant
- Simplify build scripts to use tsup config file
2025-07-30 19:13:54 -07:00
dexhorthy
8ee309932c tweaks 2025-07-30 18:45:23 -07:00
dexhorthy
9a2c0dd723 Merge branch 'main' of github.com:humanlayer/humanlayer into prompts 2025-07-30 18:40:55 -07:00
Dex
deb36b4d21 Merge pull request #375 from dexhorthy/rose-pine
Rose pine
2025-07-30 18:26:30 -07:00
dexhorthy
95553eb3cf more tweaks 2025-07-30 17:07:19 -07:00
dexhorthy
ccce959eee commandify ralph prompts 2025-07-30 16:37:23 -07:00
Dex
c7a28f0bce Merge pull request #380 from dexhorthy/dexter/eng-1826-phase-3-of-daemon-shutdown
dexter/eng 1826 phase 3 of daemon shutdown
20250731
2025-07-30 12:11:06 -07:00
dexhorthy
08f9252622 fix(hld): fix race condition in session tests by properly cancelling contexts
The TestContinueSession_HandlesOptionalOverrides test was failing in CI
because goroutines spawned by ContinueSession were still running after
the test completed. This caused gomock to panic when the goroutines
tried to access the mock store.

Fixed by:
- Creating cancellable contexts in tests that spawn goroutines
- Deferring context cancellation with a small delay to allow cleanup
- Ensuring all ContinueSession calls use the cancellable context

This ensures all background goroutines are properly cleaned up when
tests complete.
2025-07-30 12:00:08 -07:00
dexhorthy
6df13fe3d6 fix(hld): add signal propagation script for graceful shutdown (ENG-1826)
Phase 3 completion - fixes signal handling when running daemon with logging.

The run-with-logging.sh script properly captures the daemon PID and forwards
signals (SIGTERM/SIGINT) to enable graceful shutdown. Without this, the
daemon gets force-killed by the shell/make process chain, preventing proper
session cleanup.

Key improvements:
- Captures actual daemon PID (not tee process)
- Sets up signal traps to forward TERM and INT signals
- Preserves daemon exit code
- Ensures graceful shutdown works in logged environments

This was the missing piece for making graceful shutdown work properly.
All tests passing (278 unit tests, 40 integration tests).
2025-07-30 11:36:50 -07:00
dexhorthy
59c9763c15 feat: Implement phase 3 of graceful daemon shutdown (ENG-1826)
Adds robust testing infrastructure and improves graceful shutdown:

- Created ClaudeSession interface wrapper for better testability
- Added comprehensive unit tests for StopAllSessions functionality
- Updated Manager to use interface instead of concrete claudecode.Session
- Added mockgen generation for ClaudeSession interface
- Modernized signal handling using signal.NotifyContext
- Added configurable shutdown timeout via HUMANLAYER_HLD_SHUTDOWN_TIMEOUT
- Improved force kill implementation to properly call Kill() method
- Added structured logging throughout the interrupt flow

This completes phase 3 of the graceful shutdown implementation, providing
a solid testing foundation for the daemon shutdown behavior.
2025-07-30 11:36:49 -07:00
dexhorthy
99002ecbeb wip on stopallsessions 2025-07-30 11:36:49 -07:00
Dex
8545aacb3a Merge pull request #383 from balanceiskey/sundeep/eng-1832-feedback-loom-from-weave-team
Improve keyboard shortcuts and session interaction behavior
2025-07-30 11:34:16 -07:00
Dex
0307e26000 Merge pull request #386 from dexhorthy/race-fixes
[ci] separate make targets, always run tests w/ and without race, remove tests from 'make check'
2025-07-30 11:33:27 -07:00
dexhorthy
31f59f632c remove tui refs 2025-07-30 11:27:09 -07:00
dexhorthy
3e96825d9a remove tui 2025-07-30 11:21:23 -07:00