active_harness 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78572139b0f913adcfd708045581ad90989413a1a31535af37b723a7919c407b
4
- data.tar.gz: 0b04931f1fec80dfd30e6f642b594ab7b1a26ba07a4722a7af79b44b48301e15
3
+ metadata.gz: 01f74d69e91e8afbc6073f9095152f43f9e942db987357bcb912d6662eaf6423
4
+ data.tar.gz: e984545ee51b3fd4f9b2d98f09c767e35a81a137324b6c867366220207e2bce5
5
5
  SHA512:
6
- metadata.gz: 79a7c9b4d7e803e5565cad3e3148c123ec5c28dff5cd09340ca613b1e69ed7a1523d737d9d7bff2acf01e08c4c827f489f5f4442d00b7925ade2a5be9ea0100f
7
- data.tar.gz: 98a0c42415e8538d82f50579abd7720585da3bf990e59f53d49f5ab95fb93e7cff9a8dc0614d709a067028d1a77d9b57cd6aa5ce3fb89054d5ab79f4bd2bf2c8
6
+ metadata.gz: 4b505afe51d47e4567df0fb0114c12c30ff838193cc958ae7ca10f94d466949295e86b296ea3d7681a6d616f3c358f3f3f738bd9e3b5707104130bb48933d674
7
+ data.tar.gz: 8f9d550df43a425e424b0144bcb38bd2be89da9b56b554926561155dc2f973e084dd0408c590c1a98543c0d6ea9e79b13347c3cc746942adc651868df311e2dc
@@ -12,7 +12,7 @@ module ActiveHarness
12
12
  # SupportAgent.call(input: "Hi", context: { user_id: 42 })
13
13
  # SupportAgent.call(input: "Hi", memory: memory)
14
14
  def call(input: nil, context: {}, models: nil, memory: nil, stream: nil)
15
- new(input: input, context: context, models: models, memory: memory, stream: stream).call
15
+ new(input: input, context: context, models: models, memory: memory, stream: stream).call.result
16
16
  end
17
17
 
18
18
  # Each subclass gets its own isolated config hash.
@@ -195,7 +195,13 @@ module ActiveHarness
195
195
  private
196
196
 
197
197
  def execute_step(step)
198
- step.agent_class.new(input: @payload, context: @context.dup).call
198
+ agent = step.agent_class.new(input: @payload, context: @context.dup)
199
+ if agent.is_a?(ActiveHarness::Agent)
200
+ agent.call.result
201
+ else
202
+ # Tribunal — call returns self, expose via .itself
203
+ agent.call
204
+ end
199
205
  end
200
206
 
201
207
  # Global hook: receives (step_name, data)
@@ -159,8 +159,10 @@ module ActiveHarness
159
159
  @agent_execution_times << { agent: agents[index].class.name, time: elapsed }
160
160
 
161
161
  if future.fulfilled?
162
- @results << future.value
163
- run_hook(:after_agent, future.value)
162
+ value = future.value
163
+ result = value.is_a?(ActiveHarness::Agent) ? value.result : value
164
+ @results << result
165
+ run_hook(:after_agent, result)
164
166
  elsif future.incomplete?
165
167
  error = Errors::TimeoutError.new(
166
168
  "Agent #{agents[index].class.name} timed out after #{@timeout}s"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_harness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - the-teacher