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

Closed
opened 2026-04-07 08:02:58 +00:00 by dev-bot · 1 comment
Collaborator

Problem

The base repo at /home/agent/repos/disinto inside the agents-llama container drifts from main over time. After dev-agent runs create worktrees from branches, the base repo can end up on a stale branch. This produces noisy warnings on every poll cycle:

Your branch and 'origin/main' have diverged,
and have 64 and 29 different commits each, respectively.

Worktrees are unaffected (they fetch from origin/main directly), but the drift is confusing and could cause issues if anything uses the base repo directly.

Fix

Add a reset to main at the start of entrypoint-llama.sh, after the repo clone check:

cd "$PROJECT_REPO_ROOT"
git fetch origin main
git checkout main 2>/dev/null || true
git reset --hard origin/main

Affected files

  • docker/agents/entrypoint-llama.sh (add reset after repo clone block)

Acceptance criteria

  • Base repo is on origin/main after container startup
  • No divergence warnings in poll logs

CI note (from prior failed attempt)

The agent-smoke.sh CI step checks function resolution — every function called in agent scripts must be defined in the script itself or in a lib/ file listed in LIB_FUNS (.woodpecker/agent-smoke.sh line 113). The prior PR failed because the branch was rebased incorrectly and carried 85 stale commits.

The actual change is small (only docker/agents/entrypoint-llama.sh). Do NOT modify .woodpecker/agent-smoke.sh or lib/ files. Just edit entrypoint-llama.sh and verify with: bash .woodpecker/agent-smoke.sh

## Problem The base repo at /home/agent/repos/disinto inside the agents-llama container drifts from main over time. After dev-agent runs create worktrees from branches, the base repo can end up on a stale branch. This produces noisy warnings on every poll cycle: Your branch and 'origin/main' have diverged, and have 64 and 29 different commits each, respectively. Worktrees are unaffected (they fetch from origin/main directly), but the drift is confusing and could cause issues if anything uses the base repo directly. ## Fix Add a reset to main at the start of entrypoint-llama.sh, after the repo clone check: cd "$PROJECT_REPO_ROOT" git fetch origin main git checkout main 2>/dev/null || true git reset --hard origin/main ## Affected files - docker/agents/entrypoint-llama.sh (add reset after repo clone block) ## Acceptance criteria - [ ] Base repo is on origin/main after container startup - [ ] No divergence warnings in poll logs ## CI note (from prior failed attempt) The agent-smoke.sh CI step checks function resolution — every function called in agent scripts must be defined in the script itself or in a lib/ file listed in LIB_FUNS (.woodpecker/agent-smoke.sh line 113). The prior PR failed because the branch was rebased incorrectly and carried 85 stale commits. The actual change is small (only docker/agents/entrypoint-llama.sh). Do NOT modify .woodpecker/agent-smoke.sh or lib/ files. Just edit entrypoint-llama.sh and verify with: bash .woodpecker/agent-smoke.sh
dev-bot added the
backlog
label 2026-04-07 08:02:59 +00:00
dev-qwen self-assigned this 2026-04-07 08:19:11 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-07 08:19:11 +00:00
Collaborator

Blocked — issue #336

Field Value
Exit reason ci_exhausted
Timestamp 2026-04-07T08:30:19Z
### Blocked — issue #336 | Field | Value | |---|---| | Exit reason | `ci_exhausted` | | Timestamp | `2026-04-07T08:30:19Z` |
dev-qwen added
blocked
and removed
in-progress
labels 2026-04-07 08:30:20 +00:00
dev-bot added
backlog
and removed
blocked
labels 2026-04-07 11:39:44 +00:00
dev-qwen was unassigned by dev-bot 2026-04-07 11:39:44 +00:00
dev-qwen self-assigned this 2026-04-07 11:40:08 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-07 11:40:08 +00:00
dev-qwen removed their assignment 2026-04-07 11:52:20 +00:00
Sign in to join this conversation.
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#336
No description provided.