Repository navigation
Conversation
stex
marked this pull request as ready for review
October 8, 2026 11:38
A subscription member with no OAuth login behind it (a setup-token mint) never gets a usage reading: the walk counts it as having headroom, and once it is active nothing switches off it. The Fallback and Overview rows now mark it with stale's `⋯`, and its card opens on `no usage yet`, the word `start --auto --explain` already prints for an unread account, with `clauth login <name>` as the fix. Display only: no walk reads the new rung.
The Fallback tab's add picker raises a confirm for such a member, as it does for an add that mixes api-key and oauth accounts. When both apply, the mix confirm shows. The hazard it names lives beside `no_usage_source` so the daemon can say it the same way.
One log line beside the uncapped-spend warning, with the same hazard and fix, so a headless run or a hand-edited chain hears it at the next start. Disabled members are left out.
stex
force-pushed
the
feat/chain-unmeasured-members
branch
from
October 8, 2026 11:42
ac8cc54 to
40bc102
Compare
Contributor
Author
|
The macOS spec is flaky btw, that's why it failed here, but not on my other PR. |
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.
This marks chain members clauth has no way to measure, says what that does to the chain, and warns when one joins. The walk doesn't change.
Which members.
fallback::no_usage_sourceis true for a subscription member (nobase_url, noapi_key) without an OAuth login behind it, which is what a profile holding only aclaude setup-tokenmint looks like.collect_tokensnever polls it. The predicate is pure, so the render path can ask it per frame.What that does today, unchanged by this PR and now said out loud: with no reading, the walk counts the member as having headroom and reaches it once no freshly read member has room. Once it is active, nothing reads it as exhausted (
reading_is_actionablehas no status entry to act on), so clauth never switches away from it on its own. That is the part an operator can't guess, so every surface below says it (shared asfallback::no_usage_hazard(), the wayuncapped_spend_fix()is shared).The marker is a new lowest
BlockedReasonrung,NoUsage. It fires only while such a member has no reading at all, so a reading from anywhere (the probe, later) retires it, and every other rung outranks it.⋯, stale's glyph at stale's hue. The walk treats the two alike: neither is ever fresh, so both wait for the pass that accepts any freshness.auth brokenandkey rejectedshare×the same way.[ no usage yet ], the wordstart --auto --explainalready prints for an unread account. I moved that string intoformat::DIAG_NO_USAGEso both read one constant. The fix line under it isadd an oauth login with clauth login <name> so clauth can read its usage, the split the setup-token login already suggests ("for usage polling, also add an OAuth pair later").⋯ no usage yetrow.The warnings.
+ addon such a member raises a confirm built like the mixing one:clauth can't read this account's usage./once it's active, clauth won't switch away from it on its own.When an add would also mix api-key and oauth accounts, the mixing confirm shows, unchanged, and the marker says the rest once the member is in.clauth daemon: can't read the usage of <names>. once one is active, clauth won't switch away from it on its own. add an oauth login with `clauth login <name>` so clauth can read it. A headless run or a chain edited by hand hears it at the next start; a reload ofprofiles.tomlstays quiet, like the uncapped-spend line. Disabled members are left out.What stays the same: chain order, both walks, every switch decision, every state on disk.
BlockedReasonis render-only. I addedNoUsagetoevery_blocked_reason_variant_stays_coupled_to_candidate_excludedas not dead-first, with a fixture.the_walk_treats_an_unmeasured_member_like_any_member_without_a_fresh_readingchecksnext_targetand the scheduler's snapshot walk land on the unmeasured member when nothing is fresh, and on the fresh member when one is.an_unmeasured_active_member_is_never_switched_away_frompins the hazard the copy names, ondecide_auto_switchand on the snapshot walk.User-visible changes, as CONTRIBUTING asks: the confirm copy, the pill and fix line, the legend row, the daemon log line, and a paragraph in
wiki/Auto-Switch.mdunder "The decision" (its own commit). No key binding or default changed.Two existing tests changed.
fallback_add_enter_commits_directly_when_add_would_not_mixused two blank profiles without a login, and the candidate now raises the new confirm, so both got an OAuth login. The help legend pin covered the first 14 marks, so it now covers the 15th.Questions where I picked something you may want otherwise:
no usage yet) and the glyph (⋯) are reused; the rung exists so the pill can print that word, sinceStale'sstale data/last usage check failedwould be false for a member that was never polled. Shared⋯, or a glyph of its own?clauth login <name>for an OAuth pair beside the setup token. Is that advice you want clauth to give a setup-token user, or should it wait for the probe?agent
cargo fmt --all -- --checkclean;cargo clippy --locked --all-targets --all-features -- -D warningsclean on each of the four commits;cargo test --locked --all-featureson the last commit: 5146 passed, 0 failed, 1 ignored. I broke the change on purpose fifteen ways (drop the rung; let a reading not retire it; drop each of the predicate's three checks; move the rung to the top; skip the confirm; swap its precedence; list disabled members; never log; drop theserve()call; let the walk exclude unmeasured members; change the glyph, the word or the hazard copy) and fourteen turned tests red. The survivor: deleting thewarn_if_chain_has_no_usage_source(&config)call inserve()stays green, the same gap thewarn_if_spend_is_uncappedcall beside it has. Operator verification: unknown.[env] ANTHROPIC_BASE_URLwithoutbase_url) counts as a subscription member here; a profile whose login is removed while the TUI runs may keep its last reading and so hide the marker until a restart; I haven't traced that.