Class: HermesAgent::Client::Entities::ChatToolProgress

Inherits:
HermesAgent::Client::Entity show all
Defined in:
lib/hermes_agent/client/entities/chat_completion.rb

Overview

A custom hermes.tool.progress event emitted on the chat-completions stream while the server agent executes a tool. It is a distinct event type from ChatCompletionChunk — it carries no choices/delta and is never folded into the assembled ChatCompletion — so tool activity does not pollute the assistant text. The Responses API does not emit these (it represents tool activity as function_call output items instead).

Each tool call produces two events keyed by #tool_call_id: a "running" event carrying #emoji and #label, then a "completed" event that omits them. status is a lifecycle marker only — a tool that fails (or times out) still reports "completed"; the failure surfaces in the tool's result, not here.

Instance Method Summary collapse

Methods inherited from HermesAgent::Client::Entity

#==, #[], #eql?, #hash, #to_h

Instance Method Details

#completed?boolean

Whether this event marks the tool finishing execution. Note this is a lifecycle marker, not a success signal — see the class docs.

Returns:

  • (boolean)


261
262
263
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 261

def completed?
  status == "completed"
end

#emojiString?

A decorative emoji for the tool, present on the "running" event.

Returns:

  • (String, nil)


217
218
219
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 217

def emoji
  self["emoji"]
end

#labelString?

A short human-facing descriptor of the invocation (e.g. the search glob "*", or the command "ls -F"), present on the "running" event.

Returns:

  • (String, nil)


227
228
229
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 227

def label
  self["label"]
end

#running?boolean

Whether this event marks the tool starting to run.

Returns:

  • (boolean)


252
253
254
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 252

def running?
  status == "running"
end

#statusString?

The lifecycle status, "running" or "completed".

Returns:

  • (String, nil)


244
245
246
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 244

def status
  self["status"]
end

#toolString?

The tool name, e.g. "search_files" or "terminal".

Returns:

  • (String, nil)


209
210
211
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 209

def tool
  self["tool"]
end

#tool_call_idString?

The id correlating this event's "running" and "completed" frames (read from the camelCase toolCallId wire field), e.g. "call_…".

Returns:

  • (String, nil)


236
237
238
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 236

def tool_call_id
  self["toolCallId"]
end