fix: disinto hire-an-agent + compose generator defects blocking multi-llama-dev parallel operation #834
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#834
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-agentalready owns the provisioning pipeline for new agents (user + token +.profilerepo + project-TOML[agents.*]section + compose regeneration). When used to hire a second llama-backed dev agent (e.g.dev-qwen2) alongside the existingdev-qwen, four defects prevent safe parallel operation.Supersedes
Replaces earlier speculative refactor issues #831 and #832, which proposed a new
LLAMA_BOTSenv list + generator loop. The existinghire-an-agent+ project-TOML[agents.*]pattern already provides that structure — only the four defects below need fixing.Gap 1: token env-var name collides on role, not agent
lib/hire-agent.sh:~176saves the per-agent token asFORGE_${ROLE_UPPER}_TOKEN(role-keyed). Hiringdev-qwen2with roledevoverwritesFORGE_DEV_TOKENthat any otherdev-role agent is using.Fix: key by agent name.
Gap 2: FORGE_PASS is never persisted
user_passis generated locally inlib/hire-agent.shbut only the token is written to.env. The container's git credential helper (configured indocker/agents/entrypoint.sh) needs bothFORGE_TOKEN_*andFORGE_PASS_*to pass HTTPS auth for git push.Fix: write
FORGE_PASS_${agent_upper}=${user_pass}to.envalongside the token, same idempotency rules (update-in-place if already present).Gap 3: compose token lookup is singleton
lib/generators.sh:118-119hardcodesFORGE_TOKEN_LLAMAas the only lookup for every local-model agent service:This means multiple hired llama agents would all share the same Forgejo identity. The parsed TOML section already exposes
forge_user. Replace with per-agent lookup:where
USER_UPPERis derived fromforge_userwith the sametr 'a-z-' 'A-Z_'convention as Gap 1.Gap 4: project-repos volume is shared across agents
lib/generators.sh:~110mountsproject-repos:/home/agent/reposfor every local-model agent service. Two hired llama devs collide on:/home/agent/repos/_factory— git worktree corruption if both writing concurrently${DISINTO_DIR}/state/.dev-active— lock file read bycheck_activeinlib/guard.sh, serializing the two agents and defeating the point of adding a second workerFix: use a per-agent named volume.
and emit the named volume in the top-level
volumes:block next to the existingagents-${service_name}-datapattern.Existing
dev-qwensingle-agent deployment migrates in place on nextdisinto up: volume renames from sharedproject-repostoproject-repos-dev-qwen; entrypoint bootstrap re-clones worktree from the baked copy; CI-fix tracker + logs inagent-dataare already per-agent (volume name already includes${service_name}), so no migration there. No permanent state lives only in the old shared volume.Dependencies
issue_claimrace fix) — required for safe parallel dev-poll.Acceptance criteria
hire-an-agentwritesFORGE_TOKEN_<AGENT_UPPER>andFORGE_PASS_<AGENT_UPPER>to.env, never role-keyedhire-an-agentfor an existing agent preserves its token (idempotent per #800) or rotates only with explicit flag_generate_local_model_serviceslooks up per-agentFORGE_TOKEN/FORGE_PASSfromforge_user→<USER_UPPER>agents-<name>service has a dedicatedproject-repos-<name>named volumedisinto hire-an-agent dev-qwen2 dev --local-model http://10.10.10.1:8081 --model unsloth/Qwen3.5-35B-A3B+disinto upbrings updisinto-agents-dev-qwen2without disturbing the runningdisinto-agents-dev-qwendisinto upafter the change (worktree re-clones, no stuck state).env.exampledocuments theFORGE_TOKEN_<AGENT>/FORGE_PASS_<AGENT>naming conventionAffected files
lib/hire-agent.sh— token/pass var naming (around line 176), persistFORGE_PASSlib/generators.sh— per-agentFORGE_TOKEN/FORGE_PASSlookup (lines 118-119), per-agentproject-reposvolume (line ~110 + top-level volume list).env.example— document the new var namingNon-goals
LLAMA_BOTSenv list — not needed; project TOML[agents.*]sections already enumerate agentsdev-bot— unchanged; continues to use sharedFORGE_TOKENContext
The
dev-qwenllama dev agent merged 35 PRs in the last 24h. GPU is <1% utilized — the bottleneck is serial dev-poll → PR → review → merge handoff, not compute. llama-server runs with--parallel 4(3 slots idle). Scaling to 2 llama devs is expected to roughly double throughput.Operational rollout after this + #830 land:
No code change required at that point.
dev-bot referenced this issue2026-04-16 10:13:52 +00:00