Skip to content

feat: add agent session lifecycle API - #3485

Merged
ananthsub merged 1 commit into
mainfrom
ananthsub/episode-orchestration-04-agent-session-api
Sep 22, 2026
Merged

ananthsub merged 1 commit into
mainfrom
ananthsub/episode-orchestration-04-agent-session-api

Conversation

@ananthsub

@ananthsub ananthsub commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Defines agent seed/close contracts beside their Agent Server routes. Session seed carries episode/task identity plus optional tool and sandbox access; close repeats episode identity.

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 result
Loading

The 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 6 of 13 in the Environment Server stack. Previous: #3545. Next: #3544.

Validation

  • uv run pytest tests/unit_tests/test_agent_sessions.py -q

Rollouts

See the final PR for end-to-end rollout evidence.

Compatibility and benchmark impact

Existing Agent Server /run and /v1/responses behavior remains available.

@copy-pr-bot

copy-pr-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

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.

@ananthsub
ananthsub added this pull request to stack #3493 September 17, 2026 16:31
@ananthsub ananthsub changed the title ananthsub/episode orchestration 04 agent session api feat: add agent session lifecycle API Sep 17, 2026
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from 1a2de33 to 4c1825d Compare September 17, 2026 20:17
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from 4c1825d to 2023ffa Compare September 17, 2026 20:28
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from 2023ffa to bbc99be Compare September 18, 2026 00:55
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from bbc99be to 6aa497c Compare September 18, 2026 01:06
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from 6aa497c to 46830f3 Compare September 18, 2026 01:32
@ananthsub
ananthsub marked this pull request as ready for review September 18, 2026 19:45
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team September 18, 2026 19:46
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from 46830f3 to 5ec2f55 Compare September 18, 2026 20:44
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team September 18, 2026 20:45
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from 290b878 to 8307c71 Compare September 18, 2026 22:27
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from 8307c71 to 60e526c Compare September 18, 2026 22:37
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from 60e526c to 3085f03 Compare September 18, 2026 22:42
@yaoyu-33 yaoyu-33 added area:agent Agent harnesses and Responses API agent behavior complexity:high Cross-component or shared-contract change with a large review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Sep 18, 2026
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-04-agent-session-api branch from 3085f03 to 93844a1 Compare September 19, 2026 01:02
marta-sd
marta-sd previously approved these changes Sep 21, 2026
Signed-off-by: Ananth Subramaniam <[email protected]>

This branch was previously deployed

1 inactive deployment
public — 584c7233 Deployed Sep 22, 2026 by copy-pr-bot[bot] via release / finalize / notify #3490
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior complexity:high Cross-component or shared-contract change with a large review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants