Skip to content

Improve Workbench integration in posit-sdk - #489

Open
michaelmayer2 wants to merge 2 commits into
posit-dev:mainfrom
michaelmayer2:workbench
Open

Improve Workbench integration in posit-sdk#489
michaelmayer2 wants to merge 2 commits into
posit-dev:mainfrom
michaelmayer2:workbench

Conversation

@michaelmayer2

Copy link
Copy Markdown

This PR adds first steps towards support for the Workbench API.

I am currently using this in a PoC style work for snakemake, cf. https://github.com/michaelmayer2/posit-sdk-snakemake

michaelmayer2 and others added 2 commits September 2, 2026 10:11
….admin)

Adds posit.workbench.admin.Client, authenticated via a portable Bearer API
token, covering the full launcher API (sessions, jobs, compute envs, users,
version) -- distinct from the existing posit.workbench.Client, which only
works via an in-session RPC cookie and exposes OAuth credential exchange.

The endpoint layer (sessions/jobs/compute_envs/users/server + the JSON-RPC
envelope handling in rpc.py) has no auth dependency, so it's shared between
both clients rather than duplicated: posit.workbench.Client gains the same
.sessions/.jobs/.compute_envs/.users/.server properties, purely additively.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
get_status_map() used get_historical_session unconditionally when
include_historical=True. Confirmed live: a regular user's in-session
cookie can launch_job/get_session for itself but gets HTTP 401 from
get_historical_session, which apparently needs broader session-
visibility privileges. A Bearer token for an account with elevated
visibility doesn't hit this. Rather than let that break status polling
for ordinary users (e.g. a Snakemake executor plugin), treat 401/403
the same as include_historical=False and fall back to active-job-only
status; other HTTP errors still propagate.
@tdstein

tdstein commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Hey @michaelmayer2, is this ready for review or is it still a work in progress? There's a lot here, so I want to hold off on diving in until you are ready.

@michaelmayer2

Copy link
Copy Markdown
Author

Hey @michaelmayer2, is this ready for review or is it still a work in progress? There's a lot here, so I want to hold off on diving in until you are ready.

I know there is a lot here - happy to spilt it into larger chunks, but from my perspective this is ready for review.

@tdstein

tdstein commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Hey @michaelmayer2, is this ready for review or is it still a work in progress? There's a lot here, so I want to hold off on diving in until you are ready.

I know there is a lot here - happy to spilt it into larger chunks, but from my perspective this is ready for review.

No need to split it out yet. I'm fine doing the review as is. Is there anyone from the workbench team we can pull in that is more familiar with these APIs?

@michaelmayer2

Copy link
Copy Markdown
Author

Hey @michaelmayer2, is this ready for review or is it still a work in progress? There's a lot here, so I want to hold off on diving in until you are ready.

I know there is a lot here - happy to spilt it into larger chunks, but from my perspective this is ready for review.

No need to split it out yet. I'm fine doing the review as is. Is there anyone from the workbench team we can pull in that is more familiar with these APIs?

I wonder if @jeffvroom would be a fit for this review. He is the main developer of the API.

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