gptscript-ai / gptscript

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

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

Closed g-linville closed 3 weeks ago

g-linville commented 3 weeks 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