Repository navigation
feat(bin): let a Claude seat be held out of automatic rotation - #22
Merged
Merged
Conversation
A seat can now be usable on this machine without being a candidate an automatic switch may land on: the case is an account that belongs to a different payer, such as a personal account alongside the team ones, which should be reachable deliberately and never picked up by a switch nobody was present for. The existing destination-min setting cannot express that, because it asks whether a seat is nearly empty rather than whose account it is. `fm-seat.sh auto-exclude <name>` and `auto-include <name>` are the only writers of the new local, gitignored config/claude-seat-auto-exclude, one seat name per line. Both are idempotent; an exclusion is refused for a name with no seat directory, since an exclusion matching nothing would silently keep rotating onto the seat it was meant to withhold, and for the `default` login that is never an automatic target anyway. `auto-include` accepts any name so a stale entry can always be cleared. Every automatic path reads the exclusion through next_seat, which was already the one place a candidate set is built, so `switch --next`, the armed watch's switch, the watch's instruction to move the lead, the lead-restart destination, and the feasibility check `arm` makes all skip an excluded seat and none of them can be the one that forgets. An explicit `switch <name>` does not come through that function, which is what keeps the seat manually reachable. Excluding every candidate falls through to the existing no-destination refusal rather than any new behaviour, and excluding the active seat withholds it as a future destination without moving any worker off it. `status` names every excluded seat and `list` marks each one; a home that excludes nothing reads exactly as it did before. The file follows the same inheritance contract as the other five seat settings: into local secondmate homes, never to a remote route, declined by config/claude-seat-local.
max-metaplanet
added a commit
that referenced
this pull request
Oct 6, 2026
A seat can now be usable on this machine without being a candidate an automatic switch may land on: the case is an account that belongs to a different payer, such as a personal account alongside the team ones, which should be reachable deliberately and never picked up by a switch nobody was present for. The existing destination-min setting cannot express that, because it asks whether a seat is nearly empty rather than whose account it is. `fm-seat.sh auto-exclude <name>` and `auto-include <name>` are the only writers of the new local, gitignored config/claude-seat-auto-exclude, one seat name per line. Both are idempotent; an exclusion is refused for a name with no seat directory, since an exclusion matching nothing would silently keep rotating onto the seat it was meant to withhold, and for the `default` login that is never an automatic target anyway. `auto-include` accepts any name so a stale entry can always be cleared. Every automatic path reads the exclusion through next_seat, which was already the one place a candidate set is built, so `switch --next`, the armed watch's switch, the watch's instruction to move the lead, the lead-restart destination, and the feasibility check `arm` makes all skip an excluded seat and none of them can be the one that forgets. An explicit `switch <name>` does not come through that function, which is what keeps the seat manually reachable. Excluding every candidate falls through to the existing no-destination refusal rather than any new behaviour, and excluding the active seat withholds it as a future destination without moving any worker off it. `status` names every excluded seat and `list` marks each one; a home that excludes nothing reads exactly as it did before. The file follows the same inheritance contract as the other five seat settings: into local secondmate homes, never to a remote route, declined by config/claude-seat-local.
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.
Intent
bin/fm-seat.sh needs a way to keep a seat out of AUTOMATIC rotation while still allowing a manual switch to it.
The case: seat-max-gmail (~/.claude-seats/seat-max-gmail, just created with fm-seat.sh add) is a personal account outside the Metaplanet org; it should be usable on this machine, but be possible to take in and out of the auto-switch candidates.
Today rotation (switch --next and the automatic watch / lead-restart destination) covers every named seat under the seats root.
Wanted: something like
fm-seat.sh auto-exclude <name>/auto-include <name>(or an equivalent documented LOCAL gitignored config such as config/claude-seat-auto-exclude listing names), shown instatusandlist, honoured by every automatic path including the lead-restart destination choice, withswitch <name>still allowed explicitly.Tests plus docs/claude-seats.md and docs/configuration.md updates; firstmate-coding-guidelines apply.
What Changed
fm-seat.sh auto-exclude [<name>]andauto-include <name>. They maintain a new local, gitignoredconfig/claude-seat-auto-excludefile with one seat name per line. The file is inherited by local secondmate homes but never sent to a remote route.auto-excludewith no name prints the current exclusions. It refusesdefaultand any name that has no seat profile directory.auto-includesucceeds when the seat isn't excluded, and it can clear a stale name.next_seat, the one function that builds the rotation candidate list. That makes it apply toswitch --next, the armed watch's switch, the lead-restart destination and thearmfeasibility check. Excluded seats are skipped before any quota read, with the reason printed on stderr.switch <name>doesn't go throughnext_seat, so an excluded seat can still be picked by name.statusshows the excluded seats, andlistmarks each one with "excluded from automatic rotation". The "no destination" errors now suggestauto-include.tests/fm-seat.test.shand updated the docs:docs/claude-seats.md,docs/configuration.mdand the config entry inAGENTS.md.🤖 Generated with Claude Code
Risk Assessment
✅ Low: One shared helper (fm_seat_auto_excluded) holds the exclusion, and the candidate builder next_seat applies it. Every automatic path goes through next_seat: switch --next, the watch's auto_trigger, auto_lead_trigger, the lead-restart destination choice and arm. Explicit switch and lead-restart --to skip it. The change also covers status/list output, config inheritance, docs and behavioral tests, as the intent requires.
Testing
I drove the real fm-seat.sh CLI with the real quota-axi against the real ~/.claude-seats root, using a throwaway FM_HOME that I deleted afterwards. I covered exclude/include round trips, status and list output, switch --next, arm, the watch pass, lead-restart --check, and an explicit switch to an excluded seat. All of these behaved as intended. The real quota reader intermittently gave no login verdict for seat-max2, so I could not repeat the step where rotation reaches a seat again after it is re-included. That scenario is marked untested live. The deterministic auto-exclude tests in tests/fm-seat.test.sh cover that path, including the watch and lead-restart, and all of them passed. This is a CLI-only change, so there is no visual surface; the evidence is CLI transcripts.
Evidence: auto-exclude, list and status transcript (real seats root)
Source: auto-exclude, list and status transcript (real seats root)
Evidence: switch --next skips excluded seat; all-excluded refusal for switch --next and arm
Source: switch --next skips excluded seat; all-excluded refusal for switch --next and arm
Evidence: explicit switch to excluded seat-max-gmail succeeds
Source: explicit switch to excluded seat-max-gmail succeeds
Evidence: lead-restart --check and watch pass honour the exclusion
Source: lead-restart --check and watch pass honour the exclusion
Evidence: targeted auto-exclude test run
Source: targeted auto-exclude test run
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
fm-seat.sh list|status|auto-excludebefore and afterauto-exclude seat-max-gmail(real seats root, real quota-axi, throwaway FM_HOME)fm-seat.sh auto-exclude seat-max-gmailtwice (idempotency) and reading config/claude-seat-auto-excludefm-seat.sh switch --nextfrom seat-max with seat-max-gmail excluded → landed on seat-max2fm-seat.sh auto-exclude seat-max2thenswitch --nextandarm(threshold 100) → refusal; active seat unchangedfm-seat.sh switch --force seat-max-gmailwhile excluded → switched; status shows it active and still excludedfm-seat.sh auto-include seat-max2twice (idempotency)fm-seat.sh lead-restart --checkwith a lead recorded on seat-max and every other seat excluded → refusal naming the exclusionsfm-seat.sh auto(one watch pass, threshold 100) with every other seat excluded → no switch, lead stays putTargeted tests in tests/fm-seat.test.sh: the 9 auto-exclude/include cases (deterministic quota fake) plus the earlier seat cases that ran with them; all passed✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.