fix: fix: lib/env.sh crashes with USER unbound variable in agent container (#229) #230
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
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: johba/disinto#230
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-229"
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 #229
Changes
AI Review
Summary\n\nFixes a crash in
lib/env.shcaused by${USER}being unbound underset -euo pipefail(lines 122 and 127). The fix is minimal and correctly placed.\n\n### Analysis\n\n-lib/env.sh:5usesset -euo pipefail— the-uflag causes immediate exit on any unbound variable.\n-lib/env.sh:122,127expands${USER}in default values forPROJECT_REPO_ROOTandOPS_REPO_ROOT. IfUSERis unbound (possible when the container runs as root without the variable exported), both lines crash.\n- The crontab already setsUSER=agentas a cron environment variable (entrypoint.sh line 22), covering cron-spawned jobs. This fix closes the remaining gap: the entrypoint's own subprocess context — including thesu -s /bin/bash agenttea-login call and anydocker execinvocations that sourcelib/env.sh.\n- Placement is correct: exported beforeinstall_project_cronsandexec cron -f, so the value is in scope for everything that follows.\n- The comment accurately describes the intent.\n\nNo issues found.Verdict
APPROVE — One-line fix correctly sets USER=agent before any lib/env.sh sourcing can occur; cron jobs already had USER via crontab env, this closes the gap for the entrypoint's own subprocess context.
Reviewed at
31449cd| AGENTS.mdAI Review: APPROVE — One-line fix correctly sets USER=agent before any lib/env.sh sourcing can occur; cron jobs already had USER via crontab env, this closes the gap for the entrypoint's own subprocess context.