Skip to content

test(agents): prove a per-agent endpoint reaches the wire - #93

Merged
antiv merged 1 commit into
mainfrom
claude/external-agent-integration-test
Sep 2, 2026
Merged

test(agents): prove a per-agent endpoint reaches the wire#93
antiv merged 1 commit into
mainfrom
claude/external-agent-integration-test

Conversation

@antiv

@antiv antiv commented Sep 2, 2026

Copy link
Copy Markdown
Owner

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

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
@antiv
antiv merged commit d64a08a into main Sep 2, 2026
1 check passed
@antiv
antiv deleted the claude/external-agent-integration-test branch September 2, 2026 21:05
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.

2 participants