The Open Framework for Building Agents
fix(eve): preserve setup panel rows for multiline output (#1496)
OwenKephartee50ae79fd05
diff --git a/.changeset/fix-tui-multiline-flow-output.md b/.changeset/fix-tui-multiline-flow-output.mdnew file mode 100644index 000000000..c83cc21a5--- /dev/null+++ b/.changeset/fix-tui-multiline-flow-output.md@@ -0,0 +1,5 @@+---+"eve": patch+---++Prevent the dev TUI from duplicating setup panels when an integration setup error includes multiline command output.diff --git a/packages/eve/src/cli/dev/tui/setup-panel.test.ts b/packages/eve/src/cli/dev/tui/setup-panel.test.tsindex bea8e48a5..75a7d31e1 100644--- a/packages/eve/src/cli/dev/tui/setup-panel.test.ts+++ b/packages/eve/src/cli/dev/tui/setup-panel.test.ts@@ -47,6 +47,27 @@ describe("renderFlowPanel", () => {expect(text).toContain(" ▷ Create a new project");});+ it("renders multiline diagnostics as separate terminal rows", () => {+ const rows = renderFlowPanel(+ {+ title: "Add to your agent",+ lines: [+ {+ text: "Linear connector creation failed:\nError: connector already exists.",+ tone: "error",+ },+ ],+ content: { kind: "idle", indicator: { glyph: "▪", color: "green" } },+ },+ theme,+ 60,+ );++ expect(rows).toContain(" ⨯ Linear connector creation failed:");+ expect(rows).toContain(" Error: connector already exists.");+ expect(rows.every((row) => !row.includes("\n"))).toBe(true);+ });+it("keeps only the freshest progress lines in view", () => {const lines = Array.from({ length: 10 }, (_, index) => ({text: `step ${index}`,diff --git a/packages/eve/src/cli/dev/tui/setup-panel.ts b/packages/eve/src/cli/dev/tui/setup-panel.tsindex 4cbfe5fe9..55f165b32 100644--- a/packages/eve/src/cli/dev/tui/setup-panel.ts+++ b/packages/eve/src/cli/dev/tui/setup-panel.ts@@ -307,8 +307,12 @@ export function renderFlowPanel(state: FlowPanelState, theme: Theme, width: numbconst recent = state.lines.slice(-FLOW_PANEL_LINE_CAP);for (const line of recent) {- const body = line.tone === "info" ? c.dim(line.text) : line.text;- rows.push(` ${toneGlyph(line.tone, theme)} ${body}`);+ const text = line.text.split("\n");+ for (const [index, part] of text.entries()) {+ const body = line.tone === "info" ? c.dim(part) : part;+ const prefix = index === 0 ? `${toneGlyph(line.tone, theme)} ` : " ";+ rows.push(` ${prefix}${body}`);+ }}if (recent.length > 0) {rows.push("");@@ -325,14 +329,17 @@ export function renderFlowPanel(state: FlowPanelState, theme: Theme, width: numbcase "status":rows.push(` ${renderFlowPanelStatus(state.content.status, theme)}`);if (state.content.preview !== undefined) {- rows.push(` ${c.dim(state.content.preview)}`);+ for (const line of state.content.preview.split("\n")) {+ rows.push(` ${c.dim(line)}`);+ }}break;- case "preview":- rows.push(- ` ${renderIndicator(state.content.indicator, theme)} ${c.dim(state.content.text)}`,- );+ case "preview": {+ const [first, ...rest] = state.content.text.split("\n");+ rows.push(` ${renderIndicator(state.content.indicator, theme)} ${c.dim(first ?? "")}`);+ for (const line of rest) rows.push(` ${c.dim(line)}`);break;+ }case "idle":// A flow between phases must never look dead: boxes run subprocesses// without narrating every gap, so the panel keeps a live pulse.