agent-harness 0.44.35 → 0.44.36

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: 48897ed20c271e9c5876aa30b232a566c861f181ceb158ab099749b6a6b8db47
4
- data.tar.gz: d473aa1584e325300a465bc9334e46bce7bfe7c6d1272d8ea4e34254036c0e1b
3
+ metadata.gz: d9fa7b1b1f50ed6bc3e6b5b8f67dd32cfe992f9a06e1efc8cc4384c0a70aaca3
4
+ data.tar.gz: a0df36d162838add4080640c0599ddb84e5b1f82c467b7c1d1697147e2a9e389
5
5
  SHA512:
6
- metadata.gz: d2c2aa1541562cd5e15b5d8247820ff23957a040c0f87ac4961d050f4608f0b2ad49310502def8ba412576120f38416a1bce5e139fa1506a5bbdfd16ddd3c2b3
7
- data.tar.gz: aa561cc163f165956da6735372b6d02abb99eeb99864f84d07ef0257e8393ff5f440f946070f512f34df00019ea874835dac0de06fb631aafbfb66935ef82c76
6
+ metadata.gz: 9d638e54cf04c76a7a50345fc3b638ea7ee10e53a59d57ab57b930ed79904aee41c6a61b97f8c31deff02bdab96bda7f69befa8f22a8601404be83029203121f
7
+ data.tar.gz: 4e6aead54aed76460a06b0d1972e2914a9bf548997fe2d3ba2f4ecfdcccb0a504a7a796c930725443debb9ef366e98067877569e9b678d6818cb16f38e64c4e9
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.44.35"
2
+ ".": "0.44.36"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -12,6 +12,13 @@
12
12
 
13
13
  * close the RDR-072 upstream epic from #437's retained-scope evidence while keeping unpublished capabilities and downstream adoption behind their explicit release and integration gates ([#430](https://github.com/viamin/agent-harness/issues/430)).
14
14
 
15
+ ## [0.44.36](https://github.com/viamin/agent-harness/compare/agent-harness/v0.44.35...agent-harness/v0.44.36) (2026-11-14)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **codex:** make isolated API-key text requests usable when Responses WebSocket fails ([#538](https://github.com/viamin/agent-harness/issues/538)) ([02a6d7b](https://github.com/viamin/agent-harness/commit/02a6d7bcb5de81902981edd932545cd25298a8bd))
21
+
15
22
  ## [0.44.35](https://github.com/viamin/agent-harness/compare/agent-harness/v0.44.34...agent-harness/v0.44.35) (2026-11-08)
16
23
 
17
24
 
data/README.md CHANGED
@@ -155,6 +155,20 @@ AGENT_HARNESS_LIVE_OPENAI=1 OPENAI_API_KEY=... \
155
155
 
156
156
  ## Configuration
157
157
 
158
+ ### Codex API-key text transport
159
+
160
+ Codex API-key requests made with `mode: :text` automatically use an
161
+ agent-harness-owned OpenAI Responses provider with WebSockets disabled. This
162
+ makes disposable or externally sandboxed text runners use HTTPS immediately
163
+ when their environment cannot establish the Responses WebSocket. The selected
164
+ `OPENAI_API_KEY`, model, base URL, timeout, response text, and token accounting
165
+ are preserved; callers do not need to add Codex flags or parse CLI output.
166
+
167
+ The override is request-scoped and does not change normal Codex agent requests
168
+ or subscription-authenticated sessions. `provider_runtime.base_url` (or
169
+ `OPENAI_BASE_URL`) is copied into the HTTPS provider when present. Callers that
170
+ need Codex's default WebSocket behavior should omit `mode: :text`.
171
+
158
172
  ### Ruby DSL
159
173
 
160
174
  ```ruby
@@ -41,6 +41,8 @@ module AgentHarness
41
41
  MODEL_REJECTION_CACHE_TTL = 300
42
42
  MODEL_REJECTION_CACHE_LIMIT = 128
43
43
  MODEL_REJECTION_CACHE = {}
44
+ HTTP_RESPONSES_PROVIDER = "agent_harness_openai_http"
45
+ DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1"
44
46
  MODEL_REJECTION_PATTERNS = [
45
47
  /The ['"](?<model>[^'"]+)['"] model is not supported when using Codex with a ChatGPT account/i,
46
48
  /model ['"](?<model>[^'"]+)['"] is not supported.*ChatGPT account/i
@@ -142,6 +144,7 @@ module AgentHarness
142
144
  transient_error: [
143
145
  /timeout/i,
144
146
  /connection.*error/i,
147
+ /responses_websocket.*failed to connect/i,
145
148
  /service.*unavailable/i,
146
149
  /\b503\b/,
147
150
  /\b502\b/,
@@ -782,6 +785,7 @@ module AgentHarness
782
785
  end
783
786
 
784
787
  def send_message(prompt:, **options)
788
+ options = options.merge(force_http_responses: true) if options[:mode] == :text
785
789
  super
786
790
  ensure
787
791
  cleanup_mcp_tempfiles!
@@ -851,7 +855,8 @@ module AgentHarness
851
855
  /failed to refresh token\b.*(?:timeout|timed.?out)/im
852
856
  ],
853
857
  transient: COMMON_ERROR_PATTERNS[:transient] + [
854
- /connection.*reset/i
858
+ /connection.*reset/i,
859
+ /responses_websocket.*failed to connect/i
855
860
  ] + OAUTH_REFRESH_TRANSIENT_PATTERNS,
856
861
  auth_expired: COMMON_ERROR_PATTERNS[:auth_expired] + [
857
862
  /\b401\b/,
@@ -1075,6 +1080,10 @@ module AgentHarness
1075
1080
  cmd += runtime_flags unless runtime_flags.empty?
1076
1081
  end
1077
1082
 
1083
+ if options[:force_http_responses] && api_key_request?(runtime)
1084
+ cmd += http_responses_flags(runtime)
1085
+ end
1086
+
1078
1087
  cmd += test_command_overrides if options[:smoke_test]
1079
1088
 
1080
1089
  cmd << prompt
@@ -1095,6 +1104,29 @@ module AgentHarness
1095
1104
  300
1096
1105
  end
1097
1106
 
1107
+ def api_key_request?(runtime)
1108
+ return false if runtime&.unset_env&.include?("OPENAI_API_KEY")
1109
+
1110
+ key = runtime&.env&.fetch("OPENAI_API_KEY", nil) || ENV["OPENAI_API_KEY"]
1111
+ !key.to_s.strip.empty?
1112
+ end
1113
+
1114
+ def http_responses_flags(runtime)
1115
+ provider = "model_providers.#{HTTP_RESPONSES_PROVIDER}"
1116
+ base_url = runtime&.base_url || runtime&.env&.fetch("OPENAI_BASE_URL", nil)
1117
+ base_url ||= ENV["OPENAI_BASE_URL"] unless runtime&.unset_env&.include?("OPENAI_BASE_URL")
1118
+ base_url ||= DEFAULT_OPENAI_BASE_URL
1119
+
1120
+ [
1121
+ "--config", %(model_provider="#{HTTP_RESPONSES_PROVIDER}"),
1122
+ "--config", %(#{provider}.name="Agent Harness OpenAI HTTPS"),
1123
+ "--config", %(#{provider}.base_url="#{escape_toml_string(base_url)}"),
1124
+ "--config", %(#{provider}.env_key="OPENAI_API_KEY"),
1125
+ "--config", %(#{provider}.wire_api="responses"),
1126
+ "--config", %(#{provider}.supports_websockets=false)
1127
+ ]
1128
+ end
1129
+
1098
1130
  private
1099
1131
 
1100
1132
  def discover_compatible_model(rejected_model_id:, env:, timeout:, allowed_model_ids: nil, refresh: false)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AgentHarness
4
- VERSION = "0.44.35"
4
+ VERSION = "0.44.36"
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.44.35
4
+ version: 0.44.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Agapinan