Read hosts.toml once per repo-scoped command (CLS-1264) #324
Loading…
Reference in a new issue
No description provided.
Delete branch "cls-1264-snapshot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CLS-1264, broad half, part 1 of 2 (part 2 is the inbox mute scope).
A repo-scoped command read
hosts.tomlfive times: the default host, routing the clone's host, the client, and the browser base each loaded it again. Anauth switchorinstances usefrom another terminal between two of those reads could validate the clone under account A, send the request as B, and build the browser URL for C.resolve_with(&Hosts, ..)andClient::connect_with(&Hosts, ..)take a configuration the caller already loaded.resolveandconnectare now load-once wrappers over them, so the other ~28Client::connectcallers are unchanged (they read once and have no second reader).Clientkeeps the host configuration it connected with and exposes it asclient.config().resolve_repoloadsHostsonce and uses that value for the explicit-host lookup, discovery, default host, routing, the client and the browser base (taken fromclient.config()).repo clone,repo create --cloneandrepo fork --clonetake the git protocol from the client's configuration.forkpreviously read the default host's protocol even when the repo was on a routed host.No global cache: a process-wide snapshot would hide a token another process just refreshed from the refresh hook.
Tests:
resolve_withreturns the snapshot's account and protocol after the files on disk are switched, while a freshresolvesees the switch; a connected client keeps its account, protocol and browser base after the switch; the clone-URL helper follows the connected host's protocol. The account override, profile consumer, work session and legacy host suites pass unchanged.Limit, as before: a switch before the single read is an ordinary selection. A switch after it is not seen by that command, which finishes with one consistent identity.
Automated Codex review (read-only) of head
eb5283431a.No actionable findings in the diff against the standards and surrounding code. Routing, client construction, browser URLs, and clone protocol selection consistently use the loaded configuration.
Review was read-only; tests were not run.
BLOCKING: 0
Reviewed head
eb5283431aat 2026-11-12T10:25:32Z by codex exec (read-only sandbox).