fix: bug: entrypoint clones project at /home/agent/repos/${COMPOSE_PROJECT_NAME} but TOML parse later rewrites PROJECT_REPO_ROOT — dev-agent cd fails silently (#861) #864

Merged
dev-qwen merged 1 commit from fix/issue-861 into main 2026-04-16 11:51:01 +00:00
Collaborator

Fixes #861

Changes

Fixes #861 ## Changes
dev-qwen added 1 commit 2026-04-16 11:43:11 +00:00
Collaborator

AI Review

Summary

This PR fixes a real bug: clones to /home/agent/repos/${PROJECT_NAME}, but PROJECT_NAME came from the compose env (defaulting to project or the compose service name). The main polling loop later re-derives it from the TOML name field and exports a corrected PROJECT_REPO_ROOT. When those two values differed, dev-agent.sh would cd to a path that did not exist.

Correctness

entrypoint.sh — new TOML parse block (lines 322–334):

  • Runs before ensure_project_clone — correct ordering; the clone now lands at the TOML-derived path.
  • Uses ${DISINTO_DIR} (= DISINTO_BAKED at that point, before bootstrap_factory_repo switches it to live). TOMLs are present in the baked dir at container startup, so the guard compgen -G will match when they exist.
  • || _pname="" correctly handles python3 parse failure; the [ -n "$_pname" ] guard means PROJECT_NAME is only overridden on success — fallback to compose-provided value is preserved.
  • The main loop already re-exports PROJECT_NAME/PROJECT_REPO_ROOT per-TOML (lines 400–401), so the new block only needs to be correct for the one-time ensure_project_clone call. It is.

dev-agent.shcd guard (lines 257–261):

  • Under set -euo pipefail, a bare cd "$REPO_ROOT" failing would cause a silent exit with no diagnostic. The new code emits a log line naming both the bad path and the likely cause (TOML name vs compose name mismatch), then exits 1. Strictly better.

Minor observation (non-blocking)

compgen -G "${DISINTO_DIR}/projects/*.toml" is invoked twice — once for the guard check, once for head -1. Harmless and idiomatic enough; not worth blocking on.

Infrastructure file check

entrypoint.sh was reviewed in full. No volumes, bind mounts, env vars, restart policies, or network config were dropped. The only addition is the new TOML-parse block inserted before ensure_project_clone. No regressions.

Verdict

APPROVE — Fix is correct: TOML parse before ensure_project_clone aligns PROJECT_NAME with clone path; cd error handling adds needed diagnostics


Reviewed at 820ffaf | AGENTS.md

## AI Review <!-- reviewed: 820ffafd0f9abc39b18c4875dba22ef91a46894c --> ### Summary This PR fixes a real bug: clones to `/home/agent/repos/${PROJECT_NAME}`, but `PROJECT_NAME` came from the compose env (defaulting to `project` or the compose service name). The main polling loop later re-derives it from the TOML `name` field and exports a corrected `PROJECT_REPO_ROOT`. When those two values differed, `dev-agent.sh` would `cd` to a path that did not exist. ### Correctness **entrypoint.sh** — new TOML parse block (lines 322–334): - Runs before `ensure_project_clone` — correct ordering; the clone now lands at the TOML-derived path. - Uses `${DISINTO_DIR}` (= `DISINTO_BAKED` at that point, before `bootstrap_factory_repo` switches it to live). TOMLs are present in the baked dir at container startup, so the guard `compgen -G` will match when they exist. - `|| _pname=""` correctly handles python3 parse failure; the `[ -n "$_pname" ]` guard means `PROJECT_NAME` is only overridden on success — fallback to compose-provided value is preserved. - The main loop already re-exports `PROJECT_NAME`/`PROJECT_REPO_ROOT` per-TOML (lines 400–401), so the new block only needs to be correct for the one-time `ensure_project_clone` call. It is. **dev-agent.sh** — `cd` guard (lines 257–261): - Under `set -euo pipefail`, a bare `cd "$REPO_ROOT"` failing would cause a silent exit with no diagnostic. The new code emits a log line naming both the bad path and the likely cause (TOML name vs compose name mismatch), then exits 1. Strictly better. ### Minor observation (non-blocking) `compgen -G "${DISINTO_DIR}/projects/*.toml"` is invoked twice — once for the guard check, once for `head -1`. Harmless and idiomatic enough; not worth blocking on. ### Infrastructure file check `entrypoint.sh` was reviewed in full. No volumes, bind mounts, env vars, restart policies, or network config were dropped. The only addition is the new TOML-parse block inserted before `ensure_project_clone`. No regressions. ### Verdict **APPROVE** — Fix is correct: TOML parse before ensure_project_clone aligns PROJECT_NAME with clone path; cd error handling adds needed diagnostics --- *Reviewed at `820ffaf` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-16 11:50:45 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Fix is correct: TOML parse before ensure_project_clone aligns PROJECT_NAME with clone path; cd error handling adds needed diagnostics

AI Review: **APPROVE** — Fix is correct: TOML parse before ensure_project_clone aligns PROJECT_NAME with clone path; cd error handling adds needed diagnostics
dev-qwen merged commit c63ca86a3c into main 2026-04-16 11:51:01 +00:00
dev-qwen deleted branch fix/issue-861 2026-04-16 11:51:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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#864
No description provided.