Commit Graph

1126 Commits

Author SHA1 Message Date
Dex
1fdebd0498 Merge pull request #452 from dexhorthy/eng-1958-mcp-stdio-correlation
Phase 1: Restore MCP stdio server in hlyr
20250819-nightly
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
Dex
733c7380ce Merge pull request #451 from samdickson22/sam/eng-1960-ctrlx-doesnt-work-if-text-input-is-focused-on-session
sam/ENGp1956 ctrl+x now works in input text box
2025-08-18 18:18:30 -07:00
dexhorthy
fe197f71af Merge branch 'main' of github.com:humanlayer/humanlayer 2025-08-18 17:55:10 -07:00
Dex
98b3701f07 Merge pull request #444 from dexhorthy/wt-4
worktree command
2025-08-18 17:55:02 -07:00
Dex
081bad27c3 Update create_worktree.md 2025-08-18 19:54:54 -05:00
samdickson22
72f2e8c31e ctrl+x support in text box support 2025-08-18 17:31:50 -07:00
Dex
cabf5f6b07 Update CONTRIBUTING.md 2025-08-18 16:24:43 -05:00
Dex
fabf441026 Merge pull request #445 from smorin/main
fix(wui): enable meta+enter submission from all fields in session launcher
2025-08-18 13:37:48 -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
dexhorthy
784dad3062 wip 2025-08-18 11:04:28 -07:00
dexhorthy
7fb4720ad4 worktree command 2025-08-17 09:56:45 -07:00
dexhorthy
878de6cb59 Merge branch 'main' of github.com:humanlayer/humanlayer 2025-08-15 11:19:09 -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
20250818-nightly 20250816-nightly 20250817-nightly
2025-08-15 10:43:23 -05:00
Dex
f3ad0daef5 Merge pull request #441 from humanlayer/ENG-1874
sHTTP Conversion FTW
2025-08-15 10:42:43 -05:00
Sundeep Malladi
b035ffc34f Merge remote-tracking branch 'upstream' into ENG-1874 2025-08-15 07:59:17 -05:00
Sundeep Malladi
395b9c88a4 fix(mcp): Update X-Session-ID header to child session ID when continuing sessions
When continuing a session with HTTP MCP servers, the X-Session-ID header
must be updated to reflect the new child session ID rather than inheriting
the parent's session ID. This ensures proper session tracking across
continued sessions.
2025-08-14 17:12:25 -05:00
Sundeep Malladi
009eaf417f refactor: rename CorrelateApprovalByToolID to LinkConversationEventToApprovalUsingToolID
Rename the method for better clarity and move correlation logic to execute
immediately after approval creation for all approval types, not just auto-approved
2025-08-14 15:31: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
20250815-nightly
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
Dex
4023901e86 Merge pull request #431 from samdickson22/sam/eng-1886-creating-a-session-add-support-for-title-optional
sam/eng-1886 - feat: add optional title field for sessions
2025-08-14 14:22:10 -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
dexhorthy
676d08bd42 test: Update MCP tool_use_id integration test to use REST API
- Replace Unix socket RPC calls with REST API calls to /api/v1/sessions
- Remove unused imports (net, bufio, rpc, claudecode)
- Use standard HTTP client for session creation requests
- Maintain same test behavior and assertions
2025-08-14 12:04:45 -07:00
dexhorthy
968fdf3620 test: Add integration test for MCP tool_use_id correlation
Add comprehensive integration test that verifies tool_use_id is properly
set in the approvals table when Claude Code triggers approvals through
the MCP HTTP endpoint. The test:
- Launches Claude sessions via daemon RPC with HTTP MCP configuration
- Verifies approvals are created with tool_use_id populated
- Tests both single and parallel approval scenarios
- Confirms tool_use_id enables direct correlation without race conditions
2025-08-14 11:28:59 -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
dexhorthy
2c28211138 refactor(hlyr): Migrate from stdio to HTTP MCP transport
- Extend claudecode-go types to support HTTP MCP servers with headers
- Update launch command to use HTTP MCP endpoint at /api/v1/mcp
- Remove stdio MCP server implementation from hlyr
- Clean up index.ts to remove MCP server initialization
2025-08-13 23:03:07 -07:00
dexhorthy
3642ae7be2 feat(mcp): Implement HTTP MCP server with session ID injection for Phase 6
- Add event-driven approval resolution to MCP server
- Implement automatic X-Session-ID header injection for HTTP MCP servers
- Update store to handle HTTP MCP configuration alongside stdio
- Remove MCP stub handler as full implementation is complete
- Add golang/mock dependency for test mocks
- Update integration tests to account for MCP event listener
2025-08-13 23:02:52 -07:00
Dex
3f0be0fbf9 Merge pull request #435 from samdickson22/sam/eng-1940-daemon-fails-to-parse-permission_denials-array-from-claude
sam/eng-1940 - fix: handle permission_denials as objects instead of strings in claudecode-go
20250814-nightly
2025-08-13 23:23:26 -05: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
Dex
a9b65a2ab2 Merge pull request #437 from samdickson22/sam/eng-1934-bypass-permissions-modal-should-submit-on-metaenter-key
feat: add meta+Enter keyboard shortcut to bypass permissions modal
2025-08-13 23:14:49 -05:00
dexhorthy
7f850ef6ca fix: apply pre-commit hooks formatting to generated SDK files 2025-08-13 21:00:25 -07:00
dexhorthy
0484cb06c2 chore: regenerate SDKs with effectiveContextTokens and contextLimit fields 2025-08-13 20:59:59 -07: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
37c651aa66 fix: rename 'strings' variable to avoid shadowing package name
Address code review feedback - renamed local variable from 'strings' to
'legacyStrings' to avoid shadowing the imported strings package.
2025-08-13 20:13:29 -07:00
dexhorthy
209ff1055c chore: Apply linter fixes to MCP integration tests 2025-08-13 20:01:07 -07:00
dexhorthy
d4d7c39fef test(mcp): Add integration tests for MCP session correlation and header transmission
- Test Claude's transmission of custom headers including X-Session-ID
- Verify approval creation with tool_use_id in Phase 4 implementation
- Test auto-approval behavior with dangerously_skip_permissions flag
- Confirm session correlation works correctly via HTTP headers
2025-08-13 19:54:00 -07:00
dexhorthy
c0b0335da2 feat(mcp): Connect MCP server to approval manager with tool_use_id (Phase 4)
- Add CreateApprovalWithToolUseID method to approval manager
- Extract session ID from X-Session-ID header in MCP requests
- Handle auto-approval for dangerously_skip_permissions flag
- Fix approval creation to include comment field in SQLite store
- Wire up MCP server with approval manager in daemon HTTP server
2025-08-13 19:51:55 -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
7b276d050e fix: handle permission_denials as objects instead of strings in claudecode-go
The Claude API returns permission_denials as an array of objects with
tool_name, tool_use_id, and tool_input fields, but the SDK expected
a simple string array. This type mismatch caused JSON unmarshaling
failures that incorrectly marked successful sessions as FAILED.

- Add PermissionDenial struct and PermissionDenials wrapper type
- Implement custom UnmarshalJSON to handle both object and string formats
- Update StreamEvent and Result structs to use the new type
- Add missing PermissionDenials field copy in Result builder
- Add comprehensive tests for all permission denial formats

Fixes sessions being incorrectly marked as FAILED when they contain
permission denials but complete successfully (e.g., session C5E8CF80
which created PR #430 successfully but showed as failed).
2025-08-13 19:28:57 -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
Sam Dickson
465c6b40a6 Merge pull request #434 from samdickson22/sam/eng-1942-notification-say-dangerous-skip-permissions-expired-not
sam/eng-1942 - fix: update bypass permissions expiry notification text to use 'bypass permissions' terminology
2025-08-13 18:51:14 -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