harnex 0.6.2 → 0.6.3
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 +4 -4
- data/CHANGELOG.md +36 -0
- data/lib/harnex/adapters/codex_appserver.rb +19 -5
- data/lib/harnex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f547957cf6589b1d153e4cf7e462482902ea71e7e1291281524e867596ea4730
|
|
4
|
+
data.tar.gz: 4f01e84be1c31692f2b68fa09850dd781116398ab45f3e6f0b2ad76c7f52846c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb7cd143d32da68e674bbc620d6ac6c56cb4388009e5f074ab54958288e6a02a0a31df38dae9a1713881ce0ea6315f2f8c01147a1b9b071056439bc8e3734518
|
|
7
|
+
data.tar.gz: a3c17557910b63e987cad3497c54599044417484710b8cd7cc2f152bfb9aa43b6231ba99c11efc93c0c9788bdc7f41077d22dda30e4a13b6be724f109e0eabbf
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.3] — 2026-05-06
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- JSON-RPC adapter (`codex app-server`): `--context` boot injection now
|
|
8
|
+
succeeds against real Codex CLI. Three schema mismatches in
|
|
9
|
+
`Adapters::CodexAppServer` caused 100% session disconnect on boot
|
|
10
|
+
with `"Invalid request: invalid type: null, expected a string"`:
|
|
11
|
+
- `ensure_thread!` and the `thread/started` notification handler read
|
|
12
|
+
`result["threadId"]`, but Codex's actual `thread/start` response is
|
|
13
|
+
`{"thread": {"id": "..."}}`. With `@thread_id = nil`, the subsequent
|
|
14
|
+
`turn/start` sent `threadId: null` and Codex's serde rejected it.
|
|
15
|
+
- `dispatch` sent `input: { content: [{type, text}] }`, but
|
|
16
|
+
`TurnStartParams.input` is an **array** of `UserInput`. Now sends
|
|
17
|
+
`input: [{type: "text", text: "..."}]`.
|
|
18
|
+
- `initialize` joined ALL `extra_args` into `@initial_prompt`, which
|
|
19
|
+
prepended Codex CLI flags (e.g. `-m gpt-5.5-mini -c
|
|
20
|
+
model_reasoning_effort=low`) into the prompt content. Now extracts
|
|
21
|
+
only the harnex-prefixed context element.
|
|
22
|
+
|
|
23
|
+
Re-opens and properly closes #29. The 0.6.2 fix shipped clean tests
|
|
24
|
+
but the test stubs mirrored harnex's wrong assumptions instead of
|
|
25
|
+
Codex's actual JSON-RPC schema, so production was 100% broken on the
|
|
26
|
+
default JSON-RPC path.
|
|
27
|
+
|
|
28
|
+
### Notes
|
|
29
|
+
|
|
30
|
+
- Test stubs in `codex_appserver_lifecycle_test.rb` and
|
|
31
|
+
`session_jsonrpc_test.rb` still mirror harnex's old assumptions.
|
|
32
|
+
Tracked as a follow-up (test rewrite using `codex app-server
|
|
33
|
+
generate-json-schema` as the source of truth, plus a contract-test
|
|
34
|
+
gate). Existing tests remain green; the structural improvement does
|
|
35
|
+
not block this release.
|
|
36
|
+
- `--legacy-pty` remains as the documented fallback. Removal still
|
|
37
|
+
scheduled for 0.7.0 once test-rewrite + contract gate land.
|
|
38
|
+
|
|
3
39
|
## [0.6.2] — 2026-05-06
|
|
4
40
|
|
|
5
41
|
### Fixed
|
|
@@ -38,8 +38,7 @@ module Harnex
|
|
|
38
38
|
|
|
39
39
|
def initialize(extra_args = [])
|
|
40
40
|
super("codex", extra_args)
|
|
41
|
-
@initial_prompt = extra_args
|
|
42
|
-
@initial_prompt = nil if @initial_prompt.empty?
|
|
41
|
+
@initial_prompt = extract_initial_prompt(extra_args)
|
|
43
42
|
@client = nil
|
|
44
43
|
@thread_id = nil
|
|
45
44
|
@current_turn_id = nil
|
|
@@ -133,7 +132,7 @@ module Harnex
|
|
|
133
132
|
ensure_thread!
|
|
134
133
|
params = {
|
|
135
134
|
threadId: @thread_id,
|
|
136
|
-
input:
|
|
135
|
+
input: [{ type: "text", text: prompt.to_s }]
|
|
137
136
|
}
|
|
138
137
|
params[:model] = model if model
|
|
139
138
|
params[:effort] = effort if effort
|
|
@@ -183,7 +182,22 @@ module Harnex
|
|
|
183
182
|
return if @thread_id
|
|
184
183
|
|
|
185
184
|
result = @client.request("thread/start", {})
|
|
186
|
-
@thread_id = result
|
|
185
|
+
@thread_id = extract_thread_id(result)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
def extract_thread_id(payload)
|
|
189
|
+
return nil unless payload.is_a?(Hash)
|
|
190
|
+
|
|
191
|
+
payload.dig("thread", "id") || payload["threadId"] || payload["thread_id"]
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def extract_initial_prompt(extra_args)
|
|
195
|
+
return nil unless extra_args.is_a?(Array)
|
|
196
|
+
|
|
197
|
+
prefixed = extra_args.find { |a| a.is_a?(String) && a.start_with?("[harnex session id=") }
|
|
198
|
+
return prefixed if prefixed && !prefixed.empty?
|
|
199
|
+
|
|
200
|
+
nil
|
|
187
201
|
end
|
|
188
202
|
|
|
189
203
|
def perform_handshake
|
|
@@ -207,7 +221,7 @@ module Harnex
|
|
|
207
221
|
|
|
208
222
|
case method
|
|
209
223
|
when "thread/started"
|
|
210
|
-
@thread_id ||= params
|
|
224
|
+
@thread_id ||= extract_thread_id(params)
|
|
211
225
|
when "turn/started"
|
|
212
226
|
@current_turn_id = params["turnId"] || params["turn_id"]
|
|
213
227
|
@state = :busy
|
data/lib/harnex/version.rb
CHANGED