small gleam coding and (not yet) persistent agent daemon with a detachable cli forked from okami.mom/albedo
albedo robot-docs network.md
3.6 kB · 84 lines
Markdown
at main

Outbound proxies #

The network settings section sends outbound connections directly or through a named proxy, for everything or per service. sdk/network declares the section, parses its values, and resolves a service's route. core_settings registers it beside the daemon's other sections, so /config lists it under Tools. This is separate from the inbound OpenAI-compatible proxy.

Configure routes #

The section has three optional fields in extensions.json:

  • proxies names proxy URLs.
  • services picks a route per service id. default is the route for every service without its own, and unset default connects directly.
  • profiles picks a route per provider profile name for that profile's model requests (generation, Fast and Daybreak checks, Codex image generation), overriding its extension's service route. Quota polls, sign-in, catalogs, and discovery share accounts across profiles and keep the service route.

A route is direct or a name from proxies. /config shows services and profiles as one picker per service or saved profile. A proxy URL has a scheme, host, and port:

  • socks5://host:port resolves the destination locally.
  • socks5h://host:port sends the destination hostname to the proxy.
  • http://host:port uses HTTP CONNECT, including for HTTP destinations.

A user, password, path, query, or fragment is refused. Proxy authentication is not supported. Setting a route does not start a proxy; it must already be reachable from the machine that connects.

{
  "network": {
    "proxies": {
      "tunnel": "socks5h://127.0.0.1:1080",
      "tor": "socks5h://127.0.0.1:9050"
    },
    "services": { "default": "tunnel", "models": "direct" },
    "profiles": { "work": "tor" }
  }
}

The service ids are discord, colab, mcp, models (the models.dev catalog), and each provider or search extension's id, such as claude, codex, openai, or exa; an unknown id is refused. Tool jobs, SSH commands, and the browser opened for OAuth are not routed.

Failures #

An invalid saved value fails every routed call rather than connecting directly, and so does a proxy that refuses or cannot be reached. Destination TLS still verifies the certificate and hostname through the tunnel. Command-based quota feeds and AWS credential_process cannot honor a proxy, so they are refused under one.

Ownership #

network_context keeps the route for the calling process. routed(service, run) resolves and runs under a service's route; a spawned worker keeps its caller's route through carried. Do not set process-wide proxy environment variables or the global httpc proxy to route one service.

extension routes model provider requests, streams, catalogs, and search by extension id. Quota and oauth_flows route polls and sign-in exchanges the same way. openai_api/connect negotiates the tunnel before destination TLS, and pool keys distinguish routes. The Discord helper and Colab's SSH bridge get the route as ALBEDO_OUTBOUND_PROXY, read by albedo_plugins.proxy.