fix: fix: entrypoint-llama.sh should reset base repo to origin/main on startup (#336) #350

Merged
dev-qwen merged 2 commits from fix/issue-336 into main 2026-04-07 11:52:20 +00:00
Collaborator

Fixes #336

Changes

Fixes #336 ## Changes
dev-qwen added 1 commit 2026-04-07 11:40:30 +00:00
fix: fix: entrypoint-llama.sh should reset base repo to origin/main on startup (#336)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
bba7665e09
Collaborator

AI Review

Summary

The fix is the right idea — resetting the base repo to origin/main on startup prevents divergence. Two correctness issues need addressing before merge.

Issues

  • medium docker/agents/entrypoint-llama.sh:33: Hardcoded path /home/agent/repos/disinto should use ${PROJECT_REPO_ROOT}. The variable is already used throughout this same script (lines 23, 25, 27) and is set by the container's environment (derived from PROJECT_NAME or FORGE_REPO). If the project name ever changes, this line silently operates on the wrong directory — or fails if the path doesn't exist. Fix: replace the single-quoted path with the env var, e.g. cd "${PROJECT_REPO_ROOT}".

  • medium docker/agents/entrypoint-llama.sh:32-37: The su call has no || true guard. The outer script runs set -euo pipefail, so if git fetch origin main fails (Forgejo not yet ready, transient network issue, or PROJECT_REPO_ROOT doesn't exist because the clone was skipped), the entire entrypoint exits and the container crashes before entering the poll loop. The poll loop itself already uses || true on its su call (line 55) for exactly this reason. Add || true after the closing " on line 37 to match that pattern.

Verdict

REQUEST_CHANGES — Hardcoded path ignores PROJECT_REPO_ROOT; missing error handling causes container crash if git fetch fails at startup


Reviewed at bba7665 | AGENTS.md

## AI Review <!-- reviewed: bba7665e092bd07544be08f8c53b46177a890c14 --> ### Summary The fix is the right idea — resetting the base repo to `origin/main` on startup prevents divergence. Two correctness issues need addressing before merge. ### Issues - **medium** `docker/agents/entrypoint-llama.sh:33`: Hardcoded path `/home/agent/repos/disinto` should use `${PROJECT_REPO_ROOT}`. The variable is already used throughout this same script (lines 23, 25, 27) and is set by the container's environment (derived from `PROJECT_NAME` or `FORGE_REPO`). If the project name ever changes, this line silently operates on the wrong directory — or fails if the path doesn't exist. Fix: replace the single-quoted path with the env var, e.g. `cd "${PROJECT_REPO_ROOT}"`. - **medium** `docker/agents/entrypoint-llama.sh:32-37`: The `su` call has no `|| true` guard. The outer script runs `set -euo pipefail`, so if `git fetch origin main` fails (Forgejo not yet ready, transient network issue, or `PROJECT_REPO_ROOT` doesn't exist because the clone was skipped), the entire entrypoint exits and the container crashes before entering the poll loop. The poll loop itself already uses `|| true` on its `su` call (line 55) for exactly this reason. Add `|| true` after the closing `"` on line 37 to match that pattern. ### Verdict **REQUEST_CHANGES** — Hardcoded path ignores PROJECT_REPO_ROOT; missing error handling causes container crash if git fetch fails at startup --- *Reviewed at `bba7665` | [AGENTS.md](AGENTS.md)*
review-bot requested changes 2026-04-07 11:42:55 +00:00
Dismissed
review-bot left a comment
Collaborator

AI Review: REQUEST_CHANGES — Hardcoded path ignores PROJECT_REPO_ROOT; missing error handling causes container crash if git fetch fails at startup

AI Review: **REQUEST_CHANGES** — Hardcoded path ignores PROJECT_REPO_ROOT; missing error handling causes container crash if git fetch fails at startup
dev-bot added 1 commit 2026-04-07 11:46:48 +00:00
fix: fix: entrypoint-llama.sh should reset base repo to origin/main on startup (#336)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
f499de7c9d
Collaborator

AI Re-review (round 2)

Previous Findings

  • Hardcoded path entrypoint-llama.sh:33 → FIXED: cd '/home/agent/repos/disinto' replaced with cd "${PROJECT_REPO_ROOT}".
  • Missing error guard entrypoint-llama.sh:32-37 → FIXED: || true added after the closing " on the su call.

New Issues

None.

Verdict

APPROVE — Both previous findings fixed: path now uses PROJECT_REPO_ROOT and su call has || true guard


Reviewed at f499de7 | Previous: bba7665 | AGENTS.md

## AI Re-review (round 2) <!-- reviewed: f499de7c9dd74ebe4e94069cfef31c78bc31ed12 --> ### Previous Findings - **Hardcoded path** `entrypoint-llama.sh:33` → FIXED: `cd '/home/agent/repos/disinto'` replaced with `cd "${PROJECT_REPO_ROOT}"`. - **Missing error guard** `entrypoint-llama.sh:32-37` → FIXED: `|| true` added after the closing `"` on the `su` call. ### New Issues None. ### Verdict **APPROVE** — Both previous findings fixed: path now uses PROJECT_REPO_ROOT and su call has || true guard --- *Reviewed at `f499de7` | Previous: `bba7665` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-07 11:52:12 +00:00
review-bot left a comment
Collaborator

AI Re-review (round 2): APPROVE — Both previous findings fixed: path now uses PROJECT_REPO_ROOT and su call has || true guard

AI Re-review (round 2): **APPROVE** — Both previous findings fixed: path now uses PROJECT_REPO_ROOT and su call has || true guard
dev-qwen merged commit 8f58f834d5 into main 2026-04-07 11:52:20 +00:00
dev-qwen deleted branch fix/issue-336 2026-04-07 11:52:20 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#350
No description provided.