Skip to content

feat(agents,trace): one Langfuse trace per Agent Protocol run - #1

Merged
devopssquaddev merged 19 commits into
mainfrom
feat/agents-langfuse-trace
Aug 31, 2026
Merged

devopssquaddev merged 19 commits into
mainfrom
feat/agents-langfuse-trace

Conversation

@devopssquaddev

Copy link
Copy Markdown
Owner

Summary

  • Extract Pregel run-root wrap and observation I/O into images/aegra/trace_wrap.py (loaded from sitecustomize.py)
  • Add live join tests (tests/test_agent_trace.py), unit tests, Langfuse helpers, and compliance audit script
  • Fix broker-isolation test for YAML-array init container command form

Test plan

  • tests/test_agent_trace_wrap.py (9 unit tests)
  • Live trace compliance on test server with AEGRA_WORKER_GRAPH_ID=finserve-advisor (5/5 pytest + audit COMPLIANT)
  • Platform Gate A suite (104 passed, 8 skipped) after prior validate-phase1 run

Made with Cursor

devopssquaddev and others added 19 commits August 26, 2026 12:14
…ph rewrite

Add unified MCP gateway with postgres/qdrant security wrappers and gVisor sandbox
warm pool. Rewrite FinServe agent to consume MCP tools via MCP_URL, remove demo
executor chart, update BASE-01/03/06 tests, and document mcp.localhost endpoint.

Verified: internal/dev/validate-phase1.sh — 40/40 tests passed on test server.
Co-authored-by: Cursor <cursoragent@cursor.com>
… store

Bump AI Gateway v1.1.0, datastore pins (Postgres 16.15, Valkey 7.2.14,
ClickHouse 25.12, Qdrant v1.19.0), and Langfuse v4 web+worker with SeaweedFS
S3 and Valkey Redis. Add inline SeaweedFS all-in-one, ClickHouse auth secrets,
profiles/values-local overlay, first-party image build scripts, and platform-
agnostic tests (tenant_a). FinServe remains a separate example chart.

Co-authored-by: Cursor <cursoragent@cursor.com>
FinServe agent LLM calls failed when the in-cluster Envoy Gateway service
used a hashed name in envoy-gateway-system. Discover the service at helm
upgrade time and filter postgres tool rows to tenant-scoped records only.

Co-authored-by: Cursor <cursoragent@cursor.com>
LLM tool calls used hallucinated collection names (policies), causing
Qdrant 404s despite seeded finserve_policies data. Pin collection via
env, override qdrant__ args, and tighten system prompt guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the custom FastAPI regex wrapper with the official nemoguardrails
FastAPI server (0.17.0), mount generic content_safety and topic_control
profiles from Helm files/, wire OTel export to Langfuse, add AI Gateway
nemo/* routing, and update platform Gate A tests to native NeMo APIs.

FinServe demo client migration to /v1/chat/completions is deferred.

Co-authored-by: Cursor <cursoragent@cursor.com>
…profiles

Kubernetes rejects ConfigMap data keys containing slashes. Mount each NeMo
profile file via subPath into the expected directory layout and pre-create
config directories in the guardrails image.

Co-authored-by: Cursor <cursoragent@cursor.com>
subPath file mounts require parent directories to exist before the pod starts.

Co-authored-by: Cursor <cursoragent@cursor.com>
…erver CMD

nemoguardrails 0.17.0 server only accepts --port and --config; --host caused
CrashLoopBackOff on startup.

Co-authored-by: Cursor <cursoragent@cursor.com>
… planes

Default /v1 NeMo intercept and in-cluster AI Gateway DNS; wrap env on Aegra;
postgres discovery tools; Qdrant mcp-server-qdrant wrap; extraBackends;
Path A NetworkPolicies; graph_id worker catalog; Mode B inject; zelkor-agent
ClusterIP helper. FinServe overlay is not in this change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Superuser MCP roles can SELECT pg_shadow; catalog dump is not a product
tool. Gate A now fails closed on pg_catalog and information_schema names.

Co-authored-by: Cursor <cursoragent@cursor.com>
Aegra serves aegra_api in-process; HTTPRoute matches X-Graph-ID or
?graph_id=. Workers isolate Redis with a release prefix pair.

Co-authored-by: Cursor <cursoragent@cursor.com>
Bump EG, Langfuse, ClickHouse, SeaweedFS, gVisor, and LangChain.
NeMo 0.24 uses base_url / MAIN_MODEL_BASE_URL and a native OpenAI
choices body, so Aegra no longer rewrites httpx responses. Gate A
asserts completion shape and refusal language.

Co-authored-by: Cursor <cursoragent@cursor.com>
Three graph ids on two Deployments; stamp MCP tenant_id; accept $1 SQL binds; NeMo passthrough plus overlay regex rails. Validated on the test server.

Co-authored-by: Cursor <cursoragent@cursor.com>
… NeMo OTEL

Replace migrate.py with zelkor-aegra-cli (`aegra db upgrade`) on the Job and
front-door init. Bootstrap NeMo traces with opentelemetry-instrument when otel is on.

Co-authored-by: Cursor <cursoragent@cursor.com>
Northbound assistants/threads/runs stay the published SDK; only URL, Bearer, and optional X-Graph-ID change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Propagate W3C traceparent from Pregel/ChatOpenAI HTTP (httpx2) through Envoy
so FastAPI+rails nest under one run. Exclude /v1/health; captureContent is
off in the chart and on in the local overlay.

Co-authored-by: Cursor <cursoragent@cursor.com>
Desk/quant topology, aegra-cli Alembic, NeMo 0.24, and W3C join of rails into the Aegra Langfuse trace.
Extract Pregel run-root wrap and observation I/O into trace_wrap.py;
add live join tests, Langfuse helpers, and compliance audit script.
Validated on test server with finserve-advisor (graph+NeMo single trace).

Co-authored-by: Cursor <cursoragent@cursor.com>
@devopssquaddev
devopssquaddev merged commit 0c5e007 into main Aug 31, 2026
1 check failed
@devopssquaddev
devopssquaddev deleted the feat/agents-langfuse-trace branch August 31, 2026 16:10
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.

1 participant