Skip to content

feat(providers): [providers] expect for dynamically looked-up credentials - #28

Merged
ilanh merged 1 commit into
mainfrom
feat/providers-expect
Nov 3, 2026
Merged

ilanh merged 1 commit into
mainfrom
feat/providers-expect

Conversation

@ilanh

@ilanh ilanh commented Nov 3, 2026

Copy link
Copy Markdown
Owner

What and why

Credentials read through dynamic lookups (Ruby ENV[key.to_s.upcase], Go viper SetEnvPrefix + GetString, litellm choosing the variable by model name) cannot be found statically, so lint did not flag them and provider detection missed them. They cannot be solved by analysis, so this documents the limit and adds a way to declare them once.

  • New [providers] expect = ["GITHUB_PERSONAL_ACCESS_TOKEN"] in openshell-annotate.toml. Each entry behaves like an @openshell provider ENV directive: it is mapped to a profile (profile dirs or [providers.env]), shows up in the providers JSON/script (or as unmapped, with source openshell-annotate.toml: [providers].expect), and counts as declared for the lint env-read check.
  • Entries must look like environment variable names; anything else is a config error.
  • README: new "dynamic lookups" item in Limits (with the three real examples from github-mcp-server, pocketrb and mini-swe-agent) and the config block.

This fixes the issue the way it proposed: documentation plus the config key, no attempt at static resolution.

Tests: tests/providers_expect.rs (lint flag disappears, providers output, invalid entry). TOOLCHAIN=1.94 scripts/ci-local.sh and stable clippy pass.

Ordering: the README Limits bullet sits next to the one #21 edits, so whichever merges second needs a trivial rebase.

Closes #17

…mic lookups; document the limit

Signed-off-by: Ilan Harel <[email protected]>
@ilanh
ilanh force-pushed the feat/providers-expect branch from f0397b2 to 61aea9b Compare November 3, 2026 08:26
@ilanh
ilanh merged commit 454a0dc into main Nov 3, 2026
2 checks passed
@ilanh
ilanh deleted the feat/providers-expect branch November 3, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic env lookups are not seen by lint and provider detection

1 participant