Skip to content

Go: Agent Framework implementation (Phases 1-2)#5131

Draft
juliomenendez wants to merge 17 commits intomicrosoft:mainfrom
juliomenendez:agent-framework-golang
Draft

Go: Agent Framework implementation (Phases 1-2)#5131
juliomenendez wants to merge 17 commits intomicrosoft:mainfrom
juliomenendez:agent-framework-golang

Conversation

@juliomenendez
Copy link
Copy Markdown

@juliomenendez juliomenendez commented Apr 6, 2026

Summary

  • Phase 1 — Hello Agent: Core types (Message, Content, Role), ChatClient interface, BaseAgent with functional options, OpenAI provider implementation
  • Phase 2 — Middleware + Observability: Three-level middleware pipeline (agent, chat, function), OpenTelemetry tracing & metrics middleware, slog logging middleware

What's included

22 new files, 1,784 lines of Go code under go/:

Package What
agentframework (root) Core types, interfaces, agent, middleware pipeline
agentframework/openai OpenAI ChatClient implementation
agentframework/observability OTel tracing, metrics, slog logging middleware

15 test functions (38 subtests) — all passing. go vet clean.

Stacked PRs — Complete Go Implementation

This is the first in a series of stacked PRs implementing the full Go Agent Framework:

PR Phase What
#5131 1-2 Hello Agent + Middleware & Observability
juliomenendez#1 3 Streaming (scanner pattern)
juliomenendez#2 4 Tools (reflection schema, invocation loop)
juliomenendez#3 5 Multi-Turn (sessions, history, context providers)
juliomenendez#4 6 Compaction (truncation, sliding window, summarization)
juliomenendez#5 7 Workflows (graph DAG, executors, fan-out/in, checkpoints)
juliomenendez#6 8+12 Multi-Agent Patterns + HTTP Hosting
juliomenendez#7 9+10 MCP Integration + Skills
juliomenendez#8 11 Evaluation Framework

10 packages, 12 phases, all tests passing across the full stack.

Design

See docs/superpowers/specs/2026-04-06-golang-implementation-design.md (not committed) for the full design spec.

Test plan

  • go test ./... -count=1 — all tests pass
  • go vet ./... — no issues
  • go mod tidy — module is clean
  • Manual integration test with real OpenAI API key (not in CI)

🤖 Generated with Claude Code

juliomenendez and others added 17 commits April 6, 2026 13:46
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements the Agent interface and BaseAgent backed by ChatClient, with
support for system instructions, default/per-run chat option merging,
UUID-based IDs, and full error propagation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements the ChatClient interface backed by the sashabaranov/go-openai
library, with message mapping between agent-framework types and OpenAI API
types, functional client options (WithBaseURL), and full test coverage using
a mock HTTP server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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