Skip to content

Commit c813927

Browse files
chore: generate
1 parent 5970c12 commit c813927

3 files changed

Lines changed: 39 additions & 28 deletions

File tree

packages/opencode/src/cli/cmd/run/stream.transport.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,9 @@ function createLayer(input: StreamInput) {
607607
messages(
608608
input.sessionID,
609609
input.replay
610-
? (input.replayLimit === undefined
611-
? undefined
612-
: Math.max(input.replayLimit, SUBAGENT_BOOTSTRAP_LIMIT))
610+
? input.replayLimit === undefined
611+
? undefined
612+
: Math.max(input.replayLimit, SUBAGENT_BOOTSTRAP_LIMIT)
613613
: SUBAGENT_BOOTSTRAP_LIMIT,
614614
),
615615
Effect.promise(() =>
@@ -645,15 +645,16 @@ function createLayer(input: StreamInput) {
645645
limits: input.limits(),
646646
})
647647
: undefined
648-
const replay = history && input.replayLimit !== undefined && messagesList.length > input.replayLimit
649-
? replaySession({
650-
messages: messagesList.slice(-input.replayLimit),
651-
permissions: sessionPermissions,
652-
questions: sessionQuestions,
653-
thinking: input.thinking,
654-
limits: input.limits(),
655-
})
656-
: history
648+
const replay =
649+
history && input.replayLimit !== undefined && messagesList.length > input.replayLimit
650+
? replaySession({
651+
messages: messagesList.slice(-input.replayLimit),
652+
permissions: sessionPermissions,
653+
questions: sessionQuestions,
654+
thinking: input.thinking,
655+
limits: input.limits(),
656+
})
657+
: history
657658

658659
replayedParts.clear()
659660
if (history) {

packages/opencode/test/cli/run/session-replay.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ function runningToolMessage(id: string): SessionMessages[number] {
106106
describe("run session replay", () => {
107107
test("replays persisted user and assistant history into scrollback commits", () => {
108108
const out = replaySession({
109-
messages: [userMessage("msg-user-1", "Hello, whats the weather today?"), assistantMessage("msg-1", "What city or ZIP code should I check?")],
109+
messages: [
110+
userMessage("msg-user-1", "Hello, whats the weather today?"),
111+
assistantMessage("msg-1", "What city or ZIP code should I check?"),
112+
],
110113
permissions: [],
111114
questions: [],
112115
thinking: true,

packages/opencode/test/cli/run/stream.transport.test.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,14 @@ function footer(fn?: (commit: StreamCommit) => void) {
374374
},
375375
}
376376

377-
return { api, commits, events, get idleCalls() { return idleCalls } }
377+
return {
378+
api,
379+
commits,
380+
events,
381+
get idleCalls() {
382+
return idleCalls
383+
},
384+
}
378385
}
379386

380387
function sdk(
@@ -932,27 +939,27 @@ describe("run stream transport", () => {
932939
messages: async ({ sessionID }) => {
933940
if (sessionID === "session-1") {
934941
return ok([
935-
assistantMessage({
936-
sessionID: "session-1",
937-
id: "msg-1",
938-
parts: [
939-
runningTool({
940-
sessionID: "session-1",
941-
messageID: "msg-1",
942-
id: "task-1",
943-
callID: "call-1",
944-
tool: "task",
942+
assistantMessage({
943+
sessionID: "session-1",
944+
id: "msg-1",
945+
parts: [
946+
runningTool({
947+
sessionID: "session-1",
948+
messageID: "msg-1",
949+
id: "task-1",
950+
callID: "call-1",
951+
tool: "task",
945952
body: {
946953
description: "Explore run.ts",
947954
subagent_type: "explore",
948955
},
949956
metadata: {
950957
sessionId: "child-1",
951958
},
952-
}),
953-
],
954-
}),
955-
])
959+
}),
960+
],
961+
}),
962+
])
956963
}
957964

958965
return sessionID === "child-1"

0 commit comments

Comments
 (0)