Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

environment variables not captured #41

Closed
bboynton97 opened this issue Nov 10, 2024 · 3 comments
Closed

environment variables not captured #41

bboynton97 opened this issue Nov 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@bboynton97
Copy link
Contributor

when adding env vars to .env in the project, the project is not finding them even after calling load_dotenv()

@bboynton97 bboynton97 added the bug Something isn't working label Nov 10, 2024
@bboynton97
Copy link
Contributor Author

still receiving reports from users with this issue. it's unclear if this is an agentstack problem or users not knowledgable with load_dotenv(). i need to investigate further

@tcdent
Copy link
Collaborator

tcdent commented Dec 3, 2024

I did notice that some of the tools have a load_dotenv call at the top of their import, so maybe the repeated call is contributing to this?

Shouldn't be removing variables from the ENV regardless.

This may also be related to the path they're being loaded from? dotenv loads ~/.env first if it finds it by default if I remember correctly. We could hardcode the project root path into our internal call.

@tcdent
Copy link
Collaborator

tcdent commented Dec 9, 2024

Ok, I think what's happening is that if the user has a ~/.env file that is getting loaded first, and the project .env is skipped. We now explicitly load the project's environment variables and pass them to the run task.

This will be released in the next version of agentstack and is available right now in the main branch. Feel free to reopen this issue if you are still experiencing problems.

@tcdent tcdent closed this as completed Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants