Skip to content
Closed
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
4 changes: 2 additions & 2 deletions lib/roast/cogs/agent/providers/claude/claude_invocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def run!
raise ClaudeAlreadyStartedError if started?

@started = true
puts "[USER PROMPT] #{@prompt}" if @show_prompt
Event << { block: { header: "USER PROMPT", content: @prompt } } if @show_prompt
Comment thread
LasmarKhalifa marked this conversation as resolved.
_stdout, stderr, status = CommandRunner.execute(
command_line,
working_directory: @working_directory,
Expand All @@ -87,7 +87,7 @@ def run!

if status.success?
@completed = true
puts "[AGENT RESPONSE] #{@result.response}" if @show_response
Event << { block: { header: "AGENT RESPONSE", content: @result.response } } if @show_response
else
@failed = true
@result.success = false
Expand Down
1 change: 1 addition & 0 deletions lib/roast/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def <<(event)
:end,
:stdout,
:stderr,
:block,
].freeze #: Array[Symbol]

#: Array[TaskContext::PathElement]
Expand Down
9 changes: 9 additions & 0 deletions lib/roast/event_monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ def handle_stdout_event(event)
Roast::Log.logger.info { "#{format_path(event)} ❯ #{event[:stdout]}" }
end

#: (Event) -> void
def handle_block_event(event)
block = event[:block]
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

end

#: (Event) -> void
def handle_unknown_event(event)
Roast::Log.logger.unknown(event.inspect)
Expand Down
Loading