Skip to content

Commit 66adf6d

Browse files
committed
fix(thread): break agent turns on git/skill action rows too
git_action and skill_button_action stand in for the user's message when the prompt was a git operation or skill button click, so they must open a turn like a user message instead of rendering inside the agent card. Same boundary set as the legacy view's buildThreadGroups. Generated-By: PostHog Code Task-Id: 1b2b9d53-4742-4e1f-96b7-7232bbcf3536
1 parent 8631b4d commit 66adf6d

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

  • packages/ui/src/features/sessions/components/chat-thread

packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ function groupToolRuns(items: ConversationItem[]): ThreadItem[] {
172172
}
173173

174174
/**
175-
* Collapse each contiguous run of non-user rows into one {@link AgentTurn}, broken only by a user
176-
* message (which stays a standalone row so it remains the scroll anchor for the sticky header and
177-
* auto-follow). The turn block renders as a single muted card, tightening the spacing between the
178-
* agent's successive replies and tool calls.
175+
* Collapse each contiguous run of non-user rows into one {@link AgentTurn}, broken only by a
176+
* user-initiated row (which stays standalone so it remains the scroll anchor for the sticky header
177+
* and auto-follow). The turn block renders as a single muted card, tightening the spacing between
178+
* the agent's successive replies and tool calls.
179179
*/
180180
function groupIntoTurns(rows: ThreadItem[]): TurnRow[] {
181181
const out: TurnRow[] = [];
@@ -187,7 +187,15 @@ function groupIntoTurns(rows: ThreadItem[]): TurnRow[] {
187187
}
188188
};
189189
for (const row of rows) {
190-
if (row.type === "user_message") {
190+
// git_action and skill_button_action stand in for the user's message when the prompt was a
191+
// git operation or a skill button click (see handlePromptRequest) — they open a turn just
192+
// like a user message, so they break the agent card too rather than render inside it as if
193+
// they were agent output. Same boundary set as the legacy view's buildThreadGroups.
194+
if (
195+
row.type === "user_message" ||
196+
row.type === "git_action" ||
197+
row.type === "skill_button_action"
198+
) {
191199
flush();
192200
out.push(row);
193201
} else {

0 commit comments

Comments
 (0)