Class: ClaudeAgentSDK::ConversationResetMessage

Inherits:
Type
  • Object
show all
Defined in:
lib/claude_agent_sdk/types.rb

Overview

Emitted when the session's conversation is replaced without ending the connection — e.g. after /clear or any other flow that discards the transcript mid-session (type: 'conversation_reset').

In streaming-input mode a single connection carries many user turns, and a reset clears the conversation history and zeroes the running totals reported on subsequent ResultMessage objects (e.g. total_cost_usd). If you accumulate those totals across a long-lived session, snapshot them when this message arrives.

Instance Attribute Summary collapse

Method Summary

Methods inherited from Type

#[], #[]=, from_hash, #initialize, #to_h, wrap

Constructor Details

This class inherits a constructor from ClaudeAgentSDK::Type

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ClaudeAgentSDK::Type

Instance Attribute Details

#new_conversation_idString

Opaque identifier for the fresh conversation, for UIs to key an empty transcript on (and to discard any cached session title). This is not the session_id of subsequent messages — read that from the next message.

Returns:

  • (String)


617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

class ConversationResetMessage < Type
  attr_accessor :new_conversation_id, :uuid, :session_id
end

#session_idString

ID of the session that was reset (the outgoing session; messages after the reset carry a new session_id).

Returns:

  • (String)


617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

class ConversationResetMessage < Type
  attr_accessor :new_conversation_id, :uuid, :session_id
end

#uuidString

Unique ID of this message.

Returns:

  • (String)


617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

class ConversationResetMessage < Type
  attr_accessor :new_conversation_id, :uuid, :session_id
end