Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
32cb807
Never block setup on how many subscriptions the proxy holds
Silthus Nov 19, 2026
08590ec
Fix the review findings on the empty proxy pool
Silthus Nov 19, 2026
a360a3c
Fix the review round 2 findings on the empty proxy pool
Silthus Nov 19, 2026
b0b6d78
Fix the review round 3 findings on reconnect cleanup
Silthus Nov 19, 2026
1731ae4
Leave route cleanup on an empty pool to hedge apply
Silthus Nov 19, 2026
6abe2ac
Tell the person to run hedge apply after connect to an empty pool
Silthus Nov 19, 2026
b17861b
Fail on a subscription list the proxy cannot give
Silthus Nov 19, 2026
11ffa62
Name an empty management reply as a list Hedge cannot read
Silthus Nov 19, 2026
0a628ec
Merge feat/cloud-only into fix/proxy-accounts-never-block
Silthus Nov 19, 2026
8cdbcf6
Let a waiting check that passes after the steps put its config in
Silthus Nov 19, 2026
5a473af
Show a box's waiting line when the hub hands it over
Silthus Nov 19, 2026
82302f9
Name the missing model in the route To do, and list doctor's waiting …
Silthus Nov 19, 2026
b632f1e
Keep a failed pack's waiting config out, and replace the first config…
Silthus Nov 19, 2026
bac8400
Print the hub's own words for a box's exact waiting line
Silthus Nov 19, 2026
e41fa93
Print the hub's own words when connect fails on a box
Silthus Nov 19, 2026
ada1573
Take back waiting config when its pack's step fails, and keep notices
Silthus Nov 19, 2026
f62c965
Hold waiting config until its pack's steps ran, and keep skipped Fix …
Silthus Nov 19, 2026
23a8e85
Gate Hedge's proxy route on the proxy's safety, and drop held config
Silthus Nov 19, 2026
fe34c38
Gate config the same way after the steps, and own only recorded settings
Silthus Nov 19, 2026
01d4b1b
Keep an unrecorded proxy URL in the CLI test, as Hedge now owns only …
Silthus Nov 19, 2026
4c927f9
Decide config that waits for a check once, after the steps
Silthus Nov 19, 2026
d2ec0ad
Record the routes that hedge cli-proxy connect writes
Silthus Nov 19, 2026
6a3c0ba
Count a dangling link at the panel's page or plugin as still there
Silthus Nov 19, 2026
9fa8721
Own the proxy route by its exact value, and drop connect's record
Silthus Nov 19, 2026
debb77e
Run provider config even when an earlier adapter throws
Silthus Nov 19, 2026
d984961
Tell the person to remove a link at a panel path before install
Silthus Nov 19, 2026
540aaef
Prove a waiting check's To do before the step, and drop installer counts
Silthus Nov 19, 2026
6efc450
Own the proxy route only when every part holds Hedge's value
Silthus Nov 19, 2026
f2cb11a
Describe the route cleanup and the single config decision in the chan…
Silthus Nov 19, 2026
f49f32d
Report both errors when provider config fails after an adapter error,…
Silthus Nov 19, 2026
948e708
Prove a link at the panel's page or plugin fails the route check with…
Silthus Nov 19, 2026
bd521d3
Write the proxy route from apply only, and remove it only by its reco…
Silthus Nov 19, 2026
94084a0
Describe connect running apply and the one-unit proxy route in the ch…
Silthus Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,76 @@

## Unreleased

### Setup never waits for proxy subscriptions

- On a hub with own-account balancing, `hedge apply` and `hedge setup` no
longer fail while the proxy holds fewer of your own Claude or Codex
subscriptions than `hub.proxyAccounts`, none included. The proxy installs
and runs, and `hedge apply` and `hedge doctor` show a `To do:` line with
the login command. `hedge cli-proxy accounts` counts the subscriptions
that work. A subscription whose login expired still does not count, and
`hedge cli-proxy doctor` still warns about it.
- Each machine keeps Claude Code and Codex on their own sign-ins until the
proxy serves them. While the proxy answers but holds none of an agent's
subscriptions, its route check is a `To do:` line, not a failure.
`hedge cli-proxy connect` saves the key on a node in that case, so the
first `hedge apply` after the proxy serves an agent sends it there.
When the hub hands a box over while the proxy serves none of its agents,
the hub says that the box keeps its own sign-in until the proxy serves
it. On the both plan, `hedge doctor` fails while a
Codex subscription works but the proxy serves no Codex model. A proxy
that is down, refuses the key, answers without a model list, or runs a
plugin Hedge did not install still fails `hedge doctor`.
- A pack check can name a `todo`: when its command exits 4, Hedge prints
it as a `To do:` line, keeps the config that waits for the check out, and
fails neither apply nor doctor.
- Apply now writes the provider settings, Claude plugins and MCP servers
once, after the steps. Just before, it runs each check with a `todo`
and each check that config waits for, and decides that config from
those results. So a hub whose proxy was stopped routes Claude Code in
one apply, and a route never stays at the end of an apply whose check
found the proxy unsafe. A route that an earlier apply wrote stays while
the steps run. When an adapter that runs before the steps fails, such
as Jobs on a job id it refuses, apply still decides and writes the
provider settings, then fails with that adapter's error. When the
provider settings fail as well, apply names both errors, that adapter's
first.
- On the hub, `hedge cli-proxy check` and `hedge cli-proxy check codex`,
the checks that Hedge's routes wait for, fail while
`hedge cli-proxy doctor` finds the proxy unsafe: a plugin Hedge did not
install, panel files that do not match their pins, or, with the Proxy
panel off, a panel page or plugin that is still there. A link at either
panel path fails them too, and the check says to remove the link, then
run `hedge cli-proxy install`. Apply then leaves the route out, or takes
Hedge's route out. So a hub whose proxy has such a plugin never routes
Claude Code or Codex to it, and a route that an earlier apply wrote
leaves at the next apply. A route to a safe proxy stays in place, and a
`hedge-proxy` Codex table of your own stays.
- `hedge cli-proxy connect` no longer writes Claude Code or Codex
settings itself. It saves the proxy key and runs `hedge apply`, which
writes the route and records it. So every route that Hedge writes has
a record, and turning balancing off takes it off at the next apply.
- Hedge removes a Claude Code or Codex setting only when its own record
says Hedge wrote it. It no longer removes a setting because it points
at the proxy port 8317. So a Codex provider table of your own, of any
name, stays with its selector.
- The route to the proxy is one unit: the Claude proxy address and key
helper, or the Codex `hedge-proxy` selector and table. Apply writes all
of it or none of it, so it selects no `hedge-proxy` table of your own.
It removes it together too. When removing it would leave a key of
yours that Claude Code then sends to Anthropic, such as your own
`ANTHROPIC_AUTH_TOKEN`, or a Codex `model_provider` that names a table
that is gone, the route stays and apply shows a `To do:` line that
names the setting to remove.
`hedge doctor` reads one result of each check for both the config and
its line.
- When `hedge cli-proxy connect` fails on a box, the hub names the box and
the exit code, and the command that hands over the same key again:
`hedge box run <box> -- hedge cli-proxy connect < ~/.config/hedge/cli-proxy.key`.
It never prints the box's output.
- The notice that a Codex plugin is yours now no longer fails
`hedge doctor`, as for a Claude plugin.

### Hedge is cloud only

- Hedge runs your agents on a hub and one or more nodes in the cloud. The
Expand Down
4 changes: 4 additions & 0 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ the person:
and give the file to the command over SSH, as its pack's setup note shows.
- `Note:` information only.
- `Everything matches your profile.` The box is set up.
- `Everything Hedge sets matches your profile. The To do lines above wait for
you.` The box is set up. Each `To do:` line above it waits for the person,
such as adding a subscription to the hub's own-account proxy, and does not
stop setup. Tell the person what each one asks, and go on.

### When Hedge kept something of theirs

Expand Down
13 changes: 9 additions & 4 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,15 @@ and Hedge does not wrap it in a unit.
pack owns only the probe, a check. The config items say `after: route`.
- *Apply while the proxy does not answer:* the gate fails, the two items
leave the plan, and the adapter removes its own values. Claude Code
uses its own sign-in. A key that holds exactly the pack's value also
goes when no apply recorded it, as after `hedge cli-proxy connect`,
and while a pack source cannot be fetched. The items that wait for
one check go together, so they all stay when one holds another value.
uses its own sign-in. The adapter removes only the keys that its
record names, also while a pack source cannot be fetched.
`hedge cli-proxy connect` writes neither key: it saves the proxy key and
runs `hedge apply`, so every route Hedge writes has a record.
- *One route:* the adapter writes the route keys of a provider together
or not at all, and removes them together. When removing them would
leave a key of yours that Claude Code sends to Anthropic, or a Codex
`model_provider` that names a table that is gone, the route stays and
apply shows a `To do:`.
- *Until recovery:* each `hedge apply` and `hedge doctor` reports the
failed check. The first apply whose probe passes writes both keys
again. Between applies nothing changes the route.
Expand Down
6 changes: 6 additions & 0 deletions packs/hub/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,11 @@ Every machine keeps working when the hub is down.
own-account balancing, so `packs/recovery/SETUP.md` turns it on when they
pick Recovery. Proxy panel needs own-account balancing too; turn it on only
when the person asks for the proxy's web panel.
With own-account balancing on, the hub installs and runs the proxy even
while it holds none of their subscriptions, and setup goes on. Each
machine keeps its own sign-in until the proxy serves the agent. Until the
proxy holds `hub.proxyAccounts` of their subscriptions (2 by default),
`hedge doctor` on the hub shows a `To do:` line with the login command.
Relay that line; it does not fail setup.
4. Each node joins when `hedge devbox add` adds it. The hub takes the new
node at its next `hedge update`, or at once when it answers.
4 changes: 2 additions & 2 deletions packs/hub/commands/cli-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { run } from "../lib/run.ts";
import { tunnelTargets } from "../lib/tunnels.ts";
import { numberSetting, stringSetting } from "../../base/lib/settings.ts";

const modes = ["plan", "install", "doctor", "catalog", "connect", "disconnect", "check", "remove", "left"];
const modes = ["plan", "install", "doctor", "accounts", "catalog", "connect", "disconnect", "check", "remove", "left"];
const plans = ["claude", "codex", "both"];
const version = "8.0.46";
const archives: Record<string, [string, string]> = {
Expand Down Expand Up @@ -39,7 +39,7 @@ function panel(historyDays: number): Panel {
await runCommand(() => {
const [mode = "plan", ...rest] = Bun.argv.slice(2);
const agent = mode === "check" && rest.length === 1 && rest[0] === "codex" ? "codex" : rest.length ? undefined : "claude";
if (!agent || !modes.includes(mode)) return console.error("Usage: hedge cli-proxy [plan|install|doctor|catalog|check [codex]|disconnect|remove|left], or hedge cli-proxy connect < key file"), 2;
if (!agent || !modes.includes(mode)) return console.error("Usage: hedge cli-proxy [plan|install|doctor|accounts|catalog|check [codex]|disconnect|remove|left], or hedge cli-proxy connect < key file"), 2;
const days = panelDays(Bun.env);
return cliProxy(mode as ProxyMode, {
home: homedir(), uid: process.getuid?.() ?? 0, user: userInfo().username, ...(plans.includes(Bun.env.HEDGE_PLAN ?? "") ? { plan: Bun.env.HEDGE_PLAN as AiPlan } : {}), ...(proxyOn(Bun.env) ? { accounts: numberSetting("hub.proxyAccounts") } : {}), ...(days === undefined ? {} : { panel: panel(days) }),
Expand Down
Loading
Loading