Skip to content

fix(config): secrets report 'stored in keyring' when no keyring backend is available #454

Closed as not planned

Description

@dan-petty

Problem

devops config set ai.api_key <value> prints Secret 'ai.api_key' stored in keyring. and exits 0 even when no usable keyring backend exists. The secret is silently lost.

_keyring_set falls back to the process-local _EPHEMERAL_CI_SECRETS dict whenever _ensure_keyring_backend() returns False (for example keyring.backends.fail.Keyring, or a rejected plaintext backend). That dict disappears when the command exits, but set_value still reports success. The next devops config show shows ai.api_key not set.

Reproduction

  1. Run in an environment where keyring.get_keyring() is keyring.backends.fail.Keyring (e.g. a fresh devcontainer home volume).
  2. devops config set ai.api_key sk-example → prints success.
  3. devops config show → ai.api_key not set.

Expected

Outside headless/CI mode (DEVOPS_CLI_HEADLESS_AUTH), storing a secret without a usable encrypted backend should raise SecretStorageError with guidance on configuring a backend, and config set should exit non-zero. The ephemeral fallback should be reserved for explicit headless runs.

Acceptance criteria

  • config set for a secret fails loudly (non-zero exit, actionable message) when no usable backend exists.
  • Headless mode keeps the ephemeral behaviour.
  • Tests cover both paths.

Activity

  1. added this to the v0.2.23 milestone on Sep 23, 2026
  2. added
    type/bug
    scope/config
    priority/p1-high
    on Sep 23, 2026
  3. dan-petty commented on Sep 23, 2026

    @dan-petty
    OwnerAuthor

    Duplicate of #452, which tracks the missing in-container keyring. The false-success symptom is recorded there.

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

    priority/p1-highscope/configtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions