Skip to content

cargo xtask dev can't add its Claude credential on a fresh state #34

Closed

Description

@fctl-sh

What is wrong. On a fresh state (no .fctl-dev/ and no crates/fctl-control/.wrangler/), cargo xtask dev can't add its Claude credential, so it stops with "adding a Claude credential: HTTP 404" before it starts the host.

How it works now. ensure_basics in xtask/src/dev.rs adds the credential with POST /api/v1/me/claude and the token sk-ant-oat01-fctl-dev-fake-claude. The control plane rejects it twice over:

  • The route is POST /api/v1/me/claude/token (crates/fctl-control/src/lib.rs). /me/claude only answers GET, so the request gets a 404.
  • add_token (crates/fctl-control/src/api/claude.rs) wants at least 40 characters, and the dev token has 33, so on the right route it would get a validation error instead.

Dev state that already has a credential isn't affected: ensure_basics adds one only when /auth/me lists none.

I found this while running cargo xtask dev's steps by hand for #32 (Vite needs the design package, which that sandbox couldn't fetch). Its exact POST /api/v1/me/claude call got 404 Not Found in wrangler dev's log, and a 44-character sk-ant-oat01-… token posted to /me/claude/token worked.

What should happen

Compatibility. Development tooling only: nothing ships to hosts or the control plane.

Decisions for a person. Whether CI should run the bootstrap against wrangler dev, so the next route or validation change can't break it unnoticed.

Session: https://app.fctl.sh/s/ses_01M564VCYM35Z4JVYCMFQ73EZ6

Activity

  1. added
    bug
    on Oct 18, 2026
  2. fctl-sh commented on Oct 18, 2026

    @fctl-sh
    ContributorAuthor

    #33 fixed this. It merged ten minutes after this issue was opened, without linking it: ensure_basics in xtask/src/dev.rs now posts to /me/claude/token with a 44-character token.

    I checked it in this session on main at 012337e, from a fresh clone (no .fctl-dev/, crates/fctl-control/.wrangler/ or node_modules):

    • cargo xtask dev reached "fctl dev is running". In wrangler dev's log, POST /api/v1/setup, /auth/tokens, /me/claude/token, /projects and /runners all returned 201.
    • fctl claude status --json listed the fake-claude token as active and the default, and fctl run -p playground "write notes.md" ran a fake-claude session to the end.
    • A restart on that state added nothing and was running again in 6 s. With .fctl-dev/token deleted, it signed in with the password (POST /api/v1/auth/login 200) and made a new token.

    All of that needed worker-build installed first. Without it, cargo xtask dev fails when wrangler starts, which is #41. With #54, a fresh run on a machine without worker-build installs it and gets to the same place.

    This issue's question for a person, whether CI should run the bootstrap, is now #53, with #41 as a second break CI didn't catch. Closing this as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions