Skip to content

0012 - add session API surface, docs, and CLI visibility#24

Draft
ethanbailie wants to merge 6 commits intomainfrom
0012-session-api-surface
Draft

0012 - add session API surface, docs, and CLI visibility#24
ethanbailie wants to merge 6 commits intomainfrom
0012-session-api-surface

Conversation

@ethanbailie
Copy link
Copy Markdown
Collaborator

This PR exposes session functionality to users through HTTP API, CLI config output, and docs, while preserving the core logic introduced in earlier stacked PRs.

What Changed

  • API integration in tako_vm/server/app.py
    • app state now initializes/stops SessionManager in lifespan
    • added request/response models for sessions
    • added endpoints:
      • POST /sessions
      • GET /sessions
      • GET /sessions/{session_id}
      • POST /sessions/{session_id}/send
      • GET /sessions/{session_id}/events
      • POST /sessions/{session_id}/terminate
    • improved status typing reuse (SessionStatus alias from models)
  • CLI updates in tako_vm/cli.py
    • show session settings in show-config
    • show per-job-type session/GPU details
  • Added server export in tako_vm/server/__init__.py
  • Documentation/examples updates:
    • README.md
    • docs/api/rest.md
    • docs/getting-started/configuration.md
    • docs/guide/environments.md
    • tako_vm.yaml.example

Tests Added/Updated

  • tests/test_api.py
    • endpoint-level tests for session APIs
    • integration-style session API tests that use real SessionManager path with only subprocess boundary mocked
    • payload limit (413) verification
  • tests/test_cli.py
    • confirms [Sessions] section and session/GPU job-type display

How To Review

  1. Review endpoint contracts and error mapping in tako_vm/server/app.py.
  2. Verify lifecycle wiring in app startup/shutdown.
  3. Review tests/test_api.py:
    • first endpoint mapping tests
    • then integration-style session lifecycle tests for durability
  4. Review CLI output and docs for consistency with API/config behavior.

Suggested Verification

  • ruff check tako_vm tests
  • pytest tests/test_api.py tests/test_cli.py -v

Out of Scope

  • No new storage schema or manager core logic beyond prior PRs.
  • No changes to GPU runtime policy beyond prior PRs.

@ethanbailie ethanbailie added the enhancement New feature or request label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant