fix(engine): scope daemon cache per instance via GPTSCRIPT_DAEMON_INSTANCE #1
No reviewers
Labels
No labels
area/engine
clarity/clear
enhancement
security
size/M
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
basepeak-ai/gptscript!1
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/daemon-per-instance-keying"
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?
Daemons were cached solely by tool ID, so every caller of a daemon tool shared one process. Callers that run multiple instances of the same tool with distinct start-time configuration — notably auth providers, whose issuer/client/secret are baked into the oauth2-proxy at launch — all received the first instance's daemon and therefore its configuration.
startDaemonnow derives the cache key from the tool ID plus the value ofDaemonInstanceEnvVar(GPTSCRIPT_DAEMON_INSTANCE) when the tool's environment sets it. Callers opt in by exporting a stable per-instance value; without it the key is unchanged (tool ID only), so shared-daemon behaviour is preserved for everything that does not need isolation (e.g. model providers, which inject credentials per request).Consumed by
basepeak-ai/bpaito fix a second OIDC auth provider redirecting to the first provider's IdP.Unit test:
TestComputeDaemonKey.