class LittleGhost::Harnesses::State
Mutable progress that a harness parser records while reading one run’s output. Base#run creates one State per run and passes it to Base#parse_line and Base#finalize; it is not shared across threads.
Attributes
Reported spend in US dollars.
Count of output lines that were not JSON objects.
Model reported by the tool.
Session identifier reported by the tool.
Result status reported by the tool, overriding the exit code.
The tool’s own reason for stopping.
The tool’s latest or final answer text.
Completed agent turns.
Accumulated token counts as a LittleGhost::Usage.
Parser-specific scratch values.
Public Class Methods
Source
# File lib/little_ghost/harnesses/state.rb, line 29 def initialize @usage = Usage.new @malformed_lines = 0 @values = {} end
Builds empty progress.
Public Instance Methods
Source
# File lib/little_ghost/harnesses/state.rb, line 39 def add_usage(**counts) self.usage += Usage.new(**counts) end
Adds token counts to usage.