Commit Graph
9 Commits
Author SHA1 Message Date
B Harper bab4f4138a Fix AI response storage and add message source tracking
Key changes:
- Fixed sessionId detection in HumanAgent_Chat tool (use sessionToUse instead of params.sessionId)
- Added source field to ChatMessage interface for tracking web vs vscode origin
- Updated web interface to show message source in headers
- Removed incorrect storage of human responses as assistant messages
- AI responses need proper capture mechanism (not human answers stored as AI responses)

Issue: Still need to eliminate redundant /chat endpoint causing potential duplicates
2025-10-24 13:16:37 +11:00
B Harper b5d0190474 Debug AI response storage issue
Found root cause: HumanAgent_Chat tool only stores AI responses when params.sessionId exists,
but sessionId detection may be failing. Only user messages are being stored in ChatManager,
causing web interface to show incomplete conversation history.

Next: Fix sessionId detection and add message source tracking.
2025-10-24 11:55:42 +11:00
B Harper 0fcc0a7b0e Eliminate duplicate pendingHumanRequests system - use ChatManager only
- Removed pendingHumanRequests Map completely
- Added findPendingRequest() method to ChatManager for cross-session lookups
- Created minimal requestResolvers Map only for Promise resolve/reject functions
- Replaced all 9 calls to old system with ChatManager equivalents:
  * /response endpoint now uses ChatManager.findPendingRequest()
  * Timeout cleanup uses ChatManager.removePendingRequest()
  * Request storage uses ChatManager.addPendingRequest() only
  * respondToHumanRequest() and resolvePendingRequest() updated
- No more duplicate data storage - single source of truth in ChatManager
- All functionality preserved, cleaner architecture
2025-10-24 11:44:38 +11:00
B Harper dc1ee54ecd Fix session ID mapping: VS Code conversation IDs now map to registered sessions
- Added conversationToSession mapping to link VS Code conversation IDs to registered session IDs
- Updated handleToolCall to extract session ID from _meta.vscode.conversationId
- Auto-maps VS Code conversations to first available registered session
- Both VS Code and web interface now use same registered session ID
- Fixes 'No pending AI request found' error in web interface
2025-10-24 11:17:46 +11:00
B Harper 20fba4fb96 Fix dynamic cog menu updates and improve override file UI
- Changed 'Override Prompt' to contextual text:
  - '📁 Create Override File' when file doesn't exist
  - '📁 Recreate Override File' when file exists
- Added dynamic webview updating after override file creation
- Fixed cog menu not showing reload option when override created during session
- Added updateOverrideFileExists message handler to refresh menu state
- Fixed character encoding issues in webview menu options
2025-10-23 15:39:41 +11:00
B Harper 0f1b5fa820 Complete single source of truth implementation
- Remove all hardcoded tool description fallbacks
- Ensure override file creation fetches complete tool definition from server
- Verify IMPORTANT text is preserved in all tool descriptions
- Fix word wrapping for better code readability
- Confirm true single source of truth for all tool definitions
2025-10-23 14:47:54 +11:00
B Harper a3b52ac593 Fix override loading system and server independence
- Implement proper override file reload functionality with session re-registration
- Add tools endpoint with sessionId query parameter support
- Remove hardcoded tool description fallbacks (single source of truth)
- Fix ServerManager duplicate setTimeout in startServer method
- Add /response and /reload HTTP endpoints to server
- Ensure server remains independent across VS Code restarts
- Format long tool description for better readability
2025-10-23 14:37:02 +11:00
B Harper 64d0a322cd Fix: Remove startup status notifications and improve menu routing
- Remove automatic status display on webview load (line 964)
- Fix status command routing - unified status display via dedicated command
- Remove unused showStatus command duplicate
- Add Override Prompt to default menu when status unknown
- Clean up status notification behavior - only show on manual request
2025-10-23 10:11:24 +11:00
B Harper a414a4f70d Fix sessionless HumanAgent chat functionality
- Remove session management complexity from MCP server and UI
- Update chatWebviewProvider for direct messaging without sessions
- Fix MCP tool response format to use content array as per specification
- Restore cog icon for MCP configuration (install global/local)
- Add safety checks for message content handling
- Resolve 'o.content is not iterable' error by using proper MCP format
2025-10-22 11:49:17 +11:00