Skip to content

feat(sessions): long-lived session pods with manual lifecycle#30

Merged
Danelegend merged 1 commit into
mainfrom
dane/ll-session-create-delete
May 6, 2026
Merged

feat(sessions): long-lived session pods with manual lifecycle#30
Danelegend merged 1 commit into
mainfrom
dane/ll-session-create-delete

Conversation

@Danelegend
Copy link
Copy Markdown
Contributor

Adds two new routes:

  • POST /v1/sessions creates a long-lived executor pod/container,
    optionally pre-staging files from /v1/files.
  • DELETE /v1/sessions/{id} tears the session down.

Both Docker and Kubernetes backends are supported. Sessions are labeled app=code-interpreter,component=session so they can be enumerated for debugging, and named code-session-<uuid> so the delete path can sanity-check that callers aren't accidentally targeting other resources.

Known limitation: this PR has no automatic cleanup. A session that the caller forgets to DELETE will live for the configured idle window (SESSION_MAX_LIFETIME_SECONDS = 24h). The follow-up PR adds per-session TTL enforcement plus a reaper for crash recovery.

Tests cover both backends and the route layer (success, 404 mapping, 501 mapping, file resolution, prefix-based safety check on delete).

Base automatically changed from dane/ll-session-refactor to main May 6, 2026 18:27
Adds two new routes:

* POST /v1/sessions       creates a long-lived executor pod/container,
                          optionally pre-staging files from /v1/files.
* DELETE /v1/sessions/{id} tears the session down.

Both Docker and Kubernetes backends are supported. Sessions are labeled
``app=code-interpreter,component=session`` so they can be enumerated for
debugging, and named ``code-session-<uuid>`` so the delete path can
sanity-check that callers aren't accidentally targeting other resources.

Known limitation: this PR has no automatic cleanup. A session that the
caller forgets to DELETE will live for the configured idle window
(``SESSION_MAX_LIFETIME_SECONDS`` = 24h). The follow-up PR adds per-session
TTL enforcement plus a reaper for crash recovery.

Tests cover both backends and the route layer (success, 404 mapping,
501 mapping, file resolution, prefix-based safety check on delete).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Danelegend Danelegend force-pushed the dane/ll-session-create-delete branch from 9de943a to e7b077a Compare May 6, 2026 20:36
@Danelegend Danelegend merged commit 2c2207f into main May 6, 2026
3 checks passed
@Danelegend Danelegend deleted the dane/ll-session-create-delete branch May 6, 2026 20:37
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