Repository navigation
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
fd58713 to
a8acd5d
Compare
95288cf to
0305d46
Compare
0305d46 to
7aaa944
Compare
7aaa944 to
7f8501a
Compare
7f8501a to
8abf896
Compare
d2579a8 to
b50198a
Compare
b50198a to
8109092
Compare
marta-sd
left a comment
There was a problem hiding this comment.
Overall LGTM. I think we need tests - our CI checks all server dirs and can't detect any here. I also added two small suggestions re documenting the code
|
Question about seed-time cancellation and remote session ownership: There appears to be an uncertainty window before either cleanup callback is registered. For example:
The same sequence seems possible for What is intended to guarantee cleanup in this case? For example, do participant servers reap sessions after a TTL, or should seeding/closing be idempotent and keyed by the client-known |
|
|
||
| resources_server: ResourcesServerRef | ||
| agent_server: AgentServerRef | ||
| resources_tool_transports: list[Literal["direct_http", "mcp"]] = Field(default_factory=list) |
There was a problem hiding this comment.
Should a resources-tool transport be enabled by default here (for example, direct_http)? With the current [] default and no override in configs/single_agent.yaml, the standard configuration sends tool_accesses=[] when seeding the Agent even if the Resources Server returns MCP metadata. If explicit opt-in is intentional, could we document that requirement and show an example? The README currently says this server grants task-scoped tool access.
|
@ffrujeri Addressed the seed-response-loss window. The Environment Server now assigns Resources and Agent session IDs before either POST and registers both cleanup callbacks first. Seed requests are idempotent under those IDs: close is idempotent and an unknown close leaves a tombstone that prevents a racing late seed. SWE Pro, Hermes, Simple Agent, and the example Resources Server serialize seed/close per ID, and resource-owning sandboxes retain bounded TTL cleanup for process/host loss. |
Signed-off-by: Ananth Subramaniam <[email protected]>
|
Closing to recreate the remaining Environment Server work as one correctly ordered GitHub Stack. Branch commits are preserved; a replacement PR will follow. |
What does this PR do?
Implements the standard resources-backed single-agent-turn Environment Server protocol by composing Agent and Resources session APIs. The Environment Server assigns participant session IDs and registers cleanup before seeding, so a lost seed response cannot hide the identity needed for cleanup. Responses verification binds the generic Resources request to a concrete payload.
Single-agent interaction flow
This diagram shows the built-in single-agent use case. Other Environment Server protocols may coordinate different participants and use different request, result, and lifecycle flows.
sequenceDiagram participant C as Rollout collector participant E as Environment Server participant R as Task / Resources Server participant A as Agent Server participant M as Model Server participant S as Task sandbox C->>E: POST /run E->>R: Seed task session R-->>E: Tool access and optional SandboxAccess E->>A: Seed agent session A->>S: Connect as borrower when supplied E->>A: Invoke /v1/responses A->>M: Model and capture requests A-->>E: Agent response E->>A: Close agent session E->>R: Verify response E->>R: Close task session E-->>C: Episode resultThe Environment Server coordinates ordering and the final result. Agent and Task/Resources Servers retain ownership of the state and resources they create.
This is part 8 of 13 in the Environment Server stack. Previous: #3544. Next: #3488.
Validation
uv run pytest environment_servers/single_agent_turn/tests/test_app.py -quv run pytest tests/unit_tests/test_ci_environment.py::test_shared_change_classifier_matches_gym_docs_and_server_paths -qRollouts
See the final PR for end-to-end rollout evidence.
Compatibility and benchmark impact
No rollout is redirected by default.
Production wire serialization
Session requests are serialized with
model_dump(mode="json")before dispatch. This preserves thekindandtransportdiscriminators and converts Pydantic URL values to JSON strings. The fake client now encodes withorjsonand validates the Agent seed usingAgentSeedSessionRequest.model_validate_json.A Resources close failure after successful verification is logged and retried by final cleanup without replacing the verified result.