Commit 09632e2

mo khan <mo@mokhan.ca>
2026-01-19 19:35:08
refactor: pass history into ctor
1 parent cc79b77
Changed files (1)
lib
elelem
lib/elelem/agent.rb
@@ -6,11 +6,11 @@ module Elelem
 
     attr_reader :history, :client, :toolbox, :terminal
 
-    def initialize(client, toolbox, terminal: nil)
+    def initialize(client, toolbox, terminal: nil, history: nil)
       @client = client
       @toolbox = toolbox
-      @history = [{ role: "system", content: system_prompt }]
       @terminal = terminal || Terminal.new(commands: COMMANDS)
+      @history = history || [{ role: "system", content: system_prompt }]
     end
 
     def repl