runtype 0.2.1 → 0.2.2
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 +9 -0
- data/lib/runtype/detached_follow.rb +6 -0
- data/lib/runtype/local_tool_runner.rb +8 -2
- data/lib/runtype/sdk_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: af0bbf25840f4340b5269585397637edd31012849c0d9bb6228d60818a3999b8
|
|
4
|
+
data.tar.gz: 7faf081469ffb6891459f53583b38919703705b21dc44e72aa99058ad5d6bdb3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 037faa37e743cb38c72015de37a5c76f5cc1b01288c592abae0bf1f106f431c1fe3401131f4f7cf695c10fbbfbd30db0ca27dff520f16dde6e8279506d6698ff
|
|
7
|
+
data.tar.gz: 2db93bef84aef75510da3e23895d15a1cf75d640d8023397d2f90925f2f46353dc2c1adc5b34fb92dc061861e4aaccb6a5cdb96171908c6a054997fa133ee793
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the Runtype Ruby SDK are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.2.2
|
|
6
|
+
|
|
7
|
+
- The durable follow from 0.2.1, hardened after review: a buffered follow gives up
|
|
8
|
+
after twelve detached reconnects of the events alias (the TypeScript client's cap)
|
|
9
|
+
instead of reopening it forever; a replayed await is recognised as already answered
|
|
10
|
+
only by its call id, so a name-keyed compatibility frame for a tool answered earlier
|
|
11
|
+
still runs; a stream that detaches without an execution id raises
|
|
12
|
+
`Runtype::LocalToolError` rather than requesting a malformed events path.
|
|
13
|
+
|
|
5
14
|
## 0.2.1
|
|
6
15
|
|
|
7
16
|
- `Runtype::Client#run_with_local_tools` follows a run that detached from its
|
|
@@ -21,6 +21,10 @@ module Runtype
|
|
|
21
21
|
# Local-tool awaits the events alias can carry.
|
|
22
22
|
AWAIT_TYPES = %w[await flow_await step_await].freeze
|
|
23
23
|
|
|
24
|
+
# How many times one buffered follow reopens the alias after a detached
|
|
25
|
+
# close before giving up, as the TypeScript client's detached reconnect.
|
|
26
|
+
MAX_DETACHED_RECONNECTS = 12
|
|
27
|
+
|
|
24
28
|
# The message the buffered envelope carries when the events stream closed
|
|
25
29
|
# before a terminal frame.
|
|
26
30
|
STREAM_CLOSED_EARLY =
|
|
@@ -89,6 +93,7 @@ module Runtype
|
|
|
89
93
|
status = nil
|
|
90
94
|
error = nil
|
|
91
95
|
cursor = after
|
|
96
|
+
reconnects = 0
|
|
92
97
|
|
|
93
98
|
loop do
|
|
94
99
|
detached = false
|
|
@@ -111,6 +116,7 @@ module Runtype
|
|
|
111
116
|
end
|
|
112
117
|
end
|
|
113
118
|
break unless status.nil? && detached
|
|
119
|
+
break if (reconnects += 1) > MAX_DETACHED_RECONNECTS
|
|
114
120
|
end
|
|
115
121
|
|
|
116
122
|
if status.nil?
|
|
@@ -127,6 +127,10 @@ module Runtype
|
|
|
127
127
|
# events are followed from where this leg stopped.
|
|
128
128
|
raise_local_tool_round_limit(max_rounds) if (rounds += 1) > max_rounds
|
|
129
129
|
execution_id = leg.execution_id || stream.execution_id
|
|
130
|
+
if execution_id.nil? || execution_id.empty?
|
|
131
|
+
raise Runtype::LocalToolError, "The execution detached without an executionId to follow"
|
|
132
|
+
end
|
|
133
|
+
|
|
130
134
|
after = stream.last_event_id
|
|
131
135
|
leg = StreamLeg.new(replayed: true)
|
|
132
136
|
stream = execution_events_stream(execution_id, after: after, request_options: request_options) do |event|
|
|
@@ -159,13 +163,15 @@ module Runtype
|
|
|
159
163
|
batch.each { |call| @keys[call.output_key] = true }
|
|
160
164
|
end
|
|
161
165
|
|
|
162
|
-
# A followed replay can carry awaits already answered.
|
|
166
|
+
# A followed replay can carry awaits already answered. Only a call the
|
|
167
|
+
# server identified by id can be recognised as a replay; a name-keyed
|
|
168
|
+
# compatibility frame may be a genuinely new request of the same tool.
|
|
163
169
|
#
|
|
164
170
|
# @param batch [Array<Runtype::LocalTools::PausedCall>]
|
|
165
171
|
# @return [Array<Runtype::LocalTools::PausedCall>] the calls not yet
|
|
166
172
|
# answered, now recorded.
|
|
167
173
|
def fresh(batch)
|
|
168
|
-
record(batch.reject { |call| @keys.key?(call.output_key) })
|
|
174
|
+
record(batch.reject { |call| call.tool_call_id && @keys.key?(call.output_key) })
|
|
169
175
|
end
|
|
170
176
|
end
|
|
171
177
|
private_constant :AnsweredCalls
|
data/lib/runtype/sdk_version.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Runtype
|
|
|
8
8
|
# generator). The generated barrel does not require that file, so nothing
|
|
9
9
|
# collides today, but re-declaring it here would make the overlay's version
|
|
10
10
|
# depend on generator require order.
|
|
11
|
-
SDK_VERSION = "0.2.
|
|
11
|
+
SDK_VERSION = "0.2.2"
|
|
12
12
|
|
|
13
13
|
# Outbound User-Agent identifying the SDK kind, version, and language, e.g.
|
|
14
14
|
# "runtype-sdk/0.1.0 (ruby)". The `runtype-sdk/` prefix is what the API's
|