Skip to content

feat(bin): accept setup-token accounts in config/claude-accounts - #8122

Open
trillium wants to merge 3 commits into
kunchenguid:mainfrom
trillium:fm/fm-accounts-setup-token
Open

trillium wants to merge 3 commits into
kunchenguid:mainfrom
trillium:fm/fm-accounts-setup-token

Conversation

@trillium

@trillium trillium commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

  • bin/fm-worker-account-lib.sh and bin/fm-spawn.sh now accept setup-token accounts in config/claude-accounts. Workers launched on such an account get the token through a new helper, bin/fm-claude-token-exec.sh. The helper runs VAR=value launch commands.
  • bin/fm-account-quota-lib.sh handles setup-token accounts in quota checks.
  • docs/configuration.md, docs/verification/runtime-backends.md and the operational-home-layout skill document the setup-token account type and its file permissions.
  • Tests are added or extended in tests/fm-worker-account.test.sh, tests/fm-claude-account-quota.test.sh and tests/fm-worker-account-live-e2e.test.sh.

Risk Assessment

✅ Low: The change adds a well-bounded token: account kind for Claude. The token is read only by the exec helper, which exports it for one process. Ambient credentials are shed, the token file is checked for owner and mode, and the quota path skips it.

Testing

I ran the real token-exec helper against disposable token files and ran the two targeted test suites. All of them passed. I did not run a live Claude worker launch, so the fm-spawn, account library and quota report behavior is covered only by the repository's existing tests.

  • Live validation: ⚠️ inconclusive - 2 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Token exec helper exports the token to the launched command only, including a VAR=value launch command ✅ pass live The helper printed token length 16 to the command, and a FOO=1 prefix was honored.
Token exec helper refuses a group-readable, multi-token or missing token file, naming the file and never printing the token ✅ pass live Each case printed one error line naming the file and the reason, with exit code 1.
Setup-token accounts in fm-spawn and the account library, and the quota report marking them unmeasured ⏸️ untested no The prior payload recorded this scenario only as passing through the repository's existing shell tests (tests/fm-worker-account.test.sh and tests/fm-claude-account-quota.test.sh), not a live run. It d…
  • Outcome: ⚠️ 1 warning across 1 run (9m39s)

Pipeline

Updates from git push no-mistakes

⏭️ **intent** - skipped

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (2 of 3 scenarios were driven live against the product); untested: Setup-token accounts in fm-spawn and the account library, and the quota report marking them unmeasured
  • Live validation: ⚠️ inconclusive - 2 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Token exec helper exports the token to the launched command only, including a VAR=value launch command ✅ pass live The helper printed token length 16 to the command, and a FOO=1 prefix was honored.
Token exec helper refuses a group-readable, multi-token or missing token file, naming the file and never printing the token ✅ pass live Each case printed one error line naming the file and the reason, with exit code 1.
Setup-token accounts in fm-spawn and the account library, and the quota report marking them unmeasured ⏸️ untested no The prior payload recorded this scenario only as passing through the repository's existing shell tests (tests/fm-worker-account.test.sh and tests/fm-claude-account-quota.test.sh), not a live run. It d…
  • bash bin/fm-claude-token-exec.sh <file> sh -c ... with a good, loose, multi-token and missing token file, plus a VAR=value launch command
  • bash tests/fm-worker-account.test.sh
  • bash tests/fm-claude-account-quota.test.sh
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; no blocking issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Reviews (3) · Last reviewed commit: "no-mistakes(review): Let token exec help..." · Reviewed by Greptile

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @trillium. I read this as PR 2 of your stack. It's #8121's four commits plus the setup-token commit and its docs fix, so it isn't a variant of #8121, and there's nothing to choose between. The new kind of entry stays inside the opt-in config/claude-accounts list. bin/fm-claude-token-exec.sh refuses any token file that isn't owner-only and doesn't hold exactly one token, and it puts the token only in the launched process's environment, never in argv, a launch file or a record. The single pins still refuse token: as on main. Every gate holds on f6f60529: quick checks pass, the attestation binds this head with no skipped steps, live is go 7/8 with the paused account honestly left untested, Greptile is 5/5 and it merges cleanly. Contract-class: opt-in.

Because this adds a new credential kind, merging it is Kun's call, so this is waiting on Kun, not on you. It will follow #8121. Nothing more is needed from you right now.

@trillium
trillium force-pushed the fm/fm-accounts-setup-token branch from f6f6052 to f60a3d4 Compare November 8, 2026 09:56
@trillium trillium changed the title feat(bin): choose a Claude account per ship or scout from a declared list, including setup-token accounts feat(bin): accept setup-token entries in the declared Claude account list Nov 8, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @trillium. #8121 merged, so this branch is now just the setup-token layer on main 5c935cfb. I re-read the whole diff of the new tip f60a3d44:

  • bin/fm-claude-token-exec.sh loads the token through fm_worker_account_token_load. That refuses a missing, non-regular, foreign-owned or group/other-readable file, and any file that doesn't hold exactly one printable token. It exports CLAUDE_CODE_OAUTH_TOKEN for that one process and then exec env "$@".
  • The token: kind is accepted only in config/claude-accounts. The single pins keep their grammar, and the quota helper reports the entry as unmeasured without reading the file.
  • No workflow, network or installer changes.

The attestation binds f60a3d44 with no skipped steps, live is go (5/6), quick checks pass, Greptile is 5/5 with no open threads, and it merges cleanly. Contract-class: opt-in.

Nothing has changed about where this waits. It adds a new credential kind, so merging it is Kun's decision. This is waiting on Kun, not on you, and nothing more is needed from you right now.

trillium and others added 3 commits November 28, 2026 13:50
A declared account list entry may now be token:<absolute path of a setup-token
file>, a subscription reached through a long-lived `claude setup-token`
credential instead of a config directory of its own. A launch naming the entry
unsets CLAUDE_CONFIG_DIR and the same shed credentials as any pinned launch,
then runs the worker through bin/fm-claude-token-exec.sh, which exports
CLAUDE_CODE_OAUTH_TOKEN for that one process; the token never reaches argv,
the staged launch text, the task record, or status. The sign-in check runs
claude auth status through the same helper and requires loggedIn with
authMethod oauth_token. The token file must be an owner-only regular file
holding one token. The quota helper reports such an entry as unmeasured
without running quota-axi. Only the list accepts this kind; the single pin and
per-secondmate pins keep their grammar, and a home without a list is
unchanged.
@trillium
trillium force-pushed the fm/fm-accounts-setup-token branch from f60a3d4 to 4f85ff3 Compare November 28, 2026 21:55
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @trillium for rebasing this onto current main.

One thing from you, please: the new head 4f85ff3e (pushed 1:55 PM PT today) isn't what the attestation binds. The PR body still attests f60a3d44, and the PR must be raised via no-mistakes check fails on this head. Please re-raise once with git push no-mistakes so the attestation binds 4f85ff3e with every step completed.

What I checked on 4f85ff3e: it's the same three changes rebased onto main's newer bin/fm-account-quota-lib.sh (which now covers Codex accounts too). The token: entry still reports unmeasured without reading the token file. bin/fm-claude-token-exec.sh is unchanged from what I reviewed (exec env "$@" after the owner-only load). The coverage guard and repo invariants pass. No workflow, network or installer changes. Diff review: safe, no P1.

This stays a captain decision. It adds a new credential kind, so merging it is Kun's call, queued together with #8123. Once the attestation binds, it's back with Kun. If it conflicts later, the conflict is ours to resolve once Kun gives his merge word.

@trillium trillium changed the title feat(bin): accept setup-token entries in the declared Claude account list feat(bin): accept setup-token accounts in config/claude-accounts Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants