Skip to content

providers use with a project row's spelling activates the user row that shares its identity #1046

Description

@Vasanthdev2004

Found while re-reviewing #892.

With a user row work in config.json and a project row WORK in the workspace's .zero/config.json, zero providers use WORK prints Active provider set to work and points activeProvider at the user row. The user asked for the project row and got the other endpoint.

This predates #892: main's SetActiveProvider matches with EqualFold first-match, so it does the same. #892 narrows it (identity normalization, ambiguity is an error) but keeps the redirect, and the mutation guard added there covers remove and rename only. The TUI's switch path already handles this case through ProviderRowOwnership and says why config.json was not updated; providers use has no such step.

Repro:

  • user config: activeProvider "work", providers [{name "work", provider_kind openai}]
  • workspace .zero/config.json: providers [{name "WORK", provider_kind openai}]
  • run zero providers use WORK from that workspace

Actual: exit 0, Active provider set to work, config.json activeProvider is work.

Expected: a refusal that names the layer, along the lines of "WORK is a project provider; select it with ZERO_PROVIDER=WORK or in the project's .zero/config.json", and no write.

Persisting the exact spelling WORK instead would be worse: outside that workspace Resolve would fail on an active provider that no longer exists. Refusing with the reason, the way the TUI does, seems right.

Activity

  1. added
    bugSomething isn't working
    issue-approvedReviewed and approved by the core team; community PRs may implement this issue.
    on Sep 12, 2026
  2. Vasanthdev2004 commented on Sep 26, 2026

    @Vasanthdev2004
    CollaboratorAuthor

    #893 fixes this at 808af63d. Against that head, the repro above exits 1 with a message saying the resolved row comes from project config, and nothing is written; providers use work still activates the user row. main, #892 and #895 still activate the user row for WORK.

    @PierrunoYT when the stack is refreshed, a Fixes #1046 line in #893 would close this along with it. The repro is a two-row variant of the cases TestProviderCommandsRejectConcreteCatalogAlias already runs, if you want it pinned exactly.

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

    bugSomething isn't workingissue-approvedReviewed and approved by the core team; community PRs may implement this issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions