Skip to content

Credentials - Local credential script tries to look up cached credentials. #240

Closed
@sangee2004

Description

@sangee2004

gptscript version v0.0.0-dev-f4284f43-dirty

Steps to reproduce the problem:

  1. Execute the following gptscript with a tool that has a credential with name - slack-message-credential-tool defined locally in it.
Tools: github.com/sangee2004/slack-message

Send a message to "sangeetest" channel saying "hello from gptscript".
  1. User is prompted to enter the credentials as part of this script execution.
    At this time , the following credential gets cached
gptscript credential --all-contexts
CONTEXT   TOOL
default   slack-message-credential-tool
  1. Now execute the following script which has a local credential with name - slack-message-credential-tool
credential: slack-message-credential-tool
Tools: github.com/gptscript-ai/slack-message

Send a message to "sangeetest" channel saying "hello from gptscript".

---
name: slack-message-credential-tool

#!/usr/bin/env bash

output=$(gptscript -q --disable-cache sys.prompt '{"message":"Please enter your slack credential.","fields":"credential","sensitive":"true"}')
credential=$(echo $output | jq -r '.credential')
echo "{\"env\":{\"\GPTSCRIPT_SLACK_TOKEN":\"$credential\"}}"

This results in trying to serve the credentials from cached entry ( it fails right now because of #237).

Expected Behavior:
We do not expect credentials from cached entry to be used in this case and user should be prompted to enter credentials.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions