Skip to content

fix: remove extra blank lines in railway agent REPL output#848

Open
codyde wants to merge 1 commit intomasterfrom
fix/agent-repl-extra-newlines
Open

fix: remove extra blank lines in railway agent REPL output#848
codyde wants to merge 1 commit intomasterfrom
fix/agent-repl-extra-newlines

Conversation

@codyde
Copy link
Copy Markdown
Collaborator

@codyde codyde commented Apr 17, 2026

Summary

  • The railway agent interactive REPL was printing multiple blank lines between user input and the agent's response
  • Root cause: both the thinking spinner setup and the Chunk/ToolCallReady handlers unconditionally emitted println!(), so each finish_and_clear (which already leaves the cursor on an empty line) was followed by another newline — stacking 2+ blank lines per turn, more when tool calls ran first
  • Dropped the unconditional println!() before the initial spinner in both run_single_shot and run_repl, and made the println!() inside the Chunk and ToolCallReady handlers conditional on whether a spinner was just cleared

Before

> You: Yes confirmed




Railway Agent: Done. All 3 services have been marked for removal:

After

> You: Yes confirmed
Railway Agent: Done. All 3 services have been marked for removal:

Test plan

  • cargo check passes
  • Run railway agent and confirm no extra blank lines between > You: and Railway Agent:
  • Confirm tool-call spinners still render correctly and don't get overwritten by subsequent output
  • Confirm single-shot mode (railway agent -p "...") still renders cleanly

🤖 Generated with Claude Code

The thinking spinner and the Chunk/ToolCallReady handlers were each
unconditionally emitting a `println!()`, stacking multiple blank lines
between user input and the agent's response. Drop the unconditional
newline before the initial spinner, and only emit a leading newline in
the Chunk/ToolCallReady handlers when a spinner wasn't just cleared
(since `finish_and_clear` already leaves the cursor on a blank line).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codyde codyde added the release/patch Author patch release label Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/patch Author patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant