hire-an-agent does not persist per-agent secrets to .env #847
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#847
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
disinto hire-an-agent <name> <role>creates a Forgejo user and API token successfully, but does not write the resulting credentials into/home/johba/disinto/.env. The compose service block is emitted referencing env vars likeFORGE_TOKEN_DEV_QWEN,FORGE_PASS_DEV_QWEN, andANTHROPIC_BASE_URL— none of which exist in.env. The container starts with empty credentials and either crash-loops or 401s against Forgejo silently.Generalization: the bug applies to any secret an emitted service block references, regardless of backend. Local-model agents need
FORGE_TOKEN_<USER>+FORGE_PASS_<USER>+ANTHROPIC_BASE_URL; Anthropic-backend agents needFORGE_TOKEN_<USER>+FORGE_PASS_<USER>+ANTHROPIC_API_KEY. Today neither set is persisted byhire-an-agent.Repro
disinto hire-an-agent dev-qwen dev --local-model http://10.10.10.1:8081 --model unsloth/Qwen3.5-35B-A3Bon a fresh.envwith noFORGE_TOKEN_DEV_QWEN.grep DEV_QWEN /home/johba/disinto/.env→ empty.disinto up→disinto-agents-llamastarts with blankFORGE_TOKEN; git push and Forgejo API calls return 401.Naming rule (so the fix matches reality)
Env-var keys are derived from
forge_user: dashes → underscores, uppercased. So agentdev-qwenneeds:FORGE_TOKEN_DEV_QWENFORGE_PASS_DEV_QWENANTHROPIC_BASE_URL(shared, when local model) ORANTHROPIC_API_KEY(when Anthropic backend)Fix
hire-an-agentwrites/merges the required vars into.envafter creating the Forgejo user.disinto upvalidates that every emitted service block has its required env vars present, and fails loudly with the exact missing keys.Do both: write on hire, validate on up.
Rotation
Define the rotation path explicitly:
disinto hire-an-agent <same-name>should rotate the API token + password idempotently and update.envin place, ORdisinto agent rotate <name>as a separate subcommand.Either works; pick one and document it. Today there is no defined rotation story, which is how this whole class of bug started (secrets drifted out of
.env, no one remembered how to regenerate them).Acceptance
hire-an-agent dev-qwen,.envcontains the agent's token + password + backend URL/API key.disinto upwith a service referencing missing keys exits non-zero with a message listing the missing keys.docs/agents-llama.mdand discoverable fromdisinto --help.Related: #845, #846.
cdfails silently #861