Skip to content

fix(pi): read an app credential with one source call - #338

Merged
eersnington merged 1 commit into
mainfrom
fix/pi-credential-single-read
Oct 8, 2026
Merged

eersnington merged 1 commit into
mainfrom
fix/pi-credential-single-read

Conversation

@eersnington

@eersnington eersnington commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Each model call read the app's credential with two calls to the app's source: list(), then read(). 0.5.1 removed the credential cache, so both calls ran on every model call.

 async read(providerId: string): Promise<PiCredential | undefined> {
-	if (!(await this.list()).some((entry) => entry.providerId === providerId))
-		return undefined;
 	return toPiCredential(await this.#source.read(providerId));
 }
  • The PiCredentialSource contract already says read returns undefined for a provider without a credential, so the list() check added nothing.
  • Pi's { signal } stays in the store. The documented source is a credentials Actor handle (client.credentials.getOrCreate([...])), and its actions would receive the signal as an extra argument.

This is part 1 of 9 in a stack:

@railway-app

railway-app Bot commented Oct 8, 2026

Copy link
Copy Markdown

This PR was not deployed automatically as @eersnington does not have access to the Railway project.

In order to get automatic PR deploys, please add @eersnington to your workspace on Railway.

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.

1 participant