325 Commits

Author SHA1 Message Date
Dex
9236eb5581 Merge pull request #455 from smorin/main
main
2025-08-20 08:25:35 -07:00
samdickson22
c087a1cb84 Display subagent names instead of generic "Task" label
Parse and display the subagent_type field from Claude Code's Task tool
calls to show specific agent names (e.g., "codebase-analyzer") instead
of the generic "Task" label. This brings the WUI display in line with
how Claude Code presents named subagents.

- Show subagent_type in main event display when available
- Display subagent names in task group headers
- Include subagent names in collapsed task previews
- Maintain backward compatibility for tasks without subagent_type

Fixes ENG-1893
2025-08-19 13:52:12 -07:00
Steve Morin
baa22b147a Merge branch 'humanlayer:main' into main 2025-08-19 10:29:03 -07:00
Sundeep Malladi
8c1b2d85c3 Adjust spacing behavior of lists in stream (#458)
* Prevent 'escape' from exiting full screen

* Fix whitespace issues in rendered prose-terminal (markdown) lists

* Update humanlayer-wui/src/components/DebugPanel.tsx

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-08-19 11:37:18 -05:00
Steve Morin
02bc512bc8 feat(wui): add keyboard shortcuts indicator to status bar
Adds a help icon button to the status bar that opens the keyboard shortcuts
panel, improving discoverability of the existing '?' hotkey functionality.
The button displays a tooltip indicating it shows keyboard shortcuts and
maintains consistent styling with other status bar buttons.

Fixes #449
2025-08-19 00:10:30 -07:00
Dex
1fdebd0498 Merge pull request #452 from dexhorthy/eng-1958-mcp-stdio-correlation
Phase 1: Restore MCP stdio server in hlyr
2025-08-18 19:12:16 -07:00
dexhorthy
cb8b360192 Phase 1: Restore MCP stdio server in hlyr
- Create mcp.ts with claude_approvals command for local daemon integration
- Register MCP command in index.ts
- Uses daemon RPC instead of HumanLayer API for approval management
2025-08-18 18:45:03 -07:00
samdickson22
72f2e8c31e ctrl+x support in text box support 2025-08-18 17:31:50 -07:00
Steve Morin
64a956fae5 fix(wui): enable meta+enter submission from all fields in session launcher
Resolves issue #443 where meta+enter keyboard shortcut only worked from
the prompt textarea. Now works consistently from title, directory, and
prompt fields by moving keyboard handling to the modal level.

- Add global meta+enter handler at SessionLauncher modal level
- Remove input-specific keyboard handler from CommandInput textarea
- Update visual hints to show shortcut on Launch button
- Clean up footer hints for consistency
2025-08-18 13:21:59 -07:00
Dex
14c570a782 Merge pull request #438 from dexhorthy/dexter/eng-1941-add-brainrot-mode-easter-egg-and-improve-command-palette-ux
feat: improve command palette UX
2025-08-15 10:43:23 -05:00
Sundeep Malladi
b035ffc34f Merge remote-tracking branch 'upstream' into ENG-1874 2025-08-15 07:59:17 -05:00
Sundeep Malladi
9a55e0c2f4 feat(mcp): Add HTTP MCP server support to OpenAPI and implement daemon integration
- Update OpenAPI spec to support both stdio and HTTP MCP server configurations
- Add type, url, and headers fields for HTTP servers alongside existing stdio fields
- Update mapper to handle optional fields for both server types
- Remove 5-minute timeout from MCP approval handler for better session resumption
- Configure WUI to use HTTP MCP server endpoint instead of stdio npx command

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 15:31:16 -05:00
Dex
97abfc7cca Merge pull request #440 from samdickson22/sam/eng-1943-i-on-expanded-tool-modal-should-close-the-modal
feat: add 'i' key toggle to close expanded tool modal
2025-08-14 14:26:56 -05:00
Dex
7b8ec910c9 Merge pull request #432 from samdickson22/sam/eng-1891-improve-session-recovery-allow-recovery-of-more-types-of
sam/eng-1891 - fix: enable resuming failed sessions with proper message delivery
2025-08-14 14:26:48 -05:00
samdickson22
d71d3dde03 feat: add 'i' key toggle to close expanded tool modal
Enable the 'i' key to close the ToolResultModal for a true toggle experience.
This allows users to navigate sessions with one hand - j/k for scrolling
and 'i' to toggle the modal open/closed, without reaching for ESC.

- Add 'i' hotkey handler to close modal when open
- Update footer hint to show "i or ESC to close"
2025-08-14 12:14:01 -07:00
samdickson22
5531d97468 Merge upstream/main - resolve conflict in useSessionLauncher
- Keep query persistence feature from upstream
- Preserve title field functionality from feature branch
- Remove redundant query field from config object
2025-08-14 10:19:15 -07:00
Dex
7010811ca3 Merge pull request #433 from samdickson22/sam/eng-1887-remove-snapshot-based-diff-rendering-failed-console-log
sam/eng-1887 - fix: suppress noisy snapshot-based diff rendering console warning
2025-08-14 11:35:59 -05:00
dexhorthy
aabd422a14 chore: Add debug logging for MCP tool_use_id verification
NB - SOME TEST IS STALLING OUT RIGHT NOW! Needs a timeout/failure or something.

- Add console.debug logging in WUI to track tool_use_id in approval events
- Update CLAUDE.md documentation for test commands
2025-08-13 23:18:33 -07:00
Dex
25081dc77f Merge pull request #436 from samdickson22/sam/eng-1678-accidentally-leaving-the-sessionlauncher-when-youve-got-a
feat: add localStorage persistence for SessionLauncher draft prompts
2025-08-13 23:16:48 -05:00
samdickson22
0049c3a4fa fix: resolve session state update issues and stale closure in bypass permissions toggle
- Use updateSession instead of updateSessionOptimistic in Layout when receiving server data
- Fix stale closure issue in meta+y hotkey by reading current state directly from store
- Ensures bypass permissions toggle always uses the most current session state
2025-08-13 20:18:10 -07:00
samdickson22
e9f7d2e12a feat: add localStorage persistence for SessionLauncher draft prompts
Prevents loss of draft prompts when users accidentally close the launcher
by saving the query text to localStorage on every keystroke. The draft
is restored when the launcher reopens and cleared only after successful
session launch.

- Save draft to localStorage on every query change
- Restore draft when launcher reopens (via 'c' shortcut or Cmd+K)
- Clear draft only after successful session creation
- Preserve draft on errors for retry attempts
- Follow existing ResponseInput localStorage pattern for consistency
2025-08-13 20:18:02 -07:00
samdickson22
01687fa728 feat: add meta+Enter keyboard shortcut to bypass permissions modal
Enables quick submission of the bypass permissions dialog using meta+Enter (Cmd+Enter on Mac, Ctrl+Enter on Windows/Linux). The shortcut respects validation rules and only submits when the form is valid. Visual indicator shows the keyboard shortcut next to the submit button when enabled.
2025-08-13 20:17:53 -07:00
samdickson22
69e00845e1 fix: uncomment debug function and logger import per review feedback
- Kept debugLogSnapshotFailure function and logger import uncommented
- Function invocation remains commented in catch block
- Added proper ESLint and TypeScript ignore comments for unused function
- Cleaner approach that keeps debug code readily available
2025-08-13 19:51:34 -07:00
samdickson22
55a20dd783 fix: comment out debug function to pass linting and type checks
- Commented out entire debug function as block comment
- Logger import also commented to avoid unused import
- Clean approach that preserves debug code for future use
- All checks now pass (lint, typecheck, format)
2025-08-13 19:28:25 -07:00
samdickson22
d53a31ad61 style: apply prettier formatting to CustomDiffViewer 2025-08-13 19:24:42 -07:00
samdickson22
98c8ea8137 refactor: extract debug logging to separate function for cleaner code
- Created debugLogSnapshotFailure helper function with original logging logic
- Commented out just the function invocation instead of entire code block
- Kept logger import active for potential future use
- Cleaner approach that preserves debug capability without code clutter
2025-08-13 19:24:09 -07:00
samdickson22
cf0615151d fix: update expiry notification text to use "bypass permissions" terminology
Changed notification messages from "Dangerous skip permissions expired" to
"Bypass permissions expired" for consistency with user-facing terminology
2025-08-13 18:44:27 -07:00
samdickson22
3334281ab6 fix: remove unused catch parameter to pass linting 2025-08-13 18:44:19 -07:00
samdickson22
d4f8d73d16 fix: remove unused logger import and error variable to pass linting 2025-08-13 18:43:40 -07:00
samdickson22
13d4fb4e7f fix: suppress noisy snapshot-based diff rendering console warning 2025-08-13 18:40:36 -07:00
dexhorthy
22ca015d2a feat(ui): enhance command palette with conditional display logic
- Hide 'Brainrot Mode' until user types 'brain' in search
- Show context-aware 'Archive'/'Unarchive' label based on session state
- Improves UI clarity and reduces clutter in command palette
2025-08-13 18:33:19 -07:00
dexhorthy
a59fc3a28a Merge branch 'main' of github.com:humanlayer/humanlayer into brainrot-mode 2025-08-13 17:40:46 -07:00
dexhorthy
421540a7eb improvements 2025-08-13 17:40:40 -07:00
samdickson22
e156de19a7 feat: add optional title field for sessions
- Add title field to CreateSession API endpoint
- Update SDK and client libraries to support title parameter
- Add title input to UI session launcher
- Add --title flag to CLI launch command
- Store and display custom titles instead of using query as title
2025-08-13 16:50:31 -07:00
samdickson22
933743f063 fix: enable resuming failed sessions with proper message delivery
- Fix claudecode-go to pass query as positional argument with --print flag
- Allow failed sessions with claude_session_id to be resumed in backend
- Add debug logging for failed session resumption attempts
- Update integration tests to match new behavior allowing failed sessions
- Remove unnecessary session status restrictions in frontend components
2025-08-13 16:49:06 -07:00
Dex
8896053971 Merge pull request #429 from samdickson22/sam/eng-1936-sometimes-the-context-used-shows-as-like-10x-the-actual
Fix token counting for Claude sessions
2025-08-13 17:55:29 -05:00
Dex
ebbe0def6a Merge pull request #430 from samdickson22/sam/eng-1905-active-sessions-show-in-archive-view
sam/ENG-1905 Fix archive view showing active sessions
2025-08-13 17:54:57 -05:00
samdickson22
90307e05df Merge upstream/main and resolve conflicts
- Keep Shift+R rename session hotkey from upstream
- Remove useStealHotkeyScope call (SessionDetail is base layer)
- Preserve all escape key handling improvements
2025-08-13 15:27:01 -07:00
samdickson22
8f28580c8d fix: forward archivedOnly parameter to SDK in getSessionLeaves
The archivedOnly parameter was not being passed from the HTTP client
adapter to the underlying SDK, causing archive view to show all sessions
instead of just archived ones. This regression was introduced in 436e4a1
when the previous fix from PR #394 was inadvertently reverted.
2025-08-13 15:12:20 -07:00
samdickson22
6e5b82f361 fix: correct token counting for Claude sessions
- Fix session ID extraction from assistant/user messages
- Process token updates even without Claude session ID
- Skip incorrect cumulative token counts from result events
- Update UI to reflect real-time token changes in active session
- Publish token update events to keep UI in sync

The API sends result events with cumulative cache read tokens that incorrectly accumulate across the entire session. This fix only trusts token counts from individual assistant messages which are accurate.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-13 13:55:58 -07:00
samdickson22
521bd6a635 fix: add missing ansi-regex dependency for ansiParser 2025-08-12 15:31:32 -07:00
samdickson22
347c1e1162 Merge upstream/main and resolve conflicts
- Kept upstream's migration 12 for model_id column
- Moved token tracking fields to migration 13
- Regenerated server.gen.go from OpenAPI spec
- All GetSession queries already include model_id field
2025-08-12 15:20:21 -07:00
Dex
b529a51e66 Merge pull request #427 from samdickson22/sam/eng-1930-remove-misleading-verbs-like-connecting
sam/eng-1930: removed connecting from list of robot words
2025-08-12 17:11:23 -05:00
Sundeep Malladi
99a8d9f503 Approval Exploration Grabbag (#428)
* Add model_id to stored session fields

* feat(wui): add stacked cards component and demo

Create a reusable StackedCards component inspired by Sonner's toast stacking,
with smooth animations for card dismissal and stack reorganization.

- Add StackedCards component with configurable gap and visible card count
- Implement smooth scale and translate animations for stacking effect
- Create demo page at /demo/stacked_cards with interactive controls
- Cards stack with negative Y offset to show peeking effect

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

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

* feat: Add database info to debug panel with improved layout

- Add REST API endpoint /api/v1/database-info to expose SQLite stats
- Implement GetDatabaseInfo handler with file size, counts, and metadata
- Add helper methods to SQLiteStore for session/approval/event counts
- Update debug panel with wider grid layout (max-w-3xl)
- Display database path, size, table counts, and statistics in organized grid
- Add copy button for database path
- Remove unused RPC implementation in favor of REST endpoint

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

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

* post cherry-pick regen

* Couple additional goodies from 166411c4a6

* mct; includes fix for permission_denials

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-12 15:53:24 -05:00
samdickson22
6c0030f3ea removed connecting from list of robot words 2025-08-12 11:07:27 -07:00
samdickson22
5265202787 format 2025-08-12 11:02:31 -07:00
samdickson22
5a628e33f2 fix: improve escape key handling and prevent modal stacking
- Add proper escape key handling to back out of modals and session detail view
- Fix ESC key in bypass permissions dialog to blur input instead of closing modal
- Implement hotkey scope stealing for modals to prevent background hotkey conflicts
- Add SessionDetailHotkeysScope to all session detail hooks for proper scope management
- Prevent modal stacking by checking active scopes before opening modals (alt+y, cmd+y)
- Fix tool result modal scope cleanup to prevent stuck states blocking global hotkeys
- Improve escape key cascade: blur inputs → clear confirmations → unfocus → close view
- Handle escape key properly when fork view and other modals are open
- Clean up debug logging from development
2025-08-12 10:35:29 -07:00
samdickson22
15c191745e format 2025-08-11 17:30:01 -07:00
samdickson22
9e24a633e7 feat: add token usage tracking and display
- Track input, output, cache creation, and cache read tokens in sessions
- Calculate and store effective context tokens (sum of all token types)
- Add context limit management with default of 168k tokens
- Display token usage badge in UI with visual warnings at 60% and 90%
- Update OpenAPI spec and regenerate TypeScript SDK types
- Add database migrations for new token tracking columns
2025-08-11 17:20:49 -07:00
Dex
add13105b1 Merge pull request #423 from samdickson22/sam/eng-1763-render-bash-color-codes
Add ANSI color code rendering for Bash tool outputs
2025-08-11 15:52:47 -07:00