mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-11 05:11:49 +01:00
The agent "Test" action dropped a user-scoped environment variable that a real run keeps. In create mode the form builds the adapter config with the adapter build-config parser. That parser recognized only `plain` and `secret_ref` bindings and dropped every `user_secret_ref` binding. So the resolved config sent to the test route had no binding to resolve, and the probe ran without the variable. Add one shared, binding-type-agnostic parser in `@paperclipai/adapter-utils` (`buildAdapterEnvConfig`, `parseEnvBindings`, `parseEnvVars`). It keeps `plain`, `secret_ref`, and `user_secret_ref` bindings so the server resolver receives each one, the same way a real run does. The parser never resolves a secret and never reads a secret value; it only preserves the binding shape. Replace the eight byte-identical copies of the parser across the adapter build-config files with the shared helper. This removes the duplication and fixes the same drop in every adapter at once. Edit mode already passed the env map through unchanged, so it was not affected. Add unit tests: the shared parser keeps each binding type and the create-mode build-config keeps a `user_secret_ref` binding. Co-authored-by: Paperclip <noreply@paperclip.ing>