test(agents): prove a per-agent endpoint reaches the wire - #93
Merged
Conversation
The unit tests assert that an agent's configuration reaches create_model. They cannot show that the resulting model talks to the configured host with the configured credential, which is the whole claim of the feature. Nothing had yet made a real request. This stands up an OpenAI-compatible server on localhost and points an agent at it, then asserts what actually crossed the wire: the path, the Authorization header, the model name after the provider prefix is stripped, and the usage object that cost tracking depends on. The keyless case earns its place. Its guard existed only as a unit test on the resolver, so nothing had confirmed that OPENAI_API_KEY does not follow an agent out to a third-party host. Now a real request is inspected for it. Streaming turns out to need no work at all. The plan budgeted a commit for translating SSE from an external endpoint; litellm already consumes it, so the test asserts the deltas arrive and the translation hop is not built. The test skips itself if it cannot bind a port or litellm is missing, so a sandbox restriction does not become a red build. 819 tests, OK. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ToCUNy2SqwvfTq4a6xfSk1
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.
The unit tests assert that an agent's configuration reaches create_model. They cannot show that the resulting model talks to the configured host with the configured credential, which is the whole claim of the feature. Nothing had yet made a real request.
This stands up an OpenAI-compatible server on localhost and points an agent at it, then asserts what actually crossed the wire: the path, the Authorization header, the model name after the provider prefix is stripped, and the usage object that cost tracking depends on.
The keyless case earns its place. Its guard existed only as a unit test on the resolver, so nothing had confirmed that OPENAI_API_KEY does not follow an agent out to a third-party host. Now a real request is inspected for it.
Streaming turns out to need no work at all. The plan budgeted a commit for translating SSE from an external endpoint; litellm already consumes it, so the test asserts the deltas arrive and the translation hop is not built.
The test skips itself if it cannot bind a port or litellm is missing, so a sandbox restriction does not become a red build.
819 tests, OK.
Claude-Session: https://claude.ai/code/session_01ToCUNy2SqwvfTq4a6xfSk1