Skip to content

FoundryClient not initialized with preview=True, orchestration commands fail #147

@anjor

Description

@anjor

Problem

The TokenAuthProvider.get_client() creates a FoundryClient without preview=True. Many v2 API endpoints (especially orchestration/builds) require preview mode and fail with ApiFeaturePreviewUsageOnly error.

Reproduction

pltr orchestration builds search
# Fails with: ApiFeaturePreviewUsageOnly

Root Cause

In src/pltr/auth/token.py:

return FoundryClient(auth=auth, hostname=self.host)

Should be:

return FoundryClient(auth=auth, hostname=self.host, preview=True)  

The ?preview=true query parameter also needs to be added to direct API calls. The SDK passes this automatically when the client is created with preview=True.

Workaround

Call the API directly with ?preview=true query parameter.

Files

  • src/pltr/auth/token.pyget_client()
  • src/pltr/auth/oauth.py — likely same issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions