Repository navigation
feat(control): hand the UI upstream and proxy settings as written - #213
Merged
Merged
Conversation
The upstream and proxy views masked what they showed. The base URL was cut down to its origin, so `https://bedrock-mantle.us-east-1.api.aws/v1` came back without `/v1` and with a note that credentials had been hidden when there were none. The API key and header values were masked, and the OAuth refresh token, the client secret and the proxy credentials were left out. The edit dialog could not fill them in, so every write carried "keep what is saved" states instead of values. `GET /config` hands the UI the same file unmasked, so the masking kept nothing from the UI; it only kept the form from showing what is set. Views: - ProviderView: `base_url` and `key` as written (`key` is the value or the `${NAME}` reference); `base_url_masked` and `SecretView` are gone. - HeaderView: `name` and `value` as written; `masked` is gone. - OAuthView gains `refresh` and `client_secret`. The access token stays out: the gateway renews it and writes it back. - ProxyView: `auth` ({ user, pass }) replaces `has_auth`. Writes carry the whole definition: - ProviderInput: `base_url` is required, `key` is an optional string (no key when absent) and every header has a value. `SecretChange` is gone. - ProxyInput: `auth` is optional (no authentication when absent). `ProxyAuthInput` is gone. - OAuthChange keeps `Keep`: while the dialog is open the gateway may renew the token and write back a new refresh token, which revokes the one in the view. - A proxy password may be a `${NAME}` reference, as the configuration reference shows (`pass: ${PROXY_PASSWORD}`), so the dialog can hand it back as written. `control.pass_has_expansion` is gone. Diagnostics bundles and logs still mask; they do not use these views. `Secret::shown` and `Secret::env_var` had no other caller and are gone. CONTROL_API_VERSION is now 25. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fylorn
force-pushed
the
feat/settings-as-written
branch
from
September 26, 2026 11:53
99efe51 to
a082490
Compare
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.
Summary
The upstream and proxy views masked what they showed, so the edit dialog could not show what is configured:
base_urlwas cut down to its origin.https://bedrock-mantle.us-east-1.api.aws/v1came back ashttps://bedrock-mantle.us-east-1.api.aws, flaggedbase_url_masked, and the dialog said credentials had been hidden when there were none. (The same cut also made the Z.ai sign-in dialog's "replaces the existing upstream" check comparehttps://api.z.aiwithhttps://api.z.ai/api/anthropicand never match.)Because the form could not be filled in, every write carried "keep what is saved" states instead of values.
GET /configalready hands the UI the same file unmasked (only the control key is masked there), so the masking kept nothing from the UI.Views (as written)
ProviderView.base_urlbase_url_maskedProviderView.keySecretView { display, env }string(value or${NAME})HeaderView{ name, value (masked), masked }{ name, value }OAuthViewrefresh,client_secret(the access token stays out: the gateway renews it)ProxyViewhas_authauth: { user, pass }Writes (the whole definition)
ProviderInput.base_urlis required;keyis an optional string (no key when absent); everyHeaderInputhas avalue.SecretChangeis removed.ProxyInput.authis optional (no authentication when absent).ProxyAuthInputis removed.OAuthChangekeepsKeep: while the dialog is open the gateway may renew the token and write back a new refresh token, which revokes the one in the view.${NAME}reference, asdocs/configshows (pass: ${PROXY_PASSWORD}), so the dialog can hand it back as written.control.pass_has_expansionis removed.Diagnostics bundles and logs still mask; they do not use these views.
Secret::shownandSecret::env_varlost their only caller and are removed.CONTROL_API_VERSIONis now 25. ThinkWatch Lite follows in a separate PR once this is released.Test plan
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warnings, and-p tw-api --features tscargo test --workspace—tw-control/tests/resources.rsnow covers: the overview shows base URL (with path), key,${NAME}key and header values as written; saving the upstream as the overview shows it leaves the file untouched apart from the edit (comments kept); a header without a value is refused; a proxy password round-trips, including${PROXY_PASSWORD}; testing an edited upstream uses the form's key, not the saved onemsg-codes.txtregenerated🤖 Generated with Claude Code