Repository navigation
feat(phase-6a): OpenTelemetry tracing, Redis rate limiting, Pub/Sub dispatch path - #22
Merged
Merged
Conversation
…ispatch path Replaces the two things explicitly flagged as temporary since Phase 1/2: the in-process IP-keyed rate limiter (now a Redis-backed, user-id-keyed distributed limiter) and agent_runner.py's subprocess-only dispatch (now publishes to Pub/Sub when configured, with the orchestrator's coordinator gaining a Cloud Run push-receiver entrypoint alongside its existing CLI one). Adds OpenTelemetry spans around every agent invocation, structured JSON logging, tightened CORS, and Dockerfiles for the agents/mcp_server image. Live-verified: real Redis-backed rate limiting (with a redis-py 8.x RESP3 handshake incompatibility found and fixed along the way), and a live Gemini prompt-injection spot check per the security review checklist. Part 1 of 3 for Phase 6 (Observability, Security Hardening & Production Deployment) — Terraform infrastructure and the CI/CD deploy pipeline follow in separate PRs given the phase's overall size. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
INCR, keyed by authenticated user id).agent.<name>.run), with the fullproject_id/job_id/agent_name/status/duration_msattribute set from the phase doc.agent_runner.py(activated byPUBSUB_TOPIC) alongside the existing local subprocess spawn, plus a Cloud Run push-receiver entrypoint for the orchestrator (agents/orchestrator/pubsub_receiver.py).allow_methods/allow_headersno longer wildcard), new Dockerfile foragents(bundlesmcp_server, spawned over stdio same as local dev).Live verification
docker compose up -d redis— found and fixed a genuine redis-py 8.x RESP3 handshake incompatibility (unknown command 'HELLO'), confirmed the limiter actually blocks at the configured threshold end-to-end against a running server.Test plan
apps/api: ruff, mypy --strict, pytest (86/86 passing)agents: ruff, mypy --strict, pytest (100/100 passing)Part 1 of 3 for Phase 6 — see
feat/phase-6b-terraform-infrastructureandfeat/phase-6c-cicd-deploy-pipeline.🤖 Generated with Claude Code