gptscript-ai / gptscript

Build AI assistants that interact with your systems
https://gptscript.ai
Apache License 2.0
3.07k stars 270 forks source link

fix: allocate new storage for env vars on each tool call #841

Closed g-linville closed 2 months ago

g-linville commented 2 months ago

Environment variables in separate slices used to point to the same underlying array. This manifested itself in parallel tool calls all having the same GPTSCRIPT_INPUT value. This PR fixes that.

This is needed for https://github.com/gptscript-ai/gptscript/issues/842