Skip to content
Closed
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 packages/opencode/src/session/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,14 @@ NOTE: At any point in time through this workflow you should feel free to ask the
lastAssistant?.finish &&
!["tool-calls"].includes(lastAssistant.finish) &&
!hasToolCalls &&
lastUser.id < lastAssistant.id
(
// Use parentID to determine if assistant message is a response to the last user message.
// This is more reliable than timestamp comparison when client/server clocks are out of sync.
lastAssistant.parentID === lastUser.id ||
// Fallback to timestamp comparison for backward compatibility with messages
// that may not have parentID set.
(!lastAssistant.parentID && lastUser.id < lastAssistant.id)
)
) {
log.info("exiting loop", { sessionID })
break
Expand Down
Loading