Skip to content

fix(config): warn when setting an unrecognized config key - #668

Merged
dcramer merged 1 commit into
mainfrom
fix/config-set-unknown-key-warning
Jun 29, 2026
Merged

dcramer merged 1 commit into
mainfrom
fix/config-set-unknown-key-warning

Conversation

@dcramer

@dcramer dcramer commented Jun 29, 2026

Copy link
Copy Markdown
Member

What

When jr-rpc config set is called with a key not declared in any installed plugin manifest's configKeys, the command now emits a stderr warning listing the known keys for the same plugin prefix. The set still succeeds (exit 0) to avoid breaking legitimate non-plugin config uses.

Why

jr-rpc config set previously accepted any key string with no validation. This caused a real failure: cloudflare.worker-id was silently stored when the correct key is cloudflare.worker.name. The agent had no feedback until the downstream behavior was broken.

Example warning output:

Warning: "cloudflare.worker-id" is not a recognized config key. Known keys with prefix "cloudflare.": cloudflare.account.id, cloudflare.zone.id, cloudflare.worker.name

The plugin catalog (pluginCatalogRuntime) was already imported in this file for handlePluginsCommand; the fix just consults it during config set.

Verification

  • TypeScript: clean (tsc --noEmit passes)
  • Two new unit tests added: one for the warning path (unrecognized key), one for the happy path (recognized key produces no warning)
  • Unit tests could not be executed in the sandbox due to a pre-existing Postgres global-setup dependency (connect ECONNREFUSED 127.0.0.1:54322) — CI will cover this

Refs: https://sentry.slack.com/archives/C08J1NSPU6S/p1782694741000119

When `jr-rpc config set` is called with a key not declared in any
installed plugin manifest, emit a stderr warning listing the known keys
for the same plugin prefix. The set still succeeds (exit 0) to avoid
breaking any valid non-plugin uses of the config store.

Without this, setting a typo like `cloudflare.worker-id` silently
succeeds when the correct key is `cloudflare.worker.name`, giving no
feedback until the misbehaving downstream behavior is observed.

Co-Authored-By: claude-opus-4-5 <[email protected]>

Co-Authored-By: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jun 29, 2026 1:13am

Request Review

@dcramer
dcramer marked this pull request as ready for review June 29, 2026 01:15
@dcramer
dcramer merged commit 17d6739 into main Jun 29, 2026
16 checks passed
@dcramer
dcramer deleted the fix/config-set-unknown-key-warning branch June 29, 2026 01:27

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 670d7f1d Deployed Jun 29, 2026 by vercel[bot]
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.

1 participant