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
This commit is contained in:
dexhorthy
2025-08-13 23:03:41 -07:00
parent 2c28211138
commit aabd422a14
3 changed files with 18 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ type MCPServer struct {
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
// For HTTP servers
Type string `json:"type,omitempty"` // "http" for HTTP servers
URL string `json:"url,omitempty"` // The HTTP endpoint URL

View File

@@ -6,7 +6,7 @@ The daemon logs are in ~/.humanlayer/logs/daemon-*.log (timestamped files create
WUI logs (which include daemon stderr output) are in:
- Development: `~/.humanlayer/logs/wui-{branch}/codelayer.log`
- Production: Platform-specific log directories
- Production: Platform-specific log directories, e.g. ~/Library/Logs/dev.humanlayer.wui.nightly/CodeLayer-Nightly.log
It uses a database at ~/.humanlayer/*.db - you can access it with sqlite3 to inspect progress and debug things.
@@ -47,3 +47,9 @@ echo '{"jsonrpc":"2.0","method":"getSessionLeaves","params":{},"id":1}' | nc -U
For testing guidelines and database isolation requirements, see TESTING.md
### Go style guidelines
- any async or long-running goroutine should accept a context.Context as a parameter and handle cancellation gracefully
- context and CancelFuncs should never be stored on structs, always passed as the first parameter to a function

View File

@@ -95,6 +95,16 @@ export function useApprovalsWithSubscription(sessionId?: string): UseApprovalsRe
onEvent: event => {
if (!isSubscribed) return
// Phase 7: Debug logging to verify tool_use_id flows through
if (event.type === 'new_approval' || event.type === 'approval_resolved') {
console.debug('Approval event with tool_use_id:', {
type: event.type,
approval_id: event.data?.approval_id,
tool_use_id: event.data?.tool_use_id,
data: event.data,
})
}
// Handle different event types
switch (event.type) {
case 'new_approval':