Skip to content
Merged
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
52 changes: 52 additions & 0 deletions packages/app/src/pages/session/timeline/rows-current.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,58 @@ describe("current session timeline rows", () => {
}
})

test("suppresses per-message DiffSummary rows even when summary.diffs is populated (#733)", () => {
const source = [
{
id: "msg_u",
type: "user",
text: "edit some files",
time: { created: 1 },
summary: {
additions: 10,
deletions: 3,
files: 2,
diffs: [
{ file: "src/foo.ts", additions: 7, deletions: 2 },
{ file: "src/bar.ts", additions: 3, deletions: 1 },
],
},
},
{
id: "msg_a",
type: "assistant",
agent: "build",
model: { id: "model", providerID: "provider" },
content: [{ type: "text", text: "done" }],
time: { created: 2, completed: 3 },
},
] as SessionMessageInfo[]
const normalized = normalizeSessionMessages("ses_1", source)
const messages = new Map(normalized.messages.map((message) => [message.id, message]))
// Inject summary.diffs onto the user message (normalizeSessionMessages
// strips it, but the live store propagates it)
const userMsg = messages.get("msg_u")!
;(userMsg as any).summary = (source[0] as any).summary

const result = Timeline.constructSessionMessageRows(
source,
(messageID) => messages.get(messageID),
(messageID) => normalized.parts.get(messageID) ?? [],
true,
"idle",
true,
normalized.messages.filter((m) => m.role === "user"),
)

// No DiffSummary row should appear — the section is suppressed (#733)
const tags = result.rows.map((r) => r._tag)
expect(tags).not.toContain("DiffSummary")
// The normal rows are still present
expect(tags).toContain("UserMessage")
expect(tags).toContain("AssistantPart")
expect(tags).toContain("ThinkingMeta")
})

test("turnStartedAt is threaded through Thinking and AssistantPart rows from user message time.created", () => {
const source = [
{ id: "msg_u", type: "user", text: "go", time: { created: 1000 } },
Expand Down
14 changes: 4 additions & 10 deletions packages/app/src/pages/session/timeline/rows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { SessionMessageInfo } from "@opencode-ai/client/promise"
import { AssistantMessage, Part, SessionStatus, UserMessage } from "@opencode-ai/sdk/v2"
import { groupParts, renderable, type PartGroup } from "@opencode-ai/session-ui/message-part"
import { TimelineRow, type SummaryDiff } from "./timeline-row"
import { uniqueSummaryDiffs } from "./summary-diffs"
// import { uniqueSummaryDiffs } from "./summary-diffs" // suppressed (harmoniqs/amicode#733)

export { TimelineRow, type SummaryDiff } from "./timeline-row"

Expand Down Expand Up @@ -290,15 +290,9 @@ export namespace Timeline {

if (isActive && status === "retry") rows.push(new TimelineRow.Retry({ userMessageID: userMessage.id }))

const diffs = uniqueSummaryDiffs(userMessage.summary?.diffs)
if (diffs.length > 0 && (status === "idle" || !isActive)) {
rows.push(
new TimelineRow.DiffSummary({
userMessageID: userMessage.id,
diffs,
}),
)
}
// Per-message "Changed files" section suppressed (harmoniqs/amicode#733):
// redundant with the side-panel Files Changed tab, and the unfiltered
// snapshot diff leaks cross-session file changes during concurrent turns.

if (error) {
const data = error.data?.message
Expand Down
Loading