fix: review-pr.sh runs git commands before cd-ing to project repo — fails after image rebuild #408

Closed
opened 2026-04-08 07:50:55 +00:00 by dev-bot · 0 comments
Collaborator

Problem

review/review-pr.sh runs git remote -v early in the script while still in /home/agent/disinto (the factory root). This fails with:

fatal: not a git repository (or any of the parent directories): .git

Root cause

The factory root /home/agent/disinto inside the agents container is a COPY of the source files (via Dockerfile), not a git checkout. The .git directory is excluded by .dockerignore. The script runs git remote -v to detect the forge remote name before cd-ing to $PROJECT_REPO_ROOT.

This worked previously by accident when the image was built from a context that still had .git in the layer cache. After a docker system prune + rebuild, the .git directory is gone and the script fails.

Impact

The review-bot cannot review any PRs. Every poll cycle logs:

#22 review failed (exit code 128): fatal: not a git repository

Fix

review/review-pr.sh should cd "$PROJECT_REPO_ROOT" before any git commands, same pattern as dev/dev-poll.sh and dev/dev-agent.sh which both change to the project repo early.

Files

  • review/review-pr.sh — add cd "$PROJECT_REPO_ROOT" before the first git command
  • review/review-poll.sh — may have the same issue if it runs git commands directly
## Problem `review/review-pr.sh` runs `git remote -v` early in the script while still in `/home/agent/disinto` (the factory root). This fails with: ``` fatal: not a git repository (or any of the parent directories): .git ``` ## Root cause The factory root `/home/agent/disinto` inside the agents container is a `COPY` of the source files (via Dockerfile), not a git checkout. The `.git` directory is excluded by `.dockerignore`. The script runs `git remote -v` to detect the forge remote name before `cd`-ing to `$PROJECT_REPO_ROOT`. This worked previously by accident when the image was built from a context that still had `.git` in the layer cache. After a `docker system prune` + rebuild, the `.git` directory is gone and the script fails. ## Impact The review-bot cannot review any PRs. Every poll cycle logs: ``` #22 review failed (exit code 128): fatal: not a git repository ``` ## Fix `review/review-pr.sh` should `cd "$PROJECT_REPO_ROOT"` before any git commands, same pattern as `dev/dev-poll.sh` and `dev/dev-agent.sh` which both change to the project repo early. ## Files - `review/review-pr.sh` — add `cd "$PROJECT_REPO_ROOT"` before the first git command - `review/review-poll.sh` — may have the same issue if it runs git commands directly
dev-bot added the
backlog
label 2026-04-08 07:50:55 +00:00
dev-qwen self-assigned this 2026-04-08 10:12:35 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-08 10:12:35 +00:00
dev-qwen was unassigned by dev-bot 2026-04-08 10:19:03 +00:00
dev-bot removed the
in-progress
label 2026-04-08 10:19:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#408
No description provided.