fix(attach): address review bot feedback on warnings and footer · Entire

fix(attach): address review bot feedback on warnings and footer

6e9267e→main·

computermode·2w ago·2 files·+61 added/-6 removed

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Sessions

a548a19a0542View transcript

Changes

2

    398 unmodified lines
    
    func amendOrPrintTrailer(logCtx context.Context, w, errW io.Writer, headCommit *object.Commit, checkpointIDStr string, force bool) {
        if err := promptAmendCommit(logCtx, w, headCommit, checkpointIDStr, force); err != nil {
            logging.Warn(logCtx, "failed to amend commit", "error", err)
            fmt.Fprintf(errW, "Could not amend the commit automatically (%v).
", err)
            fmt.Fprintf(errW, "Could not amend the commit automatically (%s).
", firstLine(err.Error()))
            fmt.Fprintf(w, "\nCopy to your commit message to attach:\n\n  Entire-Checkpoint: %s\n", checkpointIDStr)
        }
    }
    ```

### Test Attach

- TestAttach_EmptyMetadataReviewWithOverride_NoEmptyPromptWarning: when a
pending-review marker supplies ReviewPromptOverride, the review prompt is
NOT empty even with an unparseable transcript, so the review-specific
warning must be suppressed (the general "no prompts parsed" warning still
fires).
  

func TestAttach_EmptyMetadataReviewWithOverride_NoEmptyPromptWarning(t *testing.T) { setupAttachTestRepo(t)

sessionID := "test-attach-empty-meta-review-override" setupClaudeTranscript(t, sessionID, `{"type":"assistant","message":{"role":"assistant","content":"hi"},"uuid":"a1"}")

var out, errOut bytes.Buffer if err := runAttach(context.Background(), &out, &errOut, sessionID, agent.AgentNameClaudeCode, attachOptions{ Force: true, Review: true, ReviewPromptOverride: "review the auth module for security issues", }); err != nil { t.Fatalf("runAttach --review with override should not fail: %v", err) }

if !strings.Contains(errOut.String(), "no user prompts were parsed") { t.Errorf("expected general empty-transcript warning on stderr, got: %q", errOut.String()) } if strings.Contains(errOut.String(), "review prompt will be empty") { t.Errorf("review-empty warning must be suppressed when an override prompt is set, got: %q", errOut.String()) } }


- TestAttachSummaryLine covers the post-attach "Captured: …" footer builder:
every field present, the token segment omitted when usage is nil, and the
empty result when nothing is known.