refactor(probe): remove client probe methods, dispatch through real-traffic paths - #1138
Merged
Conversation
0x0079
force-pushed
the
feat/endpoint-mode-auto
branch
from
June 5, 2026 06:55
ac6e0f2 to
a6e89ca
Compare
0x0079
force-pushed
the
refactor/probe-client-cleanup
branch
2 times, most recently
from
June 5, 2026 08:31
f682735 to
037ff05
Compare
Add probe/sdkprobe.go with minimal-request builders that call the client's production methods (ChatCompletionsNew, ResponsesNew, MessagesNew, GenerateContent) instead of dedicated client Probe* APIs. Routing probes through the real path means provider quirks (Kimi model normalization, Codex Responses handling) apply identically and cannot drift. Rewire E2E and lightweight services onto these builders; the auto-fallback now lives entirely in the probe module. Client Probe* methods are now unused and removed in a follow-up commit. https://claude.ai/code/session_01N9JnUTVt41NcGxYyj3xewf
Delete the now-unused Probe/ProbeStream/ProbeChatEndpoint/ ProbeResponsesEndpoint/ProbeModelsEndpoint/ProbeOptionsEndpoint methods and the bespoke Codex ChatGPT-backend probe from every client, along with the Prober/EndpointProber interfaces and the probe entries on OpenAIClientInterface/AnthropicClientInterface. Probing now lives in the probe module and dispatches through the clients' real-traffic methods. Trim obsolete client probe tests to the surviving timeout/ListModels coverage. https://claude.ai/code/session_01N9JnUTVt41NcGxYyj3xewf
Move ProbeResult/ProbeToolCall, the probe-tool builders, and the result helper from internal/client into internal/probe, and fold the probe test-mode enum into the existing E2EMode. The client package no longer carries any probe vocabulary; E2EData now aliases the local ProbeResult. Drop the dead ProbeUsage type. https://claude.ai/code/session_01N9JnUTVt41NcGxYyj3xewf
0x0079
force-pushed
the
refactor/probe-client-cleanup
branch
from
June 5, 2026 08:44
037ff05 to
21bfe94
Compare
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
Pure structural refactor of the probe subsystem — no behavioral changes.
Probe,ProbeStream,ProbeChatEndpoint,ProbeResponsesEndpoint,ProbeModelsEndpoint,ProbeOptionsEndpointand friends fromOpenAIClient,AnthropicClient,ClaudeClient,KimiClient,CodexClient,GoogleClient(~1370 lines removed)internal/probe/sdkprobe.goconstructs minimal requests and calls the sameChatCompletionsNew,ResponsesNew,MessagesNew,GenerateContentmethods used by production traffic — provider-specific quirks (Kimi model-name normalization, Codex Responses-only + forced streaming, Claude Code thinking-disable/beta headers viaGuard) apply automatically with zero driftProbeResult/ProbeToolCalland tool definitions moved frominternal/clientintointernal/probe(result.go,probetools.go)Motivation
The duplicated probe methods in every client type caused dual-stack drift: provider quirks had to be maintained in both probe and production paths. Routing probes through the same methods as real traffic eliminates this class of bug entirely.
Key files
internal/probe/sdkprobe.goprobeOpenAIChat,probeAnthropicMessages, etc.)internal/probe/result.goProbeResult/ProbeToolCallinternal/probe/probetools.gointernal/probe/e2e.goProbeProviderWithSDKrewritten to dispatch via SDK methodsinternal/probe/lightweight.gointernal/client/*.gointernal/client/probe.go,probe_tools.goVerification
go build ./...passesgo test ./internal/probe/...passeslogging_roundtripper_test.go(present onmain)KimiClient.ChatCompletionsNew→normalizeChatRequest→stripKimiPrefix, so the raw model name is normalized before hitting the wireClaudeClientoverrides bothMessagesNewandMessagesNewStreaming; both route throughGuard(thinking-disable + session injection + provider client options), so simple-mode probes are covered tooCodexClient.ResponsesNewassembles a non-streaming result fromResponsesNewStreamingwith Codex defaults, preserving the old forced-streaming behaviorProbeModelsEndpointwas never used bylightweight.go(it usesListModels+IsModelsEndpointNotSupported), so its removal is inert