fix: fix: hire-an-agent admin token fallback to FORGE_TOKEN poisons all admin operations (#192) #198
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-192"
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?
Fixes #192
Changes
AI Review — Error\n\nReview failed.\n---\n
1806446AI Review
Summary
The fix correctly addresses issue #192. Previously, when admin token creation failed, the code fell back to
FORGE_TOKEN— a user-scoped token — for admin API operations, silently poisoning them. Now:PATCH /admin/users/:agent,POST /admin/users,POST /admin/users/:agent/repos) are switched to basic auth-u "${admin_user}:${admin_pass}".admin_token:-${FORGE_TOKEN}for repo creation is removed; the code now goes straight to the admin API path with basic auth.Findings
bin/disinto:2649-2668: Theadmin_tokenvariable is acquired (and the function exits if it's empty), but is never referenced again — all subsequent admin calls use basic auth directly. The acquisition block now acts only as a credentials pre-flight check, which is useful but the intent isn't clear from the code. This is not a bug (the core fix is correct), just slightly misleading. Pre-existing tech debt not introduced by this PR.Verdict
The fix is minimal and correct. The FORGE_TOKEN poisoning path is eliminated, the error path is explicit, and the admin operations now use the reliable basic auth mechanism throughout.
Verdict
APPROVE — Fix is correct: removes FORGE_TOKEN fallback poisoning; admin ops now use basic auth directly
Reviewed at
1806446| AGENTS.mdAI Review: APPROVE — Fix is correct: removes FORGE_TOKEN fallback poisoning; admin ops now use basic auth directly