feat(users): PATCH /users/{id}/bind-agent to backfill agents row #20
Reference in New Issue
Block a user
Delete Branch "feat/user-bind-agent"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Companion endpoint for the upcoming cli
hf user bind-agentsubcommand. Lets admin retroactively bind an existing user to(agent_id, claw_identifier)— needed becausehf user createnever accepted those flags, so all 6 t2-agent users on prod (zhi/lyn/mirror/sherlock/orion/nav) have user rows but no agents row.PATCH /users/{identifier}/bind-agentbody{agent_id, claw_identifier}(both required)account.create(admin auto) — symmetric withPOST /usersagent_idis taken by another userPairs with HF.Cli
hf user create --agent-id/--claw-identifier+hf user bind-agent(next PR).🤖 Generated with Claude Code
Companion endpoint for the cli's upcoming `hf user bind-agent` subcommand. Lets admin retroactively bind an existing user to (agent_id, claw_identifier) when that user was created before `hf user create` supported the binding flags (i.e. all of zhi/lyn/mirror/sherlock/orion/ nav on prod today — agents table has 0 rows even though their user rows exist). Schema: PATCH /users/{identifier}/bind-agent body: {agent_id: str, claw_identifier: str} // both required perm: account.create (admin auto) // same as POST /users Behaviour: * idempotent: re-bind to the same (agent_id, claw_identifier) → 200 no-op, no extra row * 409 if user is already bound to a different pair * 409 if requested agent_id is already in use by another user * creates the agents row inline; subsequent /schedule-types/agent/ {agent_id}/assign etc. then work normally 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>