fix: fix: agents entrypoint crashes — pname unbound variable in cron setup (#171) #176
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
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#176
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-171"
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 #171
Changes
AI Review
Summary
This PR fixes a crash in
install_project_crons()caused by referencing${pname}before it was ever assigned.The script runs with
set -euo pipefail— the-uflag causes any reference to an unbound variable to immediately abort execution. In the original code,PROJECT_REPO_ROOT=/home/agent/repos/${pname}appeared in the static initializer ofcron_lines, at a point wherepnamehad not yet been declared or set. The fix moves that line inside theforloop, after thepname=$(python3 ...)assignment, which is exactly where it belongs.Correctness
The repositioned line also produces the correct crontab structure for multiple projects. Each project block now looks like:
Crontab environment assignments apply to all subsequent job lines until overridden, so each project's jobs will correctly inherit its own
PROJECT_REPO_ROOT. The fix is minimal and complete.Verdict
APPROVE — Correctly fixes unbound variable crash by moving PROJECT_REPO_ROOT assignment inside the loop after pname is set
Reviewed at
79d46f1| AGENTS.mdAI Review: APPROVE — Correctly fixes unbound variable crash by moving PROJECT_REPO_ROOT assignment inside the loop after pname is set