Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion backend/internal/adapters/reviewer/claudecode/claudecode.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,12 @@ func (r *Reviewer) PreLaunch(ctx context.Context, inv ports.ReviewInvocation) er
// ReviewMessage is the text injected into an already-running reviewer pane to
// review a new commit — AO's central review prompt.
func (r *Reviewer) ReviewMessage(_ context.Context, inv ports.ReviewInvocation) (string, error) {
return inv.Prompt, nil
// Do not return the prompt here. ReviewMessage is called when re-notifying an
// already-running reviewer pane about a new commit in the queue.
// The reviewer already has the full prompt (including task instructions and run IDs)
// from the initial launch via ReviewCommand -> GetLaunchCommand.
// Returning it again would just duplicate the instructions in the terminal.
// Instead, return empty so the terminal stays clean, the agent has all the context
// it needs from the original prompt at launch time.
return "", nil
}
10 changes: 10 additions & 0 deletions backend/internal/adapters/reviewer/claudecode/claudecode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,13 @@ func contains(values []string, needle string) bool {
}
return false
}

func TestReviewMessageReturnsEmpty(t *testing.T) {
got, err := (&Reviewer{}).ReviewMessage(context.Background(), ports.ReviewInvocation{Prompt: "next review"})
if err != nil {
t.Fatalf("ReviewMessage: %v", err)
}
if got != "" {
t.Fatalf("ReviewMessage should return empty; got %q", got)
}
}
9 changes: 8 additions & 1 deletion backend/internal/adapters/reviewer/codex/codex.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ func (r *Reviewer) ReviewCommand(ctx context.Context, inv ports.ReviewInvocation

// ReviewMessage returns the centrally-authored task for an existing pane.
func (r *Reviewer) ReviewMessage(_ context.Context, inv ports.ReviewInvocation) (string, error) {
return inv.Prompt, nil
// Do not return the prompt here. ReviewMessage is called when re-notifying an
// already-running reviewer pane about a new commit in the queue.
// The reviewer already has the full prompt (including task instructions and run IDs)
// from the initial launch via ReviewCommand -> GetLaunchCommand.
// Returning it again would just duplicate the instructions in the terminal.
// Instead, return empty so the terminal stays clean, the agent has all the context
// it needs from the original prompt at launch time.
return "", nil
}

func insertBeforePrompt(argv []string, extra ...string) []string {
Expand Down
6 changes: 3 additions & 3 deletions backend/internal/adapters/reviewer/codex/codex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ func TestReviewCommandUsesReadOnlySandbox(t *testing.T) {
}
}

func TestReviewMessageReturnsTaskPrompt(t *testing.T) {
func TestReviewMessageReturnsEmpty(t *testing.T) {
got, err := (&Reviewer{}).ReviewMessage(context.Background(), ports.ReviewInvocation{Prompt: "next review"})
if err != nil {
t.Fatalf("ReviewMessage: %v", err)
}
if got != "next review" {
t.Fatalf("message = %q", got)
if got != "" {
t.Fatalf("ReviewMessage should return empty; got %q", got)
}
}
9 changes: 8 additions & 1 deletion backend/internal/adapters/reviewer/opencode/opencode.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,12 @@ func (r *Reviewer) ReviewCommand(ctx context.Context, inv ports.ReviewInvocation

// ReviewMessage returns the centrally-authored task for an existing pane.
func (r *Reviewer) ReviewMessage(_ context.Context, inv ports.ReviewInvocation) (string, error) {
return inv.Prompt, nil
// Do not return the prompt here. ReviewMessage is called when re-notifying an
// already-running reviewer pane about a new commit in the queue.
// The reviewer already has the full prompt (including task instructions and run IDs)
// from the initial launch via ReviewCommand -> GetLaunchCommand.
// Returning it again would just duplicate the instructions in the terminal.
// Instead, return empty so the terminal stays clean, the agent has all the context
// it needs from the original prompt at launch time.
return "", nil
}
9 changes: 6 additions & 3 deletions backend/internal/adapters/reviewer/opencode/opencode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,16 @@ func TestBashAllowlistCoversPromptRequiredCommands(t *testing.T) {
}
}

func TestReviewMessageReturnsTaskPrompt(t *testing.T) {
func TestReviewMessageReturnsEmpty(t *testing.T) {
got, err := (&Reviewer{}).ReviewMessage(context.Background(), ports.ReviewInvocation{Prompt: "next review"})
if err != nil {
t.Fatalf("ReviewMessage: %v", err)
}
if got != "next review" {
t.Fatalf("message = %q", got)
// ReviewMessage should return empty so the prompt
// doesn't clutter the terminal. The reviewer already received the full
// prompt at launch time.
if got != "" {
t.Fatalf("ReviewMessage should return empty; got %q", got)
}
}

Expand Down