Commit Graph

25 Commits

Author SHA1 Message Date
Adam Weidman bb379102d6 fix: SSE keepalive, request timeout, NoOp task store caching, and Docker tooling
- Add SSE keepalive middleware (15s comment heartbeat) to prevent Cloud Run
  LB from closing idle SSE connections during long tool executions
- Increase A2A server request timeout from 300s to 3600s (1 hour)
- Cache loaded tasks in NoOpTaskStore to prevent redundant GCS workspace
  restores on every SDK event cycle (was restoring 5+ times per request)
- Add undici dispatcher with 10-min timeouts for bridge SSE connections
- Install gh CLI and gcloud CLI in Docker image for agent GitHub/GCP access
2026-02-20 10:02:13 -05:00
Adam Weidman 45c9545f78 fix: Cloud Run service-to-service auth and agent card URL
- Add identity token auth in A2ABridgeClient for Cloud Run (K_SERVICE)
- Support CODER_AGENT_PUBLIC_URL env var for agent card URL on Cloud Run
- Strip @Bot mention prefix before slash command detection (Add-ons)
- Grant bridge SA roles/run.invoker on A2A server via IAM
2026-02-15 00:22:08 -07:00
Adam Weidman 6872805274 feat: split chat bridge into standalone microservice
Separate the Google Chat bridge from the A2A agent server so each can
scale independently on Cloud Run. The bridge is a lightweight proxy
(concurrency=80) while the agent needs concurrency=1.

- Add standalone entry point (src/chat-bridge/server.ts)
- Add Dockerfile.chat-bridge and cloudbuild-chat-bridge.yaml
- Remove chat bridge setup from app.ts
- Inline A2UI constants in a2a-bridge-client.ts (no agent deps)
- Update README for two-service architecture
2026-02-14 20:04:32 -07:00
Adam Weidman 4f3ffc8959 feat: async streaming chat bridge with Chat API push
Replace blocking A2A calls with streaming: webhook returns
immediate "Processing..." response, then streams results from
A2A agent and pushes them to Google Chat via REST API.

- Add ChatApiClient for proactive messaging via Chat REST API
- Add sendMessageStream() to A2ABridgeClient for SSE streaming
- Add extractFromStreamEvent() for parsing individual stream events
- Refactor handler to fire-and-forget async processing
- Fix isTerminal logic to use stream state instead of taskId presence
- Add asyncProcessing guard to prevent overlapping requests
- Add comprehensive README with deployment and setup guide
2026-02-14 19:54:47 -07:00
Adam Weidman 60b01761b8 feat: add GCS-backed session and conversation persistence
Enable session resumability across Cloud Run restarts:

- executor.ts: Save conversation history in task metadata during
  toSDKTask(), restore via setHistory() in reconstruct()
- gcs.ts: Persist conversation history as separate GCS object
  (conversation.tar.gz) alongside metadata and workspace
- session-store.ts: Add optional GCS-backed persistence with periodic
  flush and restore-on-startup for thread→session mappings
- handler.ts: Restore persisted sessions on initialize()
- types.ts: Add gcsBucket to ChatBridgeConfig
- app.ts: Pass GCS_BUCKET_NAME to chat bridge config

Validated end-to-end: message persists, Cloud Run restarts, follow-up
message in same thread correctly recalls prior context. Different
threads maintain isolation.
2026-02-12 17:17:08 -05:00
Adam Weidman df81bfe1f2 feat: Google Chat bridge with YOLO mode, text-based approvals, and Add-ons support
- Add normalizeEvent() to convert Workspace Add-ons event format to legacy ChatEvent
- Add wrapAddOnsResponse() for Add-ons response wrapping
- Mount chat bridge routes BEFORE A2A SDK catch-all handler
- Replace card button approvals with text-based approve/reject/always allow
- Add /reset, /yolo, /safe slash commands for session control
- Add YOLO mode tool approval dedup (filter auto-approved surfaces)
- Add extractCommandSummary() for concise tool card display
- Delegate auth to Cloud Run IAM when K_SERVICE env var detected
- Add JWT debug logging for token claim inspection
2026-02-12 16:12:18 -05:00
Adam Weidman 9d12980baa feat: add JWT verification middleware for Google Chat webhook
Verifies Bearer tokens from Google Chat using google-auth-library.
Checks issuer (chat@system.gserviceaccount.com) and audience
(CHAT_PROJECT_NUMBER). Verification is skipped when project number
is not configured, allowing local testing without tokens.
2026-02-12 10:56:42 -05:00
Adam Weidman 57f3c9ca1a feat: add Google Chat bridge for A2UI integration
Implements a Google Chat HTTP webhook bridge that connects Google Chat
to the A2A server. Each Chat thread maps to an A2A contextId/taskId
pair. The bridge converts A2UI tool approval surfaces to Google Chat
Cards V2 with Approve/Always Allow/Reject buttons, and handles
CARD_CLICKED events to forward tool confirmations back to the A2A server.

Components:
- chat-bridge/types.ts: Google Chat event/response types
- chat-bridge/session-store.ts: Thread -> A2A session mapping
- chat-bridge/a2a-bridge-client.ts: A2A SDK client wrapper
- chat-bridge/response-renderer.ts: A2UI -> Google Chat Cards V2
- chat-bridge/handler.ts: Event handler (MESSAGE, CARD_CLICKED)
- chat-bridge/routes.ts: Express routes mounted at /chat/webhook
2026-02-12 10:11:58 -05:00
Adam Weidman 5ea957c84b feat: add A2UI extension support and GKE deployment infrastructure
Implement A2UI v0.10 protocol compliance for the a2a-server:
- Add a2ui-extension.ts with constants, Part helpers, extension detection
- Add a2ui-components.ts with standard catalog component builders
- Add a2ui-surface-manager.ts for tool approval, response, thought surfaces
- Integrate A2UI into task.ts and executor.ts
- Add configurable bind host (CODER_AGENT_HOST) for k8s compatibility

Add GKE deployment infrastructure:
- Dockerfile, cloudbuild.yaml, k8s deployment manifest, .dockerignore
2026-02-11 19:23:56 -05:00
Christian Gunderman fd65416a2f Disallow unsafe type assertions (#18688) 2026-02-10 00:10:15 +00:00
Coco Sheng 5ba6e243b5 Restricting to localhost (#16548)
Co-authored-by: Adam Weidman <adamfweidman@google.com>
2026-01-15 18:59:34 +00:00
Abhi eec5d5ebf8 feat(core): restore MessageBus optionality for soft migration (Phase 1) (#15774) 2026-01-04 19:59:35 +00:00
Adib234 10ae84869a Migrate console to coreEvents.emitFeedback or debugLogger (#15219) 2025-12-29 20:46:10 +00:00
Coco Sheng 299cc9bebf feat(a2a): Introduce /init command for a2a server (#13419) 2025-12-12 17:09:04 +00:00
Coco Sheng 1f813f6a06 feat(a2a): Introduce restore command for a2a server (#13015)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Shreya Keshive <shreyakeshive@google.com>
2025-12-09 15:08:23 +00:00
cocosheng-g 69339f08a6 Adds listCommands endpoint to a2a server (#12604)
Co-authored-by: Juanda <jdgarrido@google.com>
Co-authored-by: Shreya Keshive <shreyakeshive@google.com>
2025-11-07 15:10:29 +00:00
Jacob MacDonald 1b302deeff Add ExtensionLoader interface, use that on Config object (#12116) 2025-10-28 16:04:30 +00:00
joshualitt 541eeb7a50 feat(core, cli): Implement sequential approval. (#11593) 2025-10-27 16:59:08 +00:00
jdgarrido1105 3f38f95b1d Adds executeCommand endpoint with support for /extensions list (#11515) 2025-10-23 13:05:43 +00:00
Abhi b364f37655 refactor(logging): Centralize console logging with debugLogger (#11590) 2025-10-21 20:35:22 +00:00
Paweł Dec 36de686224 feat: Propagate traceId from code assist to response metadata (Fixes … (#11360)
Co-authored-by: owenofbrien <86964623+owenofbrien@users.noreply.github.com>
2025-10-20 20:00:24 +00:00
Adam Weidman c82c2c2b15 chore: add a2a server bin (#10592) 2025-10-09 23:47:18 +00:00
Gal Zahavi 181898cb5d feat(shell): enable interactive commands with virtual terminal (#6694) 2025-09-11 20:27:27 +00:00
Adam Weidman bd0f085ae8 chore(a2a-server): if a2a task creation fails return error to user (#8106)
Co-authored-by: cornmander <shikhman@google.com>
2025-09-10 16:08:58 +00:00
Sam McCauley 2782af3f57 chore(a2a-server): refactor a2a-server src directory (#7593) 2025-09-03 14:24:48 +00:00