The stacked credentials feature was not working with credential refresh until this PR. The refreshed credential used to be stored into the highest priority context, even if it previously existed in a different context.
For example, say I had credential cred in context one, and then I do gptscript --credential-context two,one <script>. The script uses the cred credential, so it gets refreshed. GPTScript was storing the new refreshed credential in the context two, even though it previously existed in one.
This PR changes it so that refreshed credentials are always stored in the context from which they came.
The stacked credentials feature was not working with credential refresh until this PR. The refreshed credential used to be stored into the highest priority context, even if it previously existed in a different context.
For example, say I had credential
cred
in contextone
, and then I dogptscript --credential-context two,one <script>
. The script uses thecred
credential, so it gets refreshed. GPTScript was storing the new refreshed credential in the contexttwo
, even though it previously existed inone
.This PR changes it so that refreshed credentials are always stored in the context from which they came.