Skip to content

Add session_opts for arbitrary session POST body fields#193

Open
archae0pteryx wants to merge 8 commits intomainfrom
feat/session-opts
Open

Add session_opts for arbitrary session POST body fields#193
archae0pteryx wants to merge 8 commits intomainfrom
feat/session-opts

Conversation

@archae0pteryx
Copy link
Copy Markdown
Contributor

Summary

  • Adds session_opts: dict | None parameter to EyePopSdk.sync_worker(), async_worker(), and workerEndpoint()
  • The dict is merged into the compute API POST /v1/sessions body, allowing admin-only fields to be passed without exposing them as typed SDK options
  • Stored on ComputeContext and applied in fetch_new_compute_session

Test plan

  • All 24 worker tests pass
  • Ruff lint clean
  • Verify with a live session that session_opts fields appear in the POST body

Allows passing an untyped dict of extra fields into the compute API
session creation request, for admin-only parameters that shouldn't
be exposed as first-class SDK options.
- Collapse health check polling from ~3 logs/attempt to 1 (GET /health - status: N)
- Consistent "METHOD /path - status: N" format across compute module
- Remove logging of raw access tokens and full token responses
- Remove dead code in health check (unreachable PipelineStatus branch)
- Trim verbose config dump to just session UUID
- Add session_headers: extra headers merged into session POST request
- Switch SDK entry points to **kwargs so session_opts and session_headers
  don't appear in autocomplete or public interface
Track why we need a new session (404, empty response, missing uuid, etc.)
and log it once when the decision is made.
Previously the PipelineStatus check was unreachable dead code — a 200
returned immediately without parsing the body. Now on 200 we parse the
session response and check the actual pipeline state: RUNNING succeeds,
terminal states (FAILED, ERROR, STOPPED) raise immediately, and
pending states continue polling.
Comment thread eyepop/worker/worker_endpoint.py Outdated
…ne status

The /health endpoint can return {"message": "I'm fine"} on 200 without
session fields. Previous commit tried to parse all 200 responses as
ComputeApiSessionResponse, causing ValidationError → 60s timeout loop.
Covers running, pending, terminal states, simple health responses,
non-200 retries, timeout, and missing access token. These tests would
have caught the ValidationError regression from ce567f5.
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