Skip to content

A self-improving RLM agent for coding workflows and long-running autonomous tasks.

Rust

fix: /btw now shows full answer instead of truncating (#510)

Ilija Lichkovski9c8656f31750
diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md
index 83d2a96589..d26e46c7fe 100644
--- a/packages/coding-agent/CHANGELOG.md
+++ b/packages/coding-agent/CHANGELOG.md
@@ -2,6 +2,7 @@
## [Unreleased]
+- Fixed `/btw` truncating long answers by rendering side questions in the scrollable transcript.
- Changed selection cursors from `→` to `›` across model selectors, scoped-models, and the theme default for consistency with tree and user-message selectors.
- Changed the queued follow-up hint connector from `↳` to `╰─` to match the tool-execution continuation connector.
- Changed `/context` tree connectors from `├ `/`└ ` to `├─ `/`└─ ` to match the tree selector and session picker.
diff --git a/packages/coding-agent/src/modes/interactive/components/side-question.ts b/packages/coding-agent/src/modes/interactive/components/side-question.ts
index f4487c00f3..519456a82b 100644
--- a/packages/coding-agent/src/modes/interactive/components/side-question.ts
+++ b/packages/coding-agent/src/modes/interactive/components/side-question.ts
@@ -7,11 +7,7 @@ export class SideQuestionComponent implements Component {
private readonly answer: Markdown;
private event: AgentConnectionSideQuestionEvent;
- constructor(
- event: AgentConnectionSideQuestionEvent,
- private readonly getMaxLines: () => number,
- paddingX = 2,
- ) {
+ constructor(event: AgentConnectionSideQuestionEvent, paddingX = 2) {
this.event = event;
this.paddingX = Math.max(2, paddingX);
this.answer = new Markdown("", this.paddingX, 0, getMarkdownTheme(), {
@@ -37,12 +33,7 @@ export class SideQuestionComponent implements Component {
0,
).render(width);
const lines = [blank, ...question, blank, ...this.renderAnswer(width), blank];
- const maxLines = Math.max(6, this.getMaxLines());
- if (lines.length <= maxLines) {
- return lines.map((line) => this.applySurface(line, width));
- }
- const ellipsis = new Text(theme.fg("dim", "…"), this.paddingX, 0).render(width)[0] ?? blank;
- return [...lines.slice(0, maxLines - 1), ellipsis].map((line) => this.applySurface(line, width));
+ return lines.map((line) => this.applySurface(line, width));
}
private renderAnswer(width: number): string[] {
diff --git a/packages/coding-agent/src/modes/interactive/interactive-mode.ts b/packages/coding-agent/src/modes/interactive/interactive-mode.ts
index f7bb2f7e10..7327da314b 100644
--- a/packages/coding-agent/src/modes/interactive/interactive-mode.ts
+++ b/packages/coding-agent/src/modes/interactive/interactive-mode.ts
@@ -1353,7 +1353,6 @@ export class InteractiveMode {
this.mainContainer.addChild(this.widgetContainerBelow);
this.footerSlot.addChild(this.footer);
this.mainContainer.addChild(this.footerSlot);
- this.promptDock.addChild(this.sideQuestionContainer);
this.promptDock.addChild(this.featureHintContainer);
this.promptDock.addChild(this.editorContainer);
this.promptDock.addChild(this.childAgentSummary);
@@ -4142,11 +4141,7 @@ export class InteractiveMode {
};
this.activeSideQuestionId = event.id;
this.sideQuestionEvent = event;
- this.sideQuestionComponent = new SideQuestionComponent(
- event,
- () => this.getSideQuestionMaxLines(),
- this.settingsManager.getEditorPaddingX(),
- );
+ this.sideQuestionComponent = new SideQuestionComponent(event, this.settingsManager.getEditorPaddingX());
this.sideQuestionContainer.addChild(new Spacer(1));
this.sideQuestionContainer.addChild(this.sideQuestionComponent);
this.ui.requestRender();
@@ -4218,10 +4213,6 @@ export class InteractiveMode {
void this.flushCompactionQueue({ willRetry: false });
}
- private getSideQuestionMaxLines(): number {
- return Math.max(6, Math.min(12, Math.floor(this.ui.terminal.rows * 0.3)));
- }
-
private setupEditorSubmitHandler(): void {
this.defaultEditor.onSubmit = async (text: string) => {
text = text.trim();
@@ -6615,6 +6606,7 @@ export class InteractiveMode {
this.widgetContainerAbove,
this.recapContainer,
this.queuedMessagesContainer,
+ this.sideQuestionContainer,
this.widgetContainerBelow,
],
dock: this.promptDock,
diff --git a/packages/coding-agent/test/suite/regressions/4509-side-questions.test.ts b/packages/coding-agent/test/suite/regressions/4509-side-questions.test.ts
index 4053d9f280..e49c8ca6f1 100644
--- a/packages/coding-agent/test/suite/regressions/4509-side-questions.test.ts
+++ b/packages/coding-agent/test/suite/regressions/4509-side-questions.test.ts
@@ -214,39 +214,34 @@ describe("ENG-4509 side questions", () => {
expect(hasActiveSideQuestionFor.call(fakeThis, otherClient, "session-1")).toBe(false);
});
- it("renders a bounded one-turn panel above the prompt", () => {
- const component = new SideQuestionComponent(
- {
- id: "question-4",
- question: "What changed?",
- answer: "First line\n\nSecond line\n\nThird line\n\nFourth line",
- status: "complete",
- },
- () => 8,
- );
+ it("renders the complete side-question answer", () => {
+ const component = new SideQuestionComponent({
+ id: "question-4",
+ question: "What changed?",
+ answer: "First line\n\nSecond line\n\nThird line\n\nFourth line",
+ status: "complete",
+ });
const lines = component.render(40);
const rendered = stripAnsi(lines.join("\n"));
const blankPopupLine = theme.getPopupBackgroundColor()(" ".repeat(40));
- expect(lines).toHaveLength(8);
expect(lines.every((line) => line.includes("\x1b[48"))).toBe(true);
expect(lines[0]).toBe(blankPopupLine);
expect(getEditorTheme().autocompleteBackgroundColor?.(" ".repeat(40))).toBe(blankPopupLine);
expect(rendered).toContain(" /btw What changed?");
expect(rendered).not.toContain(" answer");
expect(rendered).toContain("First line");
- expect(rendered).toContain("…");
+ expect(rendered).toContain("Fourth line");
+ expect(rendered).not.toContain("…");
});
it("aligns the thinking placeholder with the streamed response", () => {
const running = new SideQuestionComponent(
{ id: "question-5", question: "Still running?", answer: "", status: "running" },
- () => 8,
4,
);
const complete = new SideQuestionComponent(
{ id: "question-5", question: "Still running?", answer: "Aligned response", status: "complete" },
- () => 8,
4,
);
const runningLines = running.render(40).map(stripAnsi);
@@ -260,10 +255,12 @@ describe("ENG-4509 side questions", () => {
});
it("uses the user-message foreground for pane content", () => {
- const component = new SideQuestionComponent(
- { id: "question-5", question: "Readable question", answer: "Readable response", status: "complete" },
- () => 8,
- );
+ const component = new SideQuestionComponent({
+ id: "question-5",
+ question: "Readable question",
+ answer: "Readable response",
+ status: "complete",
+ });
const rendered = component.render(40).join("\n");
expect(rendered).toContain("\x1b[39mReadable question\x1b[39m");
@@ -271,10 +268,12 @@ describe("ENG-4509 side questions", () => {
});
it("keeps streamed text when a side question is cancelled", () => {
- const component = new SideQuestionComponent(
- { id: "question-5", question: "Partial?", answer: "Useful partial response", status: "cancelled" },
- () => 8,
- );
+ const component = new SideQuestionComponent({
+ id: "question-5",
+ question: "Partial?",
+ answer: "Useful partial response",
+ status: "cancelled",
+ });
const rendered = stripAnsi(component.render(40).join("\n"));
expect(rendered).toContain("Useful partial response");