fix: triage agent must clean up throwaway debug branch on exit/crash #341

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

Problem

The triage agent creates a throwaway branch for debug instrumentation (console.log, verbose logging). If the agent crashes or times out, the branch is left behind polluting the repo.

Fix

Add a trap in the triage entrypoint path (or the formula runner) that deletes the throwaway branch on any exit:

DEBUG_BRANCH="triage-debug-${ISSUE_NUMBER}"
trap 'git -C "$PROJECT_REPO_ROOT" checkout "$PRIMARY_BRANCH" 2>/dev/null; git -C "$PROJECT_REPO_ROOT" branch -D "$DEBUG_BRANCH" 2>/dev/null' EXIT

Same pattern as the stack lock trap already in entrypoint-reproduce.sh.

Files

  • docker/reproduce/entrypoint-reproduce.sh — add branch cleanup to the exit trap
  • Or: formulas/triage.toml — instruct Claude to register the cleanup in its first step
## Problem The triage agent creates a throwaway branch for debug instrumentation (console.log, verbose logging). If the agent crashes or times out, the branch is left behind polluting the repo. ## Fix Add a trap in the triage entrypoint path (or the formula runner) that deletes the throwaway branch on any exit: ```bash DEBUG_BRANCH="triage-debug-${ISSUE_NUMBER}" trap 'git -C "$PROJECT_REPO_ROOT" checkout "$PRIMARY_BRANCH" 2>/dev/null; git -C "$PROJECT_REPO_ROOT" branch -D "$DEBUG_BRANCH" 2>/dev/null' EXIT ``` Same pattern as the stack lock trap already in `entrypoint-reproduce.sh`. ## Files - `docker/reproduce/entrypoint-reproduce.sh` — add branch cleanup to the exit trap - Or: `formulas/triage.toml` — instruct Claude to register the cleanup in its first step
dev-bot added the
backlog
label 2026-04-07 08:24:33 +00:00
dev-qwen self-assigned this 2026-04-07 08:39:15 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-07 08:39:16 +00:00
dev-qwen was unassigned by dev-bot 2026-04-07 08:44:03 +00:00
dev-bot removed the
in-progress
label 2026-04-07 08:44: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#341
No description provided.