Skip to content

Add modelproxytest with the replies a fake model upstream streams to a real CLI - #62

Merged
andrew merged 1 commit into
alpha-omega-security:mainfrom
alexandre-daubois:modelproxy/fake-upstream
Nov 4, 2026
Merged

andrew merged 1 commit into
alpha-omega-security:mainfrom
alexandre-daubois:modelproxy/fake-upstream

Conversation

@alexandre-daubois

@alexandre-daubois alexandre-daubois commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Scrutineer (model_proxy_cli_integration_test.go) and tamis (runner_integration_test.go, twice) each hand-roll the same Anthropic SSE fake, and tamis adds the Responses function call and the ChatGPT startup routes. Claude Code 2.1 and Codex 0.166.0 run the tool call and finish the turn against these replies.

Summary by CodeRabbit

  • New Features
    • Added helpers that return streamed Anthropic text and tool-use responses, OpenAI-compatible function-call responses, and fixture responses for recognized Codex startup requests. Anthropic replies receive distinct message IDs.
  • Documentation
    • Added README guidance describing the helpers and their use with a CLI through the proxy.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The modelproxytest package adds helpers for Anthropic and Responses API streams, plus JSON responses for three Codex startup routes. Tests validate event framing, payloads, message IDs, and route handling. The README documents the helpers.

Changes: Proxy test response helpers

Layer / File(s) Summary
Streaming API responses
modelproxy/modelproxytest/modelproxytest.go, modelproxy/modelproxytest/modelproxytest_test.go, README.md
Anthropic text and tool-use helpers and a Responses API function-call helper emit server-sent events. Tests check event framing, payloads, and distinct Anthropic message IDs. The README documents these helpers.
Codex startup route responses
modelproxy/modelproxytest/modelproxytest.go, modelproxy/modelproxytest/modelproxytest_test.go
CodexStartup writes JSON responses for three recognized routes and returns false without writing a body for other paths. Tests cover three handled routes and one unhandled route.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · up to 266cc

The new test helpers have no identified merge-blocking issue.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a new modelproxytest package that provides the replies a fake model upstream streams to a real CLI. The raw summary confirms this. It adds modelproxytest.go with Anthr…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a new modelproxytest package that provides the replies a fake model upstream streams to a real CLI. The raw summary confirms this. It adds modelproxytest.go with AnthropicText, AnthropicToolUse, ResponsesFunctionCall, and CodexStartup, plus tests and README documentation. The title is specific and matches the changeset and the PR objectives, which describe a shared fake model upstream for CLI integration tests.

Full details: Docstring Coverage

Explanation

Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ec37e968-3cfd-4c6b-adbf-65f06f3f0138
Commits

Reviewing files that changed from the base of the PR and between 9509fb0 and 266cc6e.

Files selected for processing: 2
  • modelproxy/modelproxytest/modelproxytest.go
  • modelproxy/modelproxytest/modelproxytest_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

…a real CLI

Scrutineer (model_proxy_cli_integration_test.go) and tamis (runner_integration_test.go, twice) each hand-roll the same Anthropic SSE fake, and tamis adds the Responses function call and the ChatGPT startup routes. Claude Code 2.1 and Codex 0.166.0 run the tool call and finish the turn against these replies.
@andrew
andrew merged commit 188ab3c into alpha-omega-security:main Nov 4, 2026
9 checks passed
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