Repository navigation
Conversation
With fewer working subscriptions than hub.proxyAccounts, none included, the cli-proxy step installs and starts the proxy and passes. hedge apply and hedge doctor show a To do line with the login command, for the Claude and the Codex pool, and nothing fails. A pack check can now name a todo. When its command exits 4, Hedge prints the todo as a To do line, keeps the config that waits for the check out, and fails neither apply nor doctor. Apply runs such a check after the steps, so it can read what a step installed. hedge cli-proxy check exits 4 while the proxy answers but serves no model for the agent, so each machine stays on its own sign-in until the pool has a subscription. The new hedge cli-proxy accounts counts the working subscriptions. A proxy that is down, refuses the key, or runs a foreign plugin still fails as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- connect saves a key the proxy accepts, and routes each agent only once the proxy serves its model, so a node can connect to an empty pool. - With hub.proxyAccounts at 0, an empty pool passes the doctor: the account count, not the floor, decides whether a missing model is wrong. - A model list the proxy cannot give fails the check and the doctor instead of reading as an empty pool. - Apply checks a waiting check again after the steps, so a fresh hub shows its To do instead of a stale Fix from before the proxy ran. - Each To do ends with the login command, so it pastes as is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connect again takes Hedge's routes off an agent the proxy no longer serves. A model list with an entry that has no model id fails, so it never reads as an empty pool. On the both plan, the doctor fails while a Codex subscription works but the proxy serves no Codex model. The added comments are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reconnect to an empty pool takes the proxy address off Claude Code only while Hedge's key helper goes with it. When Hedge cannot take its route off Codex, because the config is a link or cannot be written, connect says Codex may still use the proxy instead of failing after the key is saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connect to a proxy that serves an agent no model now saves the key and changes no agent settings. hedge apply already takes Hedge's route off an agent whose route check waits for the person, so the cleanup that connect did twice is gone, with its edge cases. A hub test shows apply taking Claude Code off the proxy once its pool empties. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A management reply without a list, or with a row that names no provider, now fails the doctor and hedge cli-proxy accounts instead of reading as an empty pool. The outage test now reaches the model list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve src/cli.ts printReport: keep the base's printFindings helper and teach it the todo finding, so held findings print To do too; keep this branch's doctor line for waiting checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a hub whose proxy is stopped, the route check failed in the gate, the step started the proxy, and the check then passed, but apply kept the stale Fix and left Claude Code's route out, so setup's final doctor failed. Apply now runs each check with a todo again after the steps, unless it passed or waited in the gate. Its finding takes the new result: a pass drops the old one, and any failing code is reported, not only 4. When config waits for a check that passes now, apply reconciles that config. Doctor reads the gate's result of a check that config waits for, so the config and the finding never disagree. The hub test's command dispatch now refuses any command the Hub pack does not run through the engine launcher, and its assertions read the todo flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connect on a box exits 0 when the proxy serves none of its agents yet, and prints that the agent keeps its own sign-in until the proxy serves it. The handover dropped that line, so the person did not learn that the box waits. The hub now says each such line with the box's name. The proxy tests assert the documented exit status 4 itself, not the constant the code exports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…line The route check's To do said the proxy holds none of the agent's subscriptions, which is wrong when one works but the proxy lists no model for it. It now says which agent's model the proxy does not list, and points to hedge cli-proxy doctor on the hub, which tells the two cases apart. The hedge-hub skill says the same. Step 8 of SETUP.md lists doctor's closing line for To do lines that wait for the person, and says they do not stop setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… findings When a pack's step failed in this apply, the second config pass no longer writes config that waits for that pack's checks. The second pass now replaces the findings that the config adapter gave in the first pass, so a plugin that waited for Claude Code leaves no stale Fix line. The proxy test fake now answers only once the service starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The handover matched any box line that ended with a fixed suffix and echoed it, so a box could put any text or control characters in the hub's output. The hub now matches the two exact lines that connect prints and prints a message of its own, which tells the person to run hedge apply on the box. The CHANGELOG says so, and names the second config pass rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When hedge cli-proxy connect exited non-zero, the hub copied the box's stderr or stdout into its own output, which could carry the proxy key or control characters. The hub now names the box and the exit code, and points to hedge cli-proxy check on the box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A running proxy could pass its route check before the step, so the first config pass wrote the route, and then the pack's step failed on a plugin Hedge did not install. The second config pass now takes out the config that waits for a check of a pack whose step failed in this apply. Apply runs a waiting check again after the steps also when its pack's step failed, so its line shows what the check finds then. The second pass replaces only the first pass's config lines that it reads again, so the notice that an edited plugin is yours now stays. The Codex notice carries no repair, as the Claude one. The proxy fake now starts only when the installed proxy unit is restarted or enabled with --now by its real name. The fake Claude CLI records each plugin's scope, and the test asserts a user install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lines Config that waits for a check of a pack with steps in this apply no longer enters the first config pass. The gate holds it: the config adapter leaves its keys, plugins and MCP servers as they are, so a route that an earlier apply wrote stays and an absent one stays absent. Apply runs its check after the steps and writes the config in the second pass only when the pack's steps passed and the check passes then. When the check fails, the config leaves as it does for any failing check. The round 3 withdraw path is gone, so the second pass never drops a table the first pass kept, such as a hedge-proxy Codex table of your own. The second pass drops a first-pass line only when it says the same line again or reports that the line's operation now succeeded. The config adapter names those operations: plugin and marketplace changes, MCP server changes, and reaching Claude Code or Codex. A Fix for an operation the second pass skips, such as a failed marketplace update, stays. A failed handover names the hub-side command that sends the same key again: hedge box run <box> -- hedge cli-proxy connect < the key file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the hub, hedge cli-proxy check and its codex form now fail while hedge cli-proxy doctor finds the proxy unsafe: a plugin Hedge did not install, or panel files that do not match their pins. Both use doctor's own safety function. The route config waits for these checks, so a failing check keeps the route out, or takes Hedge's route out, through the gate's ordinary failing-check path in the first config pass, before the proxy step runs. A route to a safe proxy stays in place. The round 4 hold is gone: Plan.held, the gate's hold for packs with steps, and the hold in the config adapter, the plugin and MCP server lookups, and the hook trust. The second config pass keeps only its round 1 purpose: after the steps, it runs again each check that config waits for, or that has a todo, and that did not pass or wait before, and writes the config of each check that passes then. It drops a line of the first pass only when it says the same line again or its operation now succeeds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the steps, apply runs again every check that config waits for and every check with a todo, and gates config with the same function as the first pass. When that changes which config waits, it runs every adapter that writes config again, the provider settings and T3's, so a route whose check fails at the end of apply leaves, and config whose check first passes after a step goes in, whatever exit code the check gave first. With the Proxy panel off, the hub's route check fails while the panel page or plugin is still there, whatever it holds. Hedge no longer removes a setting because it points at port 8317: it removes only what its record says it wrote, or Hedge's exact value for a waiting route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…what it recorded Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apply decided gated config twice: once before the steps and again after them, rerunning config adapters when the decision changed. The first decision dropped Hedge's record of a setting the second could not undo, or made Hedge's own old value look like a user edit. The provider config adapter now runs once, after the steps. Before it, apply runs each check that config waits for, and each check with a todo, once, and decides the waiting config from those results. The other adapters still run before the steps. The T3 adapter must, as the peers step needs T3, so a T3 setting can wait only for a human step. No pack has a T3 setting that waits for a check. This removes the second config pass, the rerun of adapters, and the resolved ids that plugins and MCP servers reported for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connect wrote the Codex selector and table, and the Claude proxy address and key helper, without an ownership record. Apply now removes only settings its record names, so turning own-account balancing off left the route behind. Connect now adds what it sets to the same record apply uses, so apply takes the route off with the workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the panel off, the route check used existsSync, which follows links, so a dangling link at either panel path passed while doctor and install reject it. The check now uses lstat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connect recorded the routes it wrote, which raced a concurrent apply and claimed a hedge-proxy selector the user had set beside a table of their own. Boxes connected before that change had no record, so turning balancing off left their route in place. Hedge now owns a provider setting when its record names it, or when the proxy route holds exactly the values Hedge writes: the Claude proxy address and key helper, or the Codex hedge-proxy selector and table. Apply removes that route whenever it is not wanted, with balancing on or off, and leaves it alone while any part holds another value. Connect writes no record, and the route values live in one engine module that the Hub pack reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Provider config now runs after the steps, so an adapter that ran before it on the base branch, such as Jobs on a job id it refuses, could throw before the route checks and provider cleanup ran. A route to a proxy that turned unsafe then stayed until the unrelated failure was fixed. When an adapter before the steps throws, apply now runs the route checks and the provider config adapter, then fails with the adapter's error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Install refuses a link at the panel's page or plugin path, so the route check's advice to run hedge cli-proxy install could not fix a dangling link there. The safety check now names the link and says to remove it, then run install. The test follows that advice to a passing check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test of a check with a todo that exits 4 before a step never ran the check before the step. It now runs doctor first, which shows the To do, then apply, which leaves no To do and writes the config. Two hub tests also asserted how many times the installer ran. They now assert only the final settings and the failure report. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removing a lone proxy address that matched Hedge's value would leave an older ANTHROPIC_AUTH_TOKEN beside it, which sends Claude Code to Anthropic with the proxy's key. The route is now Hedge's only when each of its settings is there with Hedge's exact value: the Claude proxy address and key helper, or the Codex selector and table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gelog The changelog still described two config passes and cleanup by record alone. It now says apply decides provider config once after the steps, runs it even when an earlier adapter fails, owns the proxy route by its exact values, and names the fix for a link at a panel path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
Setup must never be blocked by how many of your own Claude or ChatGPT subscriptions the hub's own-account proxy holds, none included.
Today, on a fresh hub with the Hub pack and own-account balancing on,
hedge apply(and so step "Set up this machine" ofhedge setup) fails:The step's check,
hedge cli-proxy doctor, threwAdd at least 2 of your own Claude subscriptions that work; found 0.Setup has no step that adds proxy subscriptions, so it could never pass. Setup's last step, "Check everything", runshedge doctor, which also failed on the route checkFix: Claude Code cannot reach your own-account proxy…while the pool was empty.Changes
hedge cli-proxy doctorno longer fails belowhub.proxyAccounts. It printsCLI proxy: To do: Add at least 2 of your own Claude subscriptions that work to the proxy; found 0. … Run on the hub, once for each subscription: <login command>. Expired logins still count for nothing, and still get their own warning. A proxy that is down, refuses the key, routes other than fill-first, or runs a foreign plugin still fails as before.pack.jsoncan name atodo. When its command exits 4 (waitsForPerson), Hedge prints thetodoas aTo do:line and fails neither apply nor doctor. The check still does not pass, so config that waits for it stays out. Apply runs atodocheck that nothing waits for after the steps, so it can read what a step installed. Doctor ends with "Everything Hedge sets matches your profile. The To do lines above wait for you." A check without atodo, or any other failing code, stays aFix:.hedge cli-proxy accountson the hub counts the working subscriptions of the pooled agent. It exits 0 athub.proxyAccountsand 4 below it. The Hub pack runs it ascli-proxy-accounts(Claude and both plans) andcli-proxy-codex-accounts(Codex plan), each with atodothat names the login command.hedge cli-proxy check [codex]exits 4 when the proxy answers the key with a model list that holds no model for the agent.cli-proxy-clientandcli-proxy-codexcarry atodofor that case. Every other reason still exits 1 and stays aFix:, including a reply without a model list or with a model entry that has no id. A subscription list from the management API without a list, or with a row that names no provider, fails the doctor andhedge cli-proxy accountstoo.todo, once, and decides that config from those results. Config that waits for nothing, or for a human step, is decided before the steps as on the base branch. The other adapters still run before the steps. The T3 adapter must, because thepeersstep uses T3, so a T3 setting can wait only for a human step, not for a check; no pack has such a setting. So a hub with one working subscription and a stopped proxy routes Claude Code in one apply, and an unsafe proxy at the end of apply means no route. A route that an earlier apply wrote stays in place while the steps run, and comes out at the end when its check fails then. When an adapter that runs before the steps throws, such as Jobs on a job id it refuses, apply still runs those checks and the provider config adapter, then fails with the adapter's error, as the base branch, which ran provider config before Jobs, did. A check's finding is its one result: aTo do:for 4, aFix:for any other failing code, and nothing for a pass.hedge cli-proxy checkandhedge cli-proxy check codexfail whilehedge cli-proxy doctorfinds the proxy unsafe: a plugin Hedge did not install, or panel files that do not match their pins. Both use doctor's own function,unsafeinpacks/hub/lib/cli-proxy.ts. The route config waits for these checks, so the gate's ordinary failing-check path keeps the route out, or takes Hedge's route out, when apply decides config after the steps. That holds whether the route is new or an earlier apply wrote it. A route to a safe proxy stays in place, and apply changes nothing. On a devbox the checks cannot see the hub's plugins folder; the hub's own apply and doctor report it. With the panel off, the route check fails while the panel page orquota-ledger.sois still on disk, whatever it holds;hedge cli-proxy installrestarts the proxy and removes both, and the route comes back in the same apply. A link at either path, dangling or not, fails the check with the panel on or off, and the check says to remove the link, then runhedge cli-proxy install, which refuses links. With the panel on, both files are checked against their pins, so no plugin passes on its file name.model_provider = "hedge-proxy"with amodel_providers.hedge-proxytable equal to Hedge's. One engine module,src/adapters/provider-config/proxy-route.ts, holds those values, and the Hub pack reads them from it. Apply removes Hedge's route whenever this apply does not write it, with own-account balancing on or off, so a box thathedge cli-proxy connectsent to the proxy, before or after this change, leaves it when balancing goes off.hedge cli-proxy connectwrites no record. Ahedge-proxyselector beside a table of your own, and a proxy address beside a key helper or token of your own, stay. The base branch also removed any setting that pointed at the proxy's port, which could delete a Codex provider table you wrote yourself.hedge doctoruses the gate's result of a check that config waits for for both the config drift and the check's line, so the two never disagree when the pool changes between two probes.To do:names the model the proxy does not list and points tohedge cli-proxy doctoron the hub, which tells an empty pool apart from a subscription that works but serves no model.hedge cli-proxy connecton a box saves the key but the proxy serves none of its agents yet, connect prints one of two fixed lines. The hub matches the exact line and prints its own message: runhedge applyon the box, so that the agent there uses its own sign-in until the proxy serves it. The hub never prints the box's output. When connect fails on the box, the hub names the box, the exit code, and the hub-side command that hands over the same key again and shows connect's own reason:hedge box run <box> -- hedge cli-proxy connect < ~/.config/hedge/cli-proxy.key. That command already exists; this PR adds none.hub.proxyAccountsat 0 passes with an empty pool: the account count, not the floor, decides whether a missing model is a failure.hedge-hubskill, thehub.proxyAccountsquestion, step 8 of the rootSETUP.md(doctor's closing line for waitingTo do:lines, which do not stop setup), and the CHANGELOG.What reads the result, and why no box moves to an empty proxy
cli-proxy-clientandcli-proxy-codex. Exit 4 is not a pass, so apply keeps each agent on its own sign-in until the proxy serves its model. On the hub, an unsafe proxy fails these checks too, so the gate decides on safety, not the step. The end-to-end test checks that.claude/settings.jsonand.codex/config.tomlstay unwritten with 0 subscriptions.hedge cli-proxy doctor) only decides whether the step holds. It never routes. Its safety condition reaches routing through the route checks, which call the same function.hedge cli-proxy-balance) reads the management API itself, not the doctor, and handles an empty pool.hedge cli-proxy connecton a node saves a key that the proxy accepts, even while the proxy serves no model. It sends each agent to the proxy only while the proxy serves that agent's model. Otherwise it leaves the agent on its own sign-in, and the firsthedge applyafter the proxy serves it moves it. Connect changes no agent settings for an agent the proxy does not serve, and tells you to runhedge apply, which takes Hedge's route off it, as it does for any route check that does not pass. Connect still changes nothing when the proxy does not answer, refuses the key, or answers with a model list it cannot read.Merge risk
Merge risk: medium. Two-way door.
Tier: non-critical
Own-account balancing is opt-in and off by default, and only the Hub pack's proxy checks have a
todo. It is medium, not low, for two reasons. The reconciler's apply loop changes: the provider config adapter, which writes Claude and Codex settings and installs plugins and MCP servers, now runs after the steps instead of before them, and the checks that config waits for run after the steps too. No step reads provider config, and a plugin whose Claude Code a step installs now goes in during the same apply. A T3 setting can no longer wait for a check; no pack has one. Cleanup also changes: Hedge removes only provider settings its record names, or a whole route with Hedge's exact values, where the base branch removed any setting that pointed at the proxy's port, so a proxy address beside anANTHROPIC_AUTH_TOKEN, or a Codex table of your own, now stays. When an adapter before the steps throws, apply still writes provider config, then fails, as on the base branch. On the hub, the route checks now also fail on an unsafe proxy, which takes Hedge's route out where the base branch kept it. And one existing hub shape now fails apply where the base branch passed: on thebothplan, with Claude at its floor and a Codex subscription that works while the proxy lists no Codex model,hedge cli-proxy doctorfails the proxy step. Routing still waits for a passing check, so no machine moves to the proxy earlier than before. Switch-off: none needed; revert or fix forward.Decisions
todothat exits 4, not a human step: setup waits for every human stepTo do:from a waiting check failhedge doctor?To do:with the login command; down, refused key or foreign table stayFix:bothplan?bothit counts Claude ones; an empty Codex pool gets itsTo do:from the Codex route check. The doctor does fail while a Codex subscription works but the proxy serves no Codex modelhedge apply, through the route checks, as for any failed route check. Connect only saves the key. Rounds 2 and 3 had connect clean up too; round 4 found more edge cases in that copy, so I removed ithedge doctorpass on a node that still routes to a pool that emptied?Fix:sayshedge applyfixes that. Setup runs apply on the hub and each devbox before its final doctor, so setup does not stop on itbothplan route Codex when your own ClaudeapiKeyHelperblocks Claude?ANTHROPIC_AUTH_TOKEN, and a proxy address beside one stays whole, so Claude Code never keeps the proxy's token without its addresshedge cli-proxy connectwrote is Hedge's?peersstep, so a T3 setting can wait only for a human step. A route an earlier apply wrote stays while the steps run and comes out at the end if its check fails/v1/modelswith no subscriptions?{"data":[],"object":"list"}, read on a live hub with CLIProxyAPI 8.0.46 and 0 subscriptions. So an empty pool reads as an empty list, anddata: nullstays unreadableFix:?src/cli.ts, theenginesource), refuses a pack name that two sources carry (choosePacksinsrc/reconciler/resolve.ts), andhedge updatemoves the one checkout. No private pack declares atodoHow did you test this code?
The proving test is
packs/hub/hub.test.ts, "apply on a hub whose proxy holds none of your subscriptions". It runs the real Hub pack plan on a hub throughapplyandcheck, withhedge cli-proxy install|doctor|accounts|checkserved bycliProxyagainst a fake CLIProxyAPI that holds 0 subscriptions:The first apply on a fresh hub already shows only the two
To do:lines, each ending with the login command. The same describe covers the Codex plan and a pool of 1 of 2, which routes Claude Code to the proxy that serves it and still lists the To do.On the base branch, the same tests fail with
"ok": falseandStep cli-proxy of the hub pack ran, but does not pass its check., which is the reported failure. On this branch they pass.Also new or changed:
src/cli.test.ts: throughmain, a waiting check printsTo do: …. Apply exits 0 and ends withApplied …, and doctor exits 0.src/reconciler/apply.test.ts: exit 4 with atodokeeps the waiting config out and fails nothing. Atodocheck that nothing waits for runs after the steps. Exit 4 without atodo, and exit 1 with one, stay aFix:.packs/hub/lib/cli-proxy.test.ts: the doctor passes with 0 and with 1 of 2 subscriptions and prints the To do. It still fails with an empty pool when the proxy refuses the key, does not answer, has its service down, or runs a foreign plugin.accountsexits 4 below the floor and 0 at it, and fails when it cannot count.checkexits 4 when no model is served.packs/hub/lib/cli-proxy.test.ts, after review round 1: connect to an empty pool saves the key and keeps Claude Code and Codex on their own sign-ins. A model list the proxy cannot give fails the check and the doctor. Withhub.proxyAccountsat 0, an empty pool passes.src/reconciler/apply.test.ts, after review round 1: a check whose pool is unreadable until a step installs it shows itsTo do:after the step. A gateFix:for a check that config waits for becomes aTo do:after the step, and the config stays out.src/pack/manifest.test.ts: atodomust be a sentence.packs/hub/hub.test.ts, after proof review 1: "with one working subscription and a proxy that only its step starts, one apply routes Claude Code to the proxy, and doctor passes" runs one apply and then doctor on a hub whose fake proxy service is stopped until the installer starts it. The test's command dispatch now refuses any command that the Hub pack does not run through the engine launcher, and the assertions read each finding'stodoflag.src/reconciler/apply.test.ts, after proof review 1: atodocheck that nothing waits for and that exits 1 after the steps is aFix:. A check that config waits for and that fails before the step and passes after it writes the config and drops itsFix:, and doctor then passes. Doctor reads one result of the check for both the config and the finding.packs/hub/lib/cli-proxy-forwards.test.ts, after proof review 1: a handover to a proxy that lists no model runs the real connect on the box, and the hub prints the box's waiting line.packs/hub/lib/cli-proxy.test.ts: the exit-status assertions use the literal 4.packs/hub/hub.test.ts, after proof review 2: the fake proxy answers only aftersystemctlstarts its service. A stopped proxy that its step starts, but whose doctor finds a plugin Hedge did not install, fails the step and writes no Claude route.src/reconciler/apply.test.ts, after proof review 2: a step installs Claude Code, the waiting check passes after it, and provider config, which runs after the steps, installs the plugin. Apply then shows noFix:.packs/hub/lib/cli-proxy-forwards.test.ts, after proof review 2: box lines that hold a known waiting line plus other text or control characters print nothing from the box. The exact line prints the hub's own message.packs/hub/hub.test.ts, after proof review 3: the stopped-proxy test shows no stale reachabilityFix:after the step starts the proxy. The fake proxy starts only whensystemctl --user restartorenable --nownameshedge-cli-proxy.serviceand its unit file is installed.src/reconciler/apply.test.ts, after proof review 3: the fake Claude CLI records each plugin's scope. The test asserts a user install, and doctor reports a plugin installed with another scope as missing. A plugin you edited and that no pack enables keeps its "It is yours now" notice through the second config pass.packs/hub/lib/cli-proxy-forwards.test.ts, after proof review 3: a failed handover whose box output holds a key-like string and an ANSI escape prints neither, only the box name and the exit code.packs/hub/hub.test.ts, after proof review 5, asserting at the proxy boundary (each request to the proxy records the route then) and after apply returns: with a plugin Hedge did not install from the start, the route is absent at every request and is never written. After a successful apply, such a plugin appears while the proxy still lists the model: the next apply fails, the route is gone, and it stays absent through the apply after. Ahedge-proxyCodex table of your own that points elsewhere survives the failed step,model_providerincluded. On a hub whose step passes, every request sees the route that the first apply wrote, and the next apply changes nothing.packs/hub/lib/cli-proxy-panel.test.ts, after proof review 5: on the hub,checkandcheck codexexit 1 and print doctor's reason while a plugin Hedge did not install is there, andcheckexits 1 when the quota-ledger plugin does not match its pin.src/adapters/provider-config/provider-config.test.ts, after proof review 5: a Codex hook keeps its trust while the check it waits for passes, even when its pack's step fails.src/reconciler/apply.test.ts, after proof review 4: a marketplace update fails while the plugin installs, and itsFix:stays.src/adapters/provider-config/provider-config.test.ts, after proof review 4: doctor runs before apply gives a changed Codex plugin to the person, passes, and shows only "It is yours now". After the release and one more apply, the fake Codex still has the plugin installed and disabled, and config.toml keeps it disabled.packs/hub/lib/cli-proxy-forwards.test.ts, after proof review 4: a failed handover nameshedge box run box-lane -- hedge cli-proxy connect < ~/.config/hedge/cli-proxy.key.src/reconciler/apply.test.ts, after proof review 7: a route an earlier apply wrote, whose check fails before a step and passes after it, stays in place, and apply changes nothing. A check that passes before a step and fails after it never puts its config in. A check with atodothat exits 4 before a step and 0 after it leaves noTo do:and writes its config in the same apply.packs/hub/hub.test.ts, after proof review 7: afterhedge cli-proxy connecton a devbox, turning balancing off takes the Claude and Codex routes off at the next apply.packs/hub/lib/cli-proxy-panel.test.ts, after proof review 7: with the panel off, a dangling link at the panel page or plugin path fails the route check.src/pack/manifest.test.ts, after proof review 7: a T3 setting that waits for a check is refused.packs/hub/hub.test.ts, after proof review 8: on a devbox that connect sent to the proxy, which leaves no record, turning balancing off takes the exact Claude and Codex routes off. Your ownhedge-proxyselector with a table of your own stays, selector and table, through connect and balancing off. A job id that the Jobs adapter refuses still lets apply take the route to a proxy that turned unsafe out, and apply fails with the job's reason. The two unsafe-proxy tests no longer count installer runs.src/adapters/provider-config/provider-config.test.ts, after proof review 8: Hedge's exact Claude route without a record comes out, and the proxy address beside a key helper of your own stays.packs/hub/lib/cli-proxy-panel.test.ts, after proof review 8: a dangling link at the panel page or plugin fails the check, which says to remove it; after you remove it, install passes and so does the check.src/reconciler/apply.test.ts, after proof review 8: doctor shows theTo do:of a check with atodothat exits 4 before the step; apply then leaves noTo do:and writes the config, and doctor passes.Each new test of proof review 1 fails on the head before it,
0a628ecb. Each new test of proof reviews 2, 3 and 4 fails when its fix is reverted. Of proof review 5: both unsafe-route hub tests fail on the route outcome whencheckskips the safety function; the Codex table, T3 and hook-trust tests fail on the round 4 head,f62c9650; the stopped-proxy test fails without the second pass; and the steady-state test fails when the gate takes the route out before the step and writes it back. Of proof review 7: with apply.ts of01d4b1b5, the tests that a route an earlier apply wrote stays in place and that a check passing only before a step never writes its config fail; without connect's record, the connect-then-off hub test fails; withexistsSync, the dangling-link panel test fails; and without the T3 rule, the manifest test fails. The new exit-4 case with atodopasses on both heads. Of proof review 8: without the exact-route rule, the no-record hub test and the provider-config test fail; with a rule that ignores the Codex table, or with round 7's connect record restored, the selector-and-table test fails, and the record also fails the no-record test; without the catch, the Jobs test fails; without the link message, the dangling-link test fails; and when apply ignorestodo, the rewritten exit-4 test fails.bun run typecheckpasses.bun run testat6efc4508: 4318 pass and 17 fail. 16 also fail on a clean devbox checkout: the privacy scan (no gitleaks), tracker and frontier (git rewrites the GitHub origin), and the page code parser test. The 17th, resolve's 50 ms timing test, ran at load 27 and passes 3 of 3 alone.f2cb11a4changes only the CHANGELOG.bun scripts/build-page.tsbuilds the site. The text changes on the site are thehub.proxyAccountsquestion and the Proxy panel risk on/packs/hub/. Nothing ran against a real home directory or a real machine.Review: GPT-6.2 Sol at high effort, round 1 at
32cb807e, found 2 blockers, 3 should-fix and 1 nit. I fixed all of them but finding 5, which the Decisions table answers. Round 2 at08590ec3found 2 blockers, 1 should-fix and 1 nit: reconnect left routes on an empty pool, a model list with bad entries read as empty, thebothplan hid a Codex serving failure, and 5 added comments. I fixed all 4 ata360a3cf, and each new test fails on the old code. Round 3 ata360a3cffound 1 blocker and 3 should-fix. I fixed the two about reconnect cleanup atb0b6d785, and each new test fails on the old code. The Decisions table answers the other two. Round 4 atb0b6d785found 4 should-fix. Finding 3 was another edge case of connect's cleanup, which1731ae4bremoves in favour ofhedge apply. Finding 4 is in the Decisions table. Findings 1 and 2 are as on the base branch: apply removes a Claude proxy address equal to the proxy's own when the route check does not pass, and a Codex-only node refuses a linked Codex config before it saves the key. Round 5 at1731ae4bfound 1 blocker and 2 should-fix. The Decisions table answers findings 1 and 3. For finding 2, connect now tells you to runhedge apply; the message for a linked Codex config is as on the base branch. The final read at6abe2ac5found 1 should-fix: a subscription list with a row that names no provider read as an empty pool.b17861b9fixes it, and the outage test now reaches the model list. The read of that fix atb17861b9found 1 nit, a reply ofnullwithout the clear message, which11ffa623fixes as the reviewer suggested. Proof review 1 at0a628ecb(correctness, risk and fresh-eyes lenses) found 1 blocker, 3 major, 3 minor, 1 nit and 3 test rewrites.8cdbcf65fixes the blocker, both apply majors, the fresh-eyes minor and the test rewrites in the reconciler and the hub test.5a473af2relays the box's waiting line and asserts the literal 4.82302f9arewords the routeTo do:and adds doctor's closing line toSETUP.md. The Decisions table answers the pack-version finding and the fresh-eyes question aboutdata: null. Proof review 2 at82302f9afound 2 blockers, 1 major, 1 minor and 1 test rewrite.b632f1edkeeps config out when its pack's step failed, makes the second config pass replace the first pass's config lines, and makes the fake proxy start with its service.bac84008makes the handover match exact box lines and print the hub's own message, and rewords the CHANGELOG. Proof review 3 atbac84008found 2 blockers, 2 minor and 2 test rewrites.e41fa934stops the hub from printing a box's output when connect fails.ada15732takes back config that waits for a check of a pack whose step failed, reruns the waiting check after a failed step, keeps first-pass notices, and rewrites the proxy fake and the plugin scope test. Proof review 4 atada15732found 2 blockers, 3 major and 2 test rewrites.f62c9650replaces the take-back path: config that waits for a check of a pack with steps is held until those steps ran, and the second pass never drops a table the first pass kept. It keeps a first-passFix:unless the second pass says it again or reports its operation done, nameshedge box runas the retry for a failed handover, and runs doctor before a Codex plugin release. Proof review 5 atf62c9650found 6 blockers, 1 major and 3 test rewrites; all six blockers came from the hold.23a8e859replaces the hold with a route gate that checks the proxy's safety, removes the hold from every adapter, keeps the second pass only for a check that passes after the steps, removes the added comments, and rewrites the tests to assert at the proxy boundary. The Decisions table answers the human-prerequisite finding. Proof review 6 at23a8e859found 4 blockers, 3 major and 1 test rewrite.01d4b1b5replaces the second pass's special cases with one config decision before and after the steps that reruns every config adapter when the decision changes, fails the route while panel files are on disk with the panel off, removes provider settings only by Hedge's record, asserts the route was gone when the proxy step starts, and checks Codex hook trust by hash. Proof review 7 at01d4b1b5found 3 blockers, 3 major and 1 test rewrite.4c927f99decides config that waits for a check once, after the steps, which removes the second config pass and its comment, and adds the exit-4 case with atodo.d2ec0ad3records the Claude and Codex routes that connect writes.6a3c0ba0counts a dangling link at a panel path as still there. Proof review 8 at6a3c0ba0found 2 blockers, 3 major, 1 minor and 2 test rewrites, all from connect's record or the new order.9fa87217and6efc4508drop connect's record and own the proxy route by its exact values, which removes the race, leaves your own selector and table alone, and takes the route off boxes connected without a record.debb77e9runs provider config when an earlier adapter throws.d984961dtells you to remove a link at a panel path before install.540aaefdruns the exit-4 case's check before the step and drops the installer counts.f2cb11a4brings the CHANGELOG up to date. The Codex hook test keeps its trust assertion: no fake Codex runs hooks, and running a real one needs a live Codex session. The hash format is Codex's own trust state, and the base branch's test "trusts the Codex hooks a pack owns" pins a literal hash for it.Checked live, read-only: the new hub's CLIProxyAPI 8.0.46 with 0 subscriptions answers
/v1/modelswith HTTP 200 and{"data":[],"object":"list"}, the shape the fake proxy sends. Not checked: a fullhedge applyandhedge doctoragainst that hub.Remaining risk: when every login in the pool expired but CLIProxyAPI still lists their models, a node's route check passes and sends the agent to the proxy. The base branch behaves the same. The hub's
hedge doctorshows the expired logins and theTo do:.🤖 Generated with Claude Code