feat: add CredentialContextPins to run options #3
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/1233-pin-toolconfig-credential-context"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of the fix for basepeak-ai/bpai#1233. Merge order: basepeak-ai/gptscript#14 → this → basepeak-ai/bpai#1235.
Adds
CredentialContextPins map[string][]stringtoOptions, serialized ascredentialContextPins: a pass-through for gptscript's per-credential context pins. Each named credential is resolved, and stored when newly created, in its own contexts instead ofCredentialContexts.The JSON key is the cross-repo seam. A mismatch would drop the pins silently, and a dropped pin puts the credential back in the run's head context, which is the bug being fixed.
TestOptionsEncodeCredentialContextPinspins the encoded key. I verified it fails on a mistyped tag. The gptscript side has the mirror-image decode test.The test runs without a live gptscript (
GPTSCRIPT_URL=http://127.0.0.1:1 go test -run TestOptionsEncodeCredentialContextPins .). The rest of this package's suite needs a model endpoint and was not run; the change is one additiveomitemptyfield.8212eb162d1367aed3ceReview round — updated to the reworked pin shape
gptscript#14 changed after review: a pin can now be lookup-only or exclusive (see the comment there for why; the short version is that a run must never write a user's secret into a context shared with other users).
Options.CredentialContextPinsis nowmap[string]CredentialContextPin{Contexts []string, Exclusive bool}, serialized as{"contexts": [...], "exclusive": true}.TestOptionsEncodeCredentialContextPinschecks both keys. I verified that a mistypedexclusivetag fails it, because losing it would silently turn a per-user pin into a lookup-only one.The rest of this repo's suite needs a live gptscript and a model endpoint, so it was not run.
golangci-lint: 0 issues. CI fails every job in 0 seconds here, onmainas well, so that failure predates this change.