Skip to content

[PROTOTYPE] Improve formatting of agent prompt and response outputs#897

Draft
LasmarKhalifa wants to merge 1 commit into
mainfrom
05-26/agent-and-chat-prompts-and-reponses-formatting
Draft

[PROTOTYPE] Improve formatting of agent prompt and response outputs#897
LasmarKhalifa wants to merge 1 commit into
mainfrom
05-26/agent-and-chat-prompts-and-reponses-formatting

Conversation

@LasmarKhalifa
Copy link
Copy Markdown
Contributor

@LasmarKhalifa LasmarKhalifa commented May 26, 2026

Part of the exploration for #896

Prototype for creating a new event type for long multi-line messages and applying it to prompts and response messages for agent cogs.

This is just to demonstrate the functionality and proposed implementation.

Old formatting:
image.png

New formatting:
image.png

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

header = "[#{block[:header]}]"
content = block[:content]
separator = "-" * 40
Roast::Log.logger.info { "#{format_path(event)} ↓\n\n#{header}\n#{separator}\n#{content}\n#{separator}" }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see what it looks like to put the header on the same line as the prefix, and then {separator}\n{content}\n{separator} below.

Also lets consider how it looks with --- separators before and after, as you've done here, vs vvv before and ^^^ after separators

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think it'd be better to remove the extra blank like between the header and the block body, and also try putting header on the first line (with the prefix) instead of after it. I'm curious if that will look cleaner.

Which line the header goes on I feel less strongly about, but I do prefer not having the extra blank line. I think it makes the log output feel unnecessarily disconnected, and actually makes the body of the block look less associated with the header line, and more associated with whatever log line follows it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually tested a few approaches, and I agree that the blank space should be removed. I like number 2 on the list:
image.png

Comment thread lib/roast/cogs/agent/providers/claude/claude_invocation.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants