Skip to content

Commands ignore VOLTAGE_* variables under a profile without a warning #121

Closed

Description

@thebrandonlucas

Problem

With --profile, the CLI ignores VOLTAGE_API_KEY, VOLTAGE_ORGANIZATION_ID, VOLTAGE_ENVIRONMENT_ID, and VOLTAGE_WALLET_ID (see docs/guides/login-and-profiles.md). Only voltage context says so, in ignored_variables. Every other command drops those variables silently.

That's a problem because other Voltage tools treat the same names the opposite way. The voltage-api agent skill's helper (scripts/request.py in voltagecloud/agent-skills) has no profiles: it reads ~/.voltage/.env, and these process variables override that file. In one shell, an agent can export VOLTAGE_WALLET_ID for the helper and then run a CLI command:

$ export VOLTAGE_ENVIRONMENT_ID=ENV_A VOLTAGE_WALLET_ID=WALLET_A
$ voltage wallets get --profile staging
# acts on the staging profile's environment; ENV_A and WALLET_A are ignored without notice

The helper reaches WALLET_A and the CLI reaches the profile's environment, so the two commands can act on different wallets. A user reported this publicly: "When switching environments, check which wallet each method actually reaches."

Reproduced on v0.2.0 (9b062ee).

Suggested fix

When the selected profile or a flag overrides a VOLTAGE_* variable that is set, print one line on stderr for each such variable, on every command, before any request is sent. For example:

warning: VOLTAGE_WALLET_ID is set but ignored because --profile staging is selected

Reuse config::ignored_variables, so the warning and voltage context can't disagree. Keep stdout and --json output unchanged. Consider making --json errors carry the same list in error.detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions