feat(agent): introduce generalized reverse proxy bidirectional streaming evaluation - #575
Merged
Conversation
Implements generalized reverse proxy bidirectional streaming architecture for autonomous multi-turn agent evaluation in Evalbench. Key Changes: - evalproto/eval_agent.proto: Defined typed AgentStreamMessage envelopes for turn requests/responses, in-flight remote scoring, remote workspace archival, and session summary delivery. - evalproto/eval_service.proto: Added rpc AgentInteract streaming endpoint. - evalbench/eval_service.py: Implemented AgentInteract servicer bridging streaming clients with in-memory AGENT_PROXY_QUEUES. - evalbench/generators/models/agentic_reverse_proxy.py: Added AgenticReverseProxyGenerator implementing AgentCliGenerator. - evalbench/scorers/remote_scorer.py: Added RemoteScorerProxy and transparent `remote: true` delegation in score.py. - evalbench/reporting/remote_artifact_reporter.py: Added RemoteArtifactReporter and transparent `reporting.gcs.remote: true` delegation. - evalbench/test/agentic_reverse_proxy_test.py: Added comprehensive unit tests.
saurabh-net
requested review from
IsmailMehdi,
helloeve and
prernakakkar-google
as code owners
August 18, 2026 22:30
saurabh-net
marked this pull request as draft
August 18, 2026 22:30
…ting - Update eval_agent.proto with generic ScorerSpec and ReporterSpec contracts - Replace RemoteArtifactReporter with generic RemoteReporter - Support delegated and remote flags across all scorers and reporters - Update unit tests covering reverse proxy streaming, scoring, and reporting
Collaborator
Author
🏛️ Architectural Alignment: Extending Evalbench's Bidirectional Proxy PatternTo ensure seamless integration and familiar conventions for Evalbench maintainers, this PR extends the proven in-memory streaming pattern already established in 📊 Side-by-Side Comparison
|
saurabh-net
marked this pull request as ready for review
September 2, 2026 16:50
…CP format in proto
…oss codebase, tests, configs, and docs
Collaborator
|
/gcbrun |
…os and refine run config
…e creation and review scenarios
Collaborator
|
/gcbrun |
prernakakkar-google
previously approved these changes
Sep 3, 2026
Collaborator
|
/gcbrun |
prernakakkar-google
approved these changes
Sep 3, 2026
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
This PR introduces generalized reverse proxy bidirectional streaming evaluation into Evalbench, enabling multi-turn autonomous agents running in remote/sandboxed environments to connect via an outbound gRPC stream (
rpc AgentInteract).🏛️ Architectural Alignment: Extending Evalbench's Bidirectional Proxy Pattern
To ensure seamless integration and familiar conventions, this PR extends the proven in-memory streaming pattern already established in
evalbench/generators/models/grpc_proxy.py(PROXY_QUEUES/rpc Interact) to autonomous multi-turn agents (AGENT_PROXY_QUEUES/rpc AgentInteract).grpc_proxy.pyagentic_reverse_proxy.pyPROXY_QUEUES[session_id])AGENT_PROXY_QUEUES[session_id])finallyblocksfinallyblockssession_idcorrelation_id)AgentStreamMessageoneof protobufQueryGenerator(Single-turn SQL)AgentCliGenerator(Multi-turn conversations)Key Features
Typed Agent Streaming Envelopes (
evalproto/eval_agent.proto&evalproto/eval_service.proto):TurnRequest/TurnResponse: Pure agent-centric turn exchange delivering prompts, environment variables, working directories, timeout, and resume flags; collects natural language responses, multi-turn tool call trajectories (tool_name,parameters_json,output,duration_ms,status), token statistics, completion status, and error diagnostics.ScoringRequest/ScoringResponse: Generic container for in-sandbox delegated domain scorers (ScorerSpec(scorer_name, config_json)ScoreResult(scorer_name, score, success, result_json, error_message)).ReportingRequest/ReportingResponse: Generic container for delegated workspace and telemetry archival (ReporterSpec(reporter_name, config_json)ReporterResult(reporter_name, success, result_json, error_message)).SessionSummaryMessage: Delivers final job score rollups and evaluation summaries to connected clients upon run completion.rpc AgentInteract(stream AgentStreamMessage) returns (stream AgentStreamMessage): Dedicated streaming RPC endpoint.AgenticReverseProxyGenerator(evalbench/generators/models/agentic_reverse_proxy.py):AgentCliGeneratorto execute multi-turn agent conversations over the reverse stream.call_mcp_toolwithServerName/ToolName<server>__<tool>).activate_skillaccumulated_skills).timeout_seconds), token usage accounting, and trajectory building.Transparent Delegated Scoring (
evalbench/scorers/score.py&evalbench/scorers/remote_scorer.py):delegated: trueis automatically routed viaRemoteScorerProxyacross the reverse stream to execute inside the client environment.Transparent Delegated Reporting (
evalbench/reporting/__init__.py&evalbench/reporting/remote_reporter.py):delegated: truedelegates execution to the client viaRemoteReporter.Sample Model Config & Documentation:
datasets/model_configs/agentic_reverse_proxy_model.yaml.docs/agentic-evals.mdsupported agents reference.Testing & Verification
Isolated Unit Tests (
evalbench/test/agentic_reverse_proxy_test.py):test_agentic_reverse_proxy_generator_turn).test_remote_scorer_proxy_dispatch).test_remote_reporter_dispatch).Hermetic End-to-End Integration Tests (
evalbench/test/agentic_reverse_proxy_integration_test.py):127.0.0.1:0).test_multi_turn_reverse_proxy_e2e: Full multi-turn conversation with skill activation (dataform_best_practices), MCP tool calls (dataform__compile), trajectory validation (TrajectoryMatcher), executable verification (executable), delegated in-sandbox scoring (dataform_compile), and delegated artifact reporting (gcs_artifacts).test_concurrent_sessions_e2e: 3 concurrent independent client sessions running simultaneously without cross-talk or race conditions.test_concurrent_multi_scenario_e2e: Concurrent scenario multiplexing across worker threads within a single session.Verification Command: