Repository navigation
Report and resolve the key of the configured judgment backend - #58
Merged
Merged
Conversation
/warden status called describeAuth() and /warden enable called
ensureApiKey(ctx) with no backend, so an OpenRouter user saw "TypeSafe
key: missing" beside a count of judgments, and enable opened the TypeSafe
login and could not save consent. Both now pass typesafeBackend to
pi-typesafe's backend-aware authState and ensureApiKey. The judge gate
uses authState({ backend }).usable, which also honours a rejected key.
backend.ts reads hosts and key variables from DECISIONS_BACKENDS instead
of a local copy.
Closes #57
Backend-aware authState and ensureApiKey signatures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #57. Depends on DevMortimer/pi-typesafe#10 (pi-typesafe 0.7.0).
What was wrong
The judge gate was backend-aware but
/warden statuscalleddescribeAuth()and/warden enablecalledensureApiKey(ctx)with no backend. WithtypesafeBackend: "openrouter", status reported "TypeSafe key: missing" on the same line that counted judgments, and enable opened the TypeSafe login prompt, so consent could not be saved.Change
config.typesafeBackendto pi-typesafe'sauthStateandensureApiKey. With no OpenRouter key, enable reports the variable to set instead of prompting.authState({ backend }).usable, which also honours a rejected key.keyAvailableis removed; it was not exported from the package.src/backend.tsreads hosts and key variables from pi-typesafe'sDECISIONS_BACKENDSinstead of a local copy.Remaining before ready
npm install pi-typesafe@^0.7.0so the lockfile resolves the registry build.Verification
npm run checkpasses (typecheck, 668 offline tests, build) against a localnpm packof pi-typesafe 0.7.0 installed with--no-save.