Commit d8eefa4
Golang sdk (#339)
* Add Go SDK core events package
Implements comprehensive event handling for the Go SDK including:
- Message, run, state, and thinking events
- Custom event support
- Tool event handling
- Event decoding and ID generation utilities
- Test coverage for core functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* test: Add comprehensive unit tests for Go SDK events package
- Add tests for EventDecoder covering all event types (100% coverage)
- Add tests for ID generation utilities (DefaultIDGenerator, TimestampIDGenerator)
- Add tests for previously untested event methods (ToJSON, ID, auto ID generation)
- Add tests for chunk events (TextMessageChunk, ToolCallChunk)
- Add tests for ToolCallResult events
- Improve overall test coverage from 43.9% to 84.8%
- Verify thread safety with concurrent ID generation tests
- Add edge case testing for invalid inputs
All 166 test cases passing with no race conditions detected.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* feat: Add Go SDK SSE client implementation
- Implement SSE client with retry logic and event handling
- Add comprehensive unit tests with 100% coverage
- Support custom headers and error handling
- Include exponential backoff for reconnection attempts
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* feat: Add Go SDK encoding and error handling packages
- Add comprehensive encoding package with JSON support
- Implement content negotiation for Accept headers
- Add buffer sizing utilities and encoder pool
- Add error types and utilities package
- Include unit tests for negotiation functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* test: Add comprehensive unit tests for Go SDK SSE client
- Added extensive test coverage for SSE client streaming functionality
- Coverage improved from 12.5% to 97.1% for the SSE client package
- Tests cover authentication, error handling, context cancellation,
multiline data, concurrent operations, and timeout scenarios
- Added performance benchmarks for streaming operations
- Overall SDK test coverage now at 82.6%
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* feat: Add Go SDK SSE writer implementation with comprehensive tests
Implement SSE (Server-Sent Events) writer for Go SDK with:
- Thread-safe SSE frame creation and writing
- Support for custom event types and IDs
- Proper escaping of newlines in JSON data
- Error event handling with request IDs
- Content negotiation support
- Automatic flushing for compatible writers
- CustomEvent implementation for flexible event creation
- Comprehensive unit tests with 100% coverage
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* exmaple ag-ui command line client
* add example golang server
* docs: Add comprehensive Go SDK documentation
- Add main Go SDK overview with installation and getting started guide
- Add client package documentation for SSE client implementation
- Add core package documentation for events and types
- Add encoding package documentation for marshaling/unmarshaling
- Add errors package documentation for error handling
- Include code examples and API references for all packages
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* feat: Add Go SDK tests to GitHub Actions workflow
- Add Go test job following Python and TypeScript patterns
- Set up Go 1.24.4 environment
- Cache Go modules for faster builds
- Run all tests in sdks/community/go with verbose output
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: event missing EventTypeToolCallResult
* fix: Fix SSE client read timeout handling
- Replace SetReadDeadline approach with async read + timeout pattern
- Use goroutines for non-blocking reads with proper timeout enforcement
- Ensure timeout errors are properly sent to the errors channel
- Fixes failing TestStream/read_timeout_handling test
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: hackerli <[email protected]>
Co-authored-by: Max Korp <[email protected]>1 parent e5fe4f0 commit d8eefa4
File tree
68 files changed
+16771
-1
lines changed- .github/workflows
- docs/sdk/go
- client
- core
- encoding
- errors
- sdks/community/go
- example
- client
- cmd
- internal
- agent
- event
- message
- ui
- server
- cmd
- internal
- agentic
- data
- config
- mcp
- routes
- pkg
- client/sse
- core/events
- encoding
- encoder
- json
- negotiation
- sse
- errors
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
68 files changed
+16771
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
94 | 125 | | |
95 | 126 | | |
96 | 127 | | |
| |||
158 | 189 | | |
159 | 190 | | |
160 | 191 | | |
161 | | - | |
| 192 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
0 commit comments