Repository navigation
feat(v1.1): Anthropic SSE streaming replay, zero-network guard, Go SDK, and TracePort v1.1 interop - #2
Merged
Conversation
…K, and TracePort v1.1 importer
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.
Closes #1
Summary
Implements
v1.1.0deterministic Anthropic Messages API & OpenAI SSE streaming recording/replay (pkg/cassette/sse.go), zero-network offline socket enforcement, embedded Gotesting.TSDK (pkg/agenttest), bidirectional MCPContent-Length+ NDJSON framing, sub-millisecond 100KB fuzzy matching, and TracePortv1.1split.meta.json+.frames.jsonlsession ingestion.Key Engineering Changes
pkg/cassette/sse.gosupportingmessage_start,content_block_start,content_block_delta(text_delta,thinking_delta,signature_delta,input_json_delta,citations_delta),content_block_stop,message_delta,message_stop,ping,error, and OpenAIdata: [DONE]streams. Supportsinstant(0msCI default),scaled, andexactrecordeddelta_msreplay modes, plusReconstructStreamSummaryfor semantic diffs and exact token accounting.HTTP CONNECTwith403, exposesproxy.NewOfflineHTTPClientblocking non-loopback TCP dials, fixesagentfixture record -- <cmd>server binding, strips outboundAccept-Encodingso upstream gzip responses decode cleanly prior to redaction, releases server mutex prior to I/O & chunk delays, and prefers unconsumed sequence interactions for multi-turn repeated tool calls.UseNumber()fidelity, normalizes full URLs and query strings, computesStrictHashafter secret scrubbing (eliminating secret hash oracles and allowing dummy CI keys to match), expands secret redaction &CheckForUnredactedSecretsacross SSE deltas/headers/URLs/tags while masking matched previews, and optimizes 100KB prompt fuzzy matching from~15sdown to~0.7ms(336 MB/s).pkg/agenttest(NewTestServer(t, path)), 16MB MCPStdioRecorder&StdioReplayerwithContent-Length+ NDJSON framing and automaticinitialize/ping/tools/listsynthesis,inspect&redactCLI subcommands,-exit-codesemantic SSE diffing, and native ingestion of TracePortv1.1.meta.json+.frames.jsonlsessions.Benchmark Highlights (
CGO_ENABLED=0 go test -bench=. -benchmem ./...)BenchmarkReplaySSEStream_Instant1.62 us/op1,587.6 MB/s(22 allocs/op)BenchmarkDecodeSSE_AnthropicStream45.58 us/op225.1 MB/sBenchmarkStrictMatcher_JSON9.22 us/op79 allocs/opBenchmarkFuzzyMatcher_100KBDisjointPrompt0.63 - 0.78 ms/op336.9 MB/s(3 allocs/op)Verification
CGO_ENABLED=0 go vet ./...&go test -v -count=1 ./...(71/71 test cases passing across all 8 packages, including 10x consecutive SSE replay determinism)