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
5 changes: 5 additions & 0 deletions .changeset/terminal-replay-close-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Use a browser-valid close code when Agent Manager terminal replay exceeds its buffer limit
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ test("orders local terminal status lines through the output batcher", () => {
expect(terminal).not.toContain("term.writeln(")
})

test("uses a browser-valid close code when replay overflows", () => {
expect(terminal).not.toContain("close(1009,")
expect(terminal).toContain('close(4009, "terminal replay exceeded limit")')
})

test("keeps raw PTY line endings and initializes Unicode widths before attaching", () => {
expect(terminal).toContain("convertEol: false")
expect(terminal).toContain('term.unicode.activeVersion = "15-graphemes"')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export const TerminalTab: Component<Props> = (props) => {
if (typeof event.data === "string") {
if (!replay.output(event.data)) {
input.clear()
next.close(1009, "terminal replay exceeded limit")
next.close(4009, "terminal replay exceeded limit")
return
}
scheduleFlush()
Expand All @@ -345,7 +345,7 @@ export const TerminalTab: Component<Props> = (props) => {
if (replay.frame(bytes)) return
if (!replay.output(bytes)) {
input.clear()
next.close(1009, "terminal replay exceeded limit")
next.close(4009, "terminal replay exceeded limit")
return
}
scheduleFlush()
Expand Down
Loading