Skip to content

fix(config): config set reports an unknown key as unknown, not as a key that needs a value #2448

Closed

Description

@dan-petty

Problem Description

devops config set <key> with no VALUE checks only whether the key is a credential. A key that the settings do not know gets the message for a known key that is not a credential: "<key> needs a VALUE; only a credential may be typed at a hidden prompt." It exits 2. The message names no unknown key, so a person who types a real credential name that this install does not know reads it as "this key is not a credential".

This happened with firecrawl.api_key on 2026-10-28. The main checkout's editable install still held the code before #2410, which renamed tavily.api_key to firecrawl.api_key, so the key was unknown there. With a VALUE, the same unknown key fails in dotted_set with "Failed to set ...: ", exit 1. devops config get says "Unknown config key: ...".

Cause: _value_or_prompt (src/devops_cli/commands/config.py) tests key not in _SECRET_FIELDS and prints MESSAGES.config.value_required before any check that the key exists. set_value finds an unknown key only later, in dotted_set.

Reproduction Steps

  1. devops config set no.such_key </dev/null
  2. devops config set tavily.api_key </dev/null (a key that feat(roadmap): refine investigates open questions with code and web tools and decides design questions by the best practice #2410 removed)

Expected vs Actual Behavior

Expected: both commands fail with "Unknown config key: 'no.such_key'" (the config get message) and exit 1, before any prompt, and name the closest known keys when one is near (for example firecrawl.api_key for firecrawl.apikey). With a VALUE, an unknown key gets the same message, not the AttributeError text.

Actual: "no.such_key needs a VALUE; only a credential may be typed at a hidden prompt." and exit 2.

Environment Diagnostics

devops-cli 0.8.3 at main 890e228, from the main checkout's .venv (editable install).

Logs, Traces, or Terminal Output

devops config set firecrawl.api_key, run on the code before #2410, printed the same message as this unknown key:

$ devops config set no.such_key </dev/null
no.such_key needs a VALUE; only a credential may be typed at a hidden prompt.

Existing Tool Considered

The standard library's difflib.get_close_matches gives the closest known keys. The known keys come from the Settings model, which config get, config set and the secret registry already read.

Activity

  1. added
    source/agent
    type/bug
    status/new
    value/medium
    effort/low
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The error message misreports an unknown key as a credential-needing-value, which is a defect in validation logic.
    • Priority: P2-Medium. The wrong message confuses users but does not cause data loss or a security breach.
    • Value: Medium. Users who mistype or use a renamed key get a misleading message that hides the real problem.
    • Effort: Low. The fix reorders one check and adds a difflib close-match suggestion in an existing function.
    • Related: refactor(config): each setting declares its variable and description on its settings field, and the option, variable and secret registries are derived from it #2444, which asks for a different change. Both touch config key validation in commands/config.py, but #2444 restructures the settings registry while the candidate fixes the error message order for unknown keys.
  3. added
    priority/p2-medium
    on Oct 28, 2026
  4. added a commit that references this issue on Oct 28, 2026
    8b650a6
  5. removed
    status/new
    on Oct 30, 2026
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

    effort/lowpriority/p2-mediumsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions