fix: hire-an-agent does not persist per-agent secrets to .env (#847) #866
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#866
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-847"
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 #847
Changes
AI Review
Summary
The core fix in (Step 1.7) is correct: it writes or to at hire time, closing the original bug. The documentation in is accurate and well-structured.
The new function added to has a blocking logic bug that makes it silently skip all Anthropic-backend agents.
Findings
blocker
bin/disinto:1792: Anthropic-backend agents are entirely skipped by a premature guard.The loop contains:
Anthropic-backend agents have no
base_urlin the TOML. The third guard causescontinuefor every such agent, so theirFORGE_TOKEN_*andFORGE_PASS_*are never checked. Theelsebranch that would checkANTHROPIC_API_KEY(lines 1819-1824) is consequently dead code — it can never be reached. The intended semantic is: usebase_urlonly to choose which backend credential to validate, not as a gating condition for whether to validate the agent at all.Fix: remove the
[ -n "$base_url" ] || continueguard and keepbase_urlscoped to the backend-credential check block that follows.minor
lib/hire-agent.sh:243: Missing sed escape forANTHROPIC_BASE_URLvalue. TheANTHROPIC_API_KEYupdate path correctly escapes&,/, and\before substitution:The
ANTHROPIC_BASE_URLupdate path (line 243) substitutes$backend_valdirectly without escaping. A URL containing&would corrupt the.envline. Straightforward to fix by applying the same escaping pattern.nit
lib/hire-agent.sh:232,270: Step numbering is inverted in execution order. Step 1.7 (write backend credentials) executes before Step 1.6 (collaborator setup). The numbering implies the opposite. Cosmetic only — no functional impact.Correctness verified
Verdict
REQUEST_CHANGES — _validate_env_vars silently skips all Anthropic-backend agents due to a premature continue guard, making the new validation dead code for the most common agent type
Reviewed at
37ee38f| AGENTS.mdAI Review: REQUEST_CHANGES — _validate_env_vars silently skips all Anthropic-backend agents due to a premature continue guard, making the new validation dead code for the most common agent type
37ee38f59atoa3eb33ccf7AI Re-review (round 2)
Previous Findings
blocker
bin/disinto:1792(premature[ -n "$base_url" ] || continueguard) → FIXED: Guard removed at commita3eb33c. Loop body now runs for all agents;base_urlpresence is checked only for the backend-credential branch (line 1812). Anthropic-backend agents now have FORGE_TOKEN/FORGE_PASS validated correctly.minor
lib/hire-agent.sh(missing sed escape for ANTHROPIC_BASE_URL) → FIXED:escaped_valvariable added at line 266 using the samesed 's/[&/\]/\\&/g'pattern already present in the ANTHROPIC_API_KEY path. Both update paths are now consistent.nit step numbering inverted (1.7 runs before 1.6) → not addressed, cosmetic, no functional impact.
New Additions
The incremental commit also adds agent-name grammar validation at hire time (
lib/hire-agent.sh:48) and dash-to-underscore normalization inlib/load-project.sh. Both are correct:^[a-z]([a-z0-9]|-[a-z0-9])*$enforces no consecutive dashes, no trailing dash, no leading dash, lowercase-alnum only — consistent with the downstream grammar constraints documented in the comment.name.upper().replace('-', '_')matches thetr 'a-z-' 'A-Z_'convention already used in hire-agent.sh and generators.sh.tests/lib-load-project.batscover the dashed-name normalization path and all five invalid-name rejection cases; each test would fail on the pre-fix code.Verdict
APPROVE — Both prior blockers fixed: premature continue guard removed, ANTHROPIC_BASE_URL sed escaping added
Reviewed at
a3eb33c| Previous:37ee38f| AGENTS.mdAI Re-review (round 2): APPROVE — Both prior blockers fixed: premature continue guard removed, ANTHROPIC_BASE_URL sed escaping added