feat: switch chat bridge from HTTP webhook to Pub/Sub

Google Chat publishes to Pub/Sub topic, bridge pulls messages.
Eliminates all inbound firewall/networking issues on GCE VM.
This commit is contained in:
Adam Weidman
2026-03-04 09:19:41 -05:00
parent 7bc0515c7c
commit 1b313d6475
3 changed files with 103 additions and 135 deletions
+4 -6
View File
@@ -93,19 +93,17 @@ You are a forever-running autonomous agent accessible via Google Chat.
Process incoming tasks, answer questions, and proactively work on improvements.
GEMINIEOF
# Create systemd service for the chat bridge
# Create systemd service for the chat bridge (Pub/Sub mode)
cat > /etc/systemd/system/chat-bridge.service << EOF
[Unit]
Description=Google Chat Bridge
Description=Google Chat Bridge (Pub/Sub)
After=network.target
[Service]
Type=simple
Environment=GOOGLE_API_KEY=${GEMINI_API_KEY}
Environment=CHAT_PROJECT_NUMBER=${CHAT_PROJECT_NUMBER}
Environment=A2A_PORT=3100
Environment=BRIDGE_PORT=8081
Environment=A2A_URL=http://127.0.0.1:3100
Environment=GOOGLE_CLOUD_PROJECT=adamfweidman-test
Environment=PUBSUB_SUBSCRIPTION=forever-agent-chat-sub
Environment=GIT_TERMINAL_PROMPT=0
WorkingDirectory=${REPO_DIR}
ExecStart=/usr/bin/node ${REPO_DIR}/packages/a2a-server/dist/src/chat-bridge/bridge.js