agent-harness 0.19.0 → 0.20.0

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: 35805e09786006c623325c10d579dc95c8be7863536ae52b0440332403f108da
4
- data.tar.gz: 162638a405a7b1cfadbd5d03396cd898142ecf4fa57a9d811726644c0329e485
3
+ metadata.gz: f7d3dd9864119fc75abc2a4c7eebf2f2d6bf9239b6d02313fd63d15712074d5c
4
+ data.tar.gz: 9c8ac795a33027da1981fe170334a7456685c8f1f494d42680cc1e8c29f5cce9
5
5
  SHA512:
6
- metadata.gz: b624b8380ae5d7e0759be8ef02b1affafff2180773172e4cd7d9d715678570d6e04d1090ffad50461c5d9a8500f756191a0c7705df042603d02d359dc45ac8e6
7
- data.tar.gz: 8c8de046b361f532a701d5121550fe41ce47b4f9bab3799b5754dfb7db01803a42e3f898782af8dfdf2e7b5d783f9981e42ddd95db7d3ccf3775a70e74272cf6
6
+ metadata.gz: 446d1544846e9047c1cdd06f1d08ce50d4567fed6436efbdd4b3fcbfd6404c8203acdf508db2f3e2be3f04feb2cc6f54ff55c90f51f10edb27f413812c8a5c04
7
+ data.tar.gz: 0a0aed2a47548fce2007cca6aa351c2f675581d7340bb25853b3b306d622575a722be294c9e51be2c15e22b3d545d4106d179c562d98a61ad94a8d840fc4b9f5
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.19.0"
2
+ ".": "0.20.0"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.20.0](https://github.com/viamin/agent-harness/compare/agent-harness/v0.19.0...agent-harness/v0.20.0) (2026-05-30)
4
+
5
+
6
+ ### Features
7
+
8
+ * suppress Claude CLI .mcp.json auto-discovery when no MCP servers configured ([e07a25e](https://github.com/viamin/agent-harness/commit/e07a25e463becfd77da97058cb0a760eaec0920b))
9
+
3
10
  ## [0.19.0](https://github.com/viamin/agent-harness/compare/agent-harness/v0.18.2...agent-harness/v0.19.0) (2026-05-29)
4
11
 
5
12
 
@@ -183,7 +183,12 @@ module AgentHarness
183
183
  def parse_cli_json_envelope(json_string)
184
184
  return nil if json_string.nil? || json_string.empty?
185
185
 
186
- parsed = JSON.parse(json_string)
186
+ cleaned = json_string.lines.reject { |line|
187
+ line.include?('"type":"session.') || line.include?('"type": "session.')
188
+ }.join.strip
189
+ return nil if cleaned.empty?
190
+
191
+ parsed = JSON.parse(cleaned)
187
192
  return nil unless parsed.is_a?(Hash) && parsed.key?("result")
188
193
 
189
194
  output = parsed["result"]
@@ -415,8 +420,6 @@ module AgentHarness
415
420
  end
416
421
 
417
422
  def build_mcp_flags(mcp_servers, working_dir: nil)
418
- return [] if mcp_servers.empty?
419
-
420
423
  config_path = write_mcp_config_file(mcp_servers, working_dir: working_dir)
421
424
  ["--mcp-config", config_path]
422
425
  end
@@ -601,10 +604,10 @@ module AgentHarness
601
604
  cmd += dangerous_mode_flags
602
605
  end
603
606
 
604
- # Add MCP server flags (validated/normalized by Base#send_message)
605
- if options[:mcp_servers]&.any?
606
- cmd += build_mcp_flags(options[:mcp_servers])
607
- end
607
+ # Add MCP server flags (validated/normalized by Base#send_message).
608
+ # Always pass --mcp-config, even with an empty server list, to suppress
609
+ # the Claude CLI's auto-discovery of .mcp.json in the working directory.
610
+ cmd += build_mcp_flags(options[:mcp_servers] || [])
608
611
 
609
612
  # Add custom flags from config
610
613
  cmd += @config.default_flags if @config.default_flags&.any?
@@ -720,11 +723,20 @@ module AgentHarness
720
723
  def parse_json_output(output)
721
724
  return nil if output.nil? || output.empty?
722
725
 
723
- JSON.parse(output)
726
+ cleaned = strip_claude_streaming_events(output)
727
+ return nil if cleaned.empty?
728
+
729
+ JSON.parse(cleaned)
724
730
  rescue JSON::ParserError
725
731
  nil
726
732
  end
727
733
 
734
+ def strip_claude_streaming_events(output)
735
+ output.lines.reject { |line|
736
+ line.include?('"type":"session.') || line.include?('"type": "session.')
737
+ }.join.strip
738
+ end
739
+
728
740
  # Delegate to class-level implementations so both instance and class
729
741
  # methods share a single definition.
730
742
  def extract_envelope_metadata(parsed)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AgentHarness
4
- VERSION = "0.19.0"
4
+ VERSION = "0.20.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agent-harness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Agapinan