fix: hire-an-agent admin token fallback to FORGE_TOKEN poisons all admin operations #192
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
hire-an-agentstill fails because the admin token fallback logic is fundamentally broken. When the admin token creation fails (e.g. name collision), the code falls back toFORGE_TOKEN(dev-bot) and stores it inadmin_token. Every subsequent operation that requires admin privileges then silently fails because dev-bot is not an admin.This causes a cascade of failures:
PATCH /admin/users/dev-qwen) — 403, dev-bot is not admin → password unknownGET /repos/dev-qwen/.profile) — 404, private repo not visible to dev-bot → thinks repo does not existPOST /admin/users/dev-qwen/repos) — 403 → falls through to wrong endpoint or failsRoot cause
In the
hire-an-agentfunction, around line 2649-2664:The fallback
admin_token="${FORGE_TOKEN}"makesadmin_tokennon-empty but non-admin. Every subsequentif [ -n "$admin_token" ]check passes, but every admin API call fails silently.Fix
The admin token must NEVER fall back to a non-admin token. Instead:
hire-admin-$(date +%s))FORGE_ADMIN_PASSfrom.envand use basic auth (-u disinto-admin:$pass) for admin API calls throughout the function, avoiding the token mechanism entirelyOption 4 is simplest and matches what
setup_forge()does successfully.Files
bin/disinto—disinto_hire_an_agent(), admin token creation and all downstream uses