Compare commits
1 commit
c8f1bc5c6b
...
25433eaf67
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25433eaf67 |
1 changed files with 11 additions and 13 deletions
|
|
@ -155,11 +155,12 @@ detect_questions_phase() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for question comments (Q1:, Q2:, etc.)
|
# Check for question comments (Q1:, Q2:, etc.)
|
||||||
|
# Use jq to extract body text before grepping (handles JSON escaping properly)
|
||||||
local comments
|
local comments
|
||||||
comments=$(curl -sf -H "Authorization: token ${FORGE_TOKEN}" \
|
comments=$(curl -sf -H "Authorization: token ${FORGE_TOKEN}" \
|
||||||
"${FORGE_API}/repos/${FORGE_OPS_REPO}/issues/${pr_number}/comments" 2>/dev/null) || return 1
|
"${FORGE_API}/repos/${FORGE_OPS_REPO}/issues/${pr_number}/comments" 2>/dev/null) || return 1
|
||||||
|
|
||||||
if ! printf '%s' "$comments" | grep -qE '"body"[^"]*Q[0-9]+:'; then
|
if ! printf '%s' "$comments" | jq -r '.[].body // empty' | grep -qE 'Q[0-9]+:'; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -175,21 +176,18 @@ export CLAUDE_MODEL="sonnet"
|
||||||
# - If answers detected (PR in questions phase), resume prior session to preserve
|
# - If answers detected (PR in questions phase), resume prior session to preserve
|
||||||
# codebase context from research/questions run
|
# codebase context from research/questions run
|
||||||
# - Otherwise, start fresh (new pitch or PR not in questions phase)
|
# - Otherwise, start fresh (new pitch or PR not in questions phase)
|
||||||
RESUME_MODE=""
|
RESUME_ARGS=()
|
||||||
if detect_questions_phase; then
|
if detect_questions_phase && [ -f "$SID_FILE" ]; then
|
||||||
# PR is in questions phase — resume session if SID_FILE exists
|
RESUME_SESSION=$(cat "$SID_FILE")
|
||||||
if [ -f "$SID_FILE" ]; then
|
RESUME_ARGS=(--resume "$RESUME_SESSION")
|
||||||
RESUME_SESSION=$(cat "$SID_FILE")
|
log "Resuming session from questions phase run: ${RESUME_SESSION:0:12}..."
|
||||||
RESUME_MODE="--resume $RESUME_SESSION"
|
elif ! detect_questions_phase; then
|
||||||
log "Resuming session from questions phase run: ${RESUME_SESSION:0:12}..."
|
|
||||||
else
|
|
||||||
log "No session ID found for questions phase — starting fresh session"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
log "PR not in questions phase — starting fresh session"
|
log "PR not in questions phase — starting fresh session"
|
||||||
|
elif [ ! -f "$SID_FILE" ]; then
|
||||||
|
log "No session ID found for questions phase — starting fresh session"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
agent_run "$RESUME_MODE" --worktree "$WORKTREE" "$PROMPT"
|
agent_run "${RESUME_ARGS[@]}" --worktree "$WORKTREE" "$PROMPT"
|
||||||
log "agent_run complete"
|
log "agent_run complete"
|
||||||
|
|
||||||
rm -f "$SCRATCH_FILE"
|
rm -f "$SCRATCH_FILE"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue