Skip to content

Conversation

@Scoteezy
Copy link
Contributor

Summary

Major improvements to Gemini integration including ACP (Agent Communication Protocol) support, architectural refactoring of the agent module, and enhanced user experience features.

Changes

🏗️ Agent Module Architecture Refactor

  • Move AgentBackend, AgentRegistry to core/
  • Create transport/ with TransportHandler abstraction
  • Create adapters/ for message transformation (MessageAdapter, MobileMessageFormat)
  • Create factories/ for high-level agent creation
  • Rename AcpSdkBackendAcpBackend
  • New GeminiTransport handler for Gemini-specific logic

🔌 ACP Integration for Gemini

  • Add sendAgentMessage() for unified Agent Communication Protocol format
  • Migrate all Gemini messages from sendCodexMessage to sendAgentMessage(gemini, ...)
  • Add ACP message types: task_started, task_complete, turn_aborted, permission-request
  • Fix stdout filtering that was allowing invalid JSON to pass through

🔄 Model Selection & History

  • Support dynamic model selection from frontend via meta.model
  • Save selected model to ~/.gemini/config.json for persistence
  • Add ConversationHistory class to preserve context when switching models

🔐 Permission Handling

  • Integrate GeminiPermissionHandler with permission modes (default, read-only, safe-yolo, yolo)
  • Add permission ID to tool call ID mapping for proper UI tracking
  • Add tool-result emission after permission approval

🔐 Google Cloud Project Support

  • Add happy gemini project set/get commands for Workspace/enterprise accounts
  • Store project ID per-account (linked to email)
  • Pass GOOGLE_CLOUD_PROJECT env var to Gemini SDK

🛠️ Error Handling & Reliability

  • Add retry logic for empty response errors (up to 3 retries)
  • Improve quota error handling: no retry, show reset time, suggest alternative model
  • Better error messages for model not found, rate limits, quota exceeded
  • Add waitForResponseComplete() to ensure all chunks received before task_complete

📱 UX Improvements

  • Add happy connect status command to show vendor auth status
  • Sync local ~/.gemini/oauth_creds.json on happy connect gemini
  • Show helpful error message for "Authentication required" with guide link
  • Fix status flickering by not resetting thinking on intermediate idle events

🐛 Bug Fixes

  • Handle spaces and underscores in project paths
  • Small ID fix
  • Fix fragmented message sending by accumulating chunks

- Move AgentBackend, AgentRegistry to core/
- Create transport/ with TransportHandler abstraction
- Move Gemini-specific logic to GeminiTransport
- Create adapters/ for message transformation
- Create factories/ for high-level agent creation
- Rename AcpSdkBackend → AcpBackend
- Remove acp/utils.ts (merged into transport handlers)
…proved UX

ACP Integration:
- Add sendAgentMessage() for unified Agent Communication Protocol format
- Migrate all Gemini messages from sendCodexMessage to sendAgentMessage(gemini, ...)
- Add ACP message types: task_started, task_complete, turn_aborted, permission-request

Model Selection:
- Support dynamic model selection from frontend via meta.model
- Save selected model to ~/.gemini/config.json for persistence

Permission Handling:
- Integrate GeminiPermissionHandler with permission modes (default, read-only, safe-yolo, yolo)
- Add permission ID to tool call ID mapping for proper UI tracking

Message Flow Improvements:
- Add waitForResponseComplete() to ensure all chunks received before task_complete
- Accumulate response chunks and send complete message once (fixes fragmentation)
- Fix status flickering by not resetting thinking on intermediate idle events

Error Handling:
- Add retry logic for empty response errors (up to 3 retries)
- Improve quota error handling: no retry, show reset time, suggest alternative model
- Better error messages for model not found, rate limits, quota exceeded

Tool Handling:
- Improve change_title detection from toolCallId pattern
- Add tool-result emission after permission approval
- Track hadToolCallInTurn for proper task_complete timing
- Add ConversationHistory class to track user/assistant messages
- Inject previous conversation context into new session on model change
- Allows seamless model switching without losing context
…ling

- Add `happy gemini project set/get` commands for Workspace accounts
- Store project ID per-account (linked to email)
- Show helpful error message for "Authentication required" with guide link
- Sync local ~/.gemini/oauth_creds.json on `happy connect gemini`
- Add `happy connect status` command to show vendor auth status
- Pass GOOGLE_CLOUD_PROJECT env var to Gemini SDK
@bra1nDump bra1nDump merged commit 5d3f1a6 into slopus:main Jan 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants