agent-harness 0.27.1 → 0.28.1

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: cae5c20bd0047cb01bf085ab6e95c45d28babe8677b8d856278ee70b77dfc25e
4
- data.tar.gz: 22b995dddfcc08113d8b166b3c4da29c3905b4a85181471b04de47d250117a11
3
+ metadata.gz: 7b96455925e7c106c8209663155c2a03e424119a29da0b5a646d3e4ccafc49e5
4
+ data.tar.gz: 86ccd871badbfa21eec7f42f948c9756f7651b0619a5cb2f1cbc2766c0ae5ee7
5
5
  SHA512:
6
- metadata.gz: 1a78a7660c05a7c7834ae2886e8fb9da56be91ef63df184ab6e194707e318d9fd42dcb9465dc3cad7d2592b80d8a69800cbd28db230e588376ecdae3730f00b9
7
- data.tar.gz: c17db980977b5f6a00a8ad23c34df259503721ec93f7c03425930f0b6b896f55bd91bf1e36e01c5e6b889eaf4e5a35a7dc92a44b6e0db9f277ae70099fa30100
6
+ metadata.gz: 03b0f75fb46ab71d2602230e86add7e3ab7d00da531dc94264e544077c197ec5df85f113edad09213a8b9683caf156141566f8e3ff6ffd98ddb7c5ff8815a746
7
+ data.tar.gz: 32df3df874d30e2ef7e072b4c55042766c3ac0bb3a64d77460c084d3e848ce598004be166f114c9c7cbc451b4b7390177110866a2a981661f3ce8abb5d58d2d8
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.27.1"
2
+ ".": "0.28.1"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -6,6 +6,20 @@
6
6
  * **auth:** add provider-owned PKCE code-exchange API for Claude OAuth (`AgentHarness::Authentication.exchange_code`). Takes an authorization code plus PKCE verifier (and `redirect_uri`/`client_id`), posts an `authorization_code` grant to the Claude token endpoint, and persists the resulting access/refresh tokens in the native `claudeAiOauth` shape. Adds `exchange_code_supported?` and a `code_exchange` key to `auth_capabilities` ([#266](https://github.com/viamin/agent-harness/issues/266)).
7
7
 
8
8
 
9
+ ## [0.28.1](https://github.com/viamin/agent-harness/compare/agent-harness/v0.28.0...agent-harness/v0.28.1) (2026-07-08)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **opencode:** default-merge permissive external_directory permission for non-interactive runs ([#280](https://github.com/viamin/agent-harness/issues/280)) ([1a282aa](https://github.com/viamin/agent-harness/commit/1a282aad6de0e696a9fcd02ebc0be32f1ef6e0e9)), closes [#277](https://github.com/viamin/agent-harness/issues/277)
15
+
16
+ ## [0.28.0](https://github.com/viamin/agent-harness/compare/agent-harness/v0.27.1...agent-harness/v0.28.0) (2026-07-08)
17
+
18
+
19
+ ### Features
20
+
21
+ * allow OpenCode tmp scratch access ([#278](https://github.com/viamin/agent-harness/issues/278)) ([886437f](https://github.com/viamin/agent-harness/commit/886437f6d8429a487d043eb2242cb3f60ab604f6))
22
+
9
23
  ## [0.27.1](https://github.com/viamin/agent-harness/compare/agent-harness/v0.27.0...agent-harness/v0.27.1) (2026-07-07)
10
24
 
11
25
 
@@ -13,6 +13,11 @@ module AgentHarness
13
13
  SUPPORTED_CLI_VERSION = "1.3.2"
14
14
  SUPPORTED_CLI_REQUIREMENT = Gem::Requirement.new(">= #{SUPPORTED_CLI_VERSION}", "< 1.4.0").freeze
15
15
  INSTALL_COMMAND_PREFIX = ["npm", "install", "-g", "--ignore-scripts"].freeze
16
+ DEFAULT_PERMISSION_CONFIG = {
17
+ "external_directory" => {
18
+ "/tmp/**" => "allow"
19
+ }
20
+ }.freeze
16
21
  SUPPORTED_CLI_VERSIONS = [SUPPORTED_CLI_VERSION].freeze
17
22
  POSTINSTALL_COMMAND = "node $(npm root -g)/opencode-ai/postinstall.mjs"
18
23
  VERSION_REQUIREMENT_STRINGS = SUPPORTED_CLI_REQUIREMENT.requirements
@@ -123,6 +128,19 @@ module AgentHarness
123
128
 
124
129
  DEFAULT_INSTALLATION_CONTRACT = build_installation_contract(SUPPORTED_CLI_VERSION)
125
130
 
131
+ # OpenCode's stock default only allowlists `external_directory` access to
132
+ # `/tmp/opencode/*`, but its own sub-agent delegation pattern (e.g. the
133
+ # Explore-Agent used to summarize large diffs/outputs) writes scratch
134
+ # files to other `/tmp/*` paths. In non-interactive execution there is no
135
+ # human to approve the resulting permission prompt, so the agent silently
136
+ # loses access to its own scratch output and never completes the task.
137
+ # This default rule broadens the allowlist to all of `/tmp` so the agent
138
+ # can read back files it (or its sub-agents) wrote there.
139
+ DEFAULT_PERMISSION_EXTERNAL_DIRECTORY_PATTERN = "/tmp/**"
140
+ DEFAULT_PERMISSION_RULE = {
141
+ "external_directory" => {DEFAULT_PERMISSION_EXTERNAL_DIRECTORY_PATTERN => "allow"}
142
+ }.freeze
143
+
126
144
  def name
127
145
  "opencode"
128
146
  end
@@ -256,12 +274,22 @@ module AgentHarness
256
274
  end
257
275
 
258
276
  payload = stringify_keys(config_extras)
277
+ payload["permission"] ||= DEFAULT_PERMISSION_CONFIG
259
278
  payload["model"] = runtime.model if runtime.model
260
279
  payload["provider"] = runtime.api_provider if runtime.api_provider
261
280
  payload["baseURL"] = runtime.base_url if runtime.base_url
281
+ apply_default_external_directory_permission(payload)
262
282
  payload.empty? ? nil : payload
263
283
  end
264
284
 
285
+ def apply_default_external_directory_permission(payload)
286
+ # Respect any caller-supplied `permission` block verbatim: if a caller
287
+ # takes responsibility for permission config, we do not override it.
288
+ return if payload.key?("permission")
289
+
290
+ payload["permission"] = deep_dup(DEFAULT_PERMISSION_RULE)
291
+ end
292
+
265
293
  def opencode_config_path(_runtime)
266
294
  "~/.config/opencode/opencode.json"
267
295
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AgentHarness
4
- VERSION = "0.27.1"
4
+ VERSION = "0.28.1"
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.27.1
4
+ version: 0.28.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Agapinan