Repository navigation
feat(agent): let a custom provider skip TLS certificate verification - #1610
Merged
Merged
Conversation
A self-hosted OpenAI-compatible endpoint often serves HTTPS with a self-signed certificate, or one no public CA issued. The connection is still worth encrypting, so verification needs to be optional per provider rather than all-or-nothing for the whole app. The flag travels with the provider, not with the app: a custom provider's endpoint belongs to whoever configured it, so `skipTlsVerify` lives in `models.json` beside `baseUrl`, crosses the remote wire contract in `ProviderUpsert` and `ThinkingLevelProbe`, and reaches the desktop dialog, the remote-desktop provider panel and the mobile provider page. The TLS decision is applied per request in `post_model_body` by selecting between two clients built together — not by rebuilding a client for every streaming call (that would drop connection pooling) and not by latching a flag on the shared client (that would leak to every other provider). Presence is three-way, which is what keeps an older client from silently re-enabling verification: `Some(true)` writes the key, `Some(false)` removes it, and `None` leaves the stored value alone. The TUI and the CLI wizard send `None` for that reason, and `future models probe --insecure` covers an endpoint that is not saved yet.
huichen
enabled auto-merge (squash)
November 14, 2026 11:22
`b625c0db2` made `skip_tls_verify` a field of host's `UpsertCustomProviderInput` and `ThinkingLevelProbeInput`, and the `command_wrappers_delegate_to_the_agent` test still built both structs without it. The product code compiled, so only the all-targets build the `Rust macOS test / desktop` job runs (`cargo check -p futureos --all-targets`) failed with two E0063s. Both initializations are the test's own request, not the editor form, so they state `None` — the field's "nothing to say" value, which leaves any stored flag alone. The test keeps asserting exactly what it did, and the three-way presence contract stays in place.
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.
What and why
A custom provider's endpoint often runs on a self-hosted gateway that serves HTTPS with a self-signed certificate, or one issued by a private CA the platform trust store does not know. The transport is still worth encrypting, so certificate verification becomes an opt-in per provider instead of an all-or-nothing app-wide decision.
The flag travels with the provider, not with the app:
skipTlsVerifysits inmodels.jsonnext tobaseUrl, crosses the RPC wire contract onProviderUpsert.skip_tls_verifyandThinkingLevelProbe.skip_tls_verify, and reaches the desktop custom-provider dialog, the remote-desktop provider panel, the mobile provider page andfuture models probe --insecure.Verification is applied per request in
post_model_bodyby choosing between two clients built together, so a streaming call neither rebuilds a client (losing connection pooling) nor latches a flag on the shared client (leaking it to every other provider).Presence is three-way on purpose:
Some(true)writes the key,Some(false)removes it,Noneleaves the stored value untouched — an older client that cannot express the flag cannot silently re-enable verification on a self-signed endpoint. The TUI and the CLI wizard sendNonefor that reason.Commits
feat(agent): let a custom provider skip TLS certificate verification— the feature: per-providerskipTlsVerifyinmodels.json, on the RPC wire, and in the desktop, remote-desktop, mobile, CLI and TUI surfaces.fix(desktop): pass skipTlsVerify in the provider wrapper test— the desktop crate's#[cfg(test)]module still built the host input structs without the new field, which brokecargo build --tests -p futureos. Test-only; no product code.Verification
Local, in a detached worktree at the branch tip, rustc pinned to
1.99.1(rust-toolchain.toml),ulimit -n 8192:cargo fmt --all -- --check— cleancargo check -p future-rpc -p future-agent -p future-host -p future-cli -p future-tui --all-targets— clean (52s)cargo clippyon the same five crates,--all-targets -- -D warnings— clean (36s)REGENERATE_PROTO=1 cargo buildinpackages/rpc—src/generated/proto.rsregenerates byte-identical, so the wire code is not stalecargo test -p future-agent --lib -- tls_verify providers— 104 passedcargo test -p future-host --lib agent_providers— 64 passedcargo test -p future-rpc— passedtsc --noEmitclean,eslinton the changed sources clean,vitestonCustomProviderDialog.skipTlsVerify+CustomProviderDialog.validation+RemoteProvidersPanel— 89 passedtsc --noEmitclean,eslinton the changed sources clean,jest ProvidersSettings— 31 passed@future-os/remote-protocol:typecheck,check:generatedandvitest— 63 passedFull
--libsuites forfuture-agent/future-hostwere not re-run locally; CI covers them.User-visible changes
skipTlsVerifyswitch (desktop custom-provider dialog, remote-desktop provider panel, mobile provider page) that turns verification off for that provider's requests only; an unsaved endpoint can be probed withfuture models probe --insecure. The default stays "verify", and other providers are unaffected. Revertb625c0db2.ProviderUpsert.skip_tls_verify(field 11) andThinkingLevelProbe.skip_tls_verify(field 7) are newoptional boolfields; absent means "leave as stored", so existing clients and hosts keep working unchanged.Notes
No migration, no change to stored settings for providers that do not enable the flag, and no change to how built-in providers authenticate.