Commit 14c673c
authored
chore(release): 0.14.2 - three runtime/transport hotfixes (#79)
* some clean up
* fix(runtime): treat websocket cancellation as clean shutdown
* fix(transport): approval_resolved callback is synchronous
* SdkTrackRequest
* chore(release): 0.14.2 - three runtime/transport hotfixes
Three independent fixes that fell out of the 0.14.1 demo run,
plus a stub refresh on the two _RecordingRuntime mocks whose
shape the new @Protect emit broke.
* fix(decorators): @Protect now emits a tools/track_tool event
after the wrapped body returns. Pre-0.14.2 the protected
decorator only fired the gate check and skipped the
bookkeeping emit, so the dashboard never saw a protect
execution. The emit goes through the same sink as llm_call
events so it picks up the dedup LRU at runtime.track() for
free.
* fix(runtime): track_tool event carries tokens: 0 and a fresh
uuidv7 execution_id. The backend's SdkTrackRequest requires
both fields as non-Optional u64 / string; pre-0.14.2 the
event dict only carried type / tool_name / is_retry and the
deserializer rejected it. Span lifecycle events get the same
tokens: 0 default via _enrich_event.
* fix(transport): approval-resolved WS callback is now a plain
sync function. The WebSocket dispatch path invokes it as a
dict -> None callable; the previous async-decorated
coroutine was silently dropped, so the sync threading.Event
inside _wait_for_approval_resolution never got set on the
first approval round-trip - the demo's first approval hung
forever. Caught 2026-07-24.
* fix(runtime): treat websocket cancellation as a clean
shutdown signal. WebSocketConnection.close() cancels the
receive task to unblock the waiter during normal end of
session; on Python 3.11+ CancelledError derives from
BaseException, so the old except Exception branch re-raised
it and produced a noisy debug line on every clean exit.
The new except CancelledError branch is silent and the
finally cleanup still runs.
* test: refresh _RecordingRuntime in tests/test_protect.py
and tests/test_preflight_fail_policy.py with a track_tool
stub. The previous shape only mocked track_event, which
is why the @Protect emit silently failed under the new
decorator wiring.
* chore: ruff format on the three source files touched by
this release (decorators / runtime / transport). The
format-only reformat of the 65 unrelated files is
intentionally deferred to a separate PR.
* docs: 0.14.2 changelog entry describing the four fixes
end-to-end.
No SDK_MIN_VERSION bump. No public API change. No on-wire
breaking change. Backends on 1.0.0 keep working unchanged.
Verification:
- pytest -n auto -> 1369 passed, 7 skipped, 29 warnings.
- ruff check src/ tests/ -> All checks passed.
- mypy src/nullrun --strict -> Success: no issues found
in 36 source files.1 parent b72cf62 commit 14c673c
15 files changed
Lines changed: 622 additions & 661 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
10 | 36 | | |
11 | 37 | | |
12 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
134 | 144 | | |
135 | 145 | | |
136 | 146 | | |
| |||
0 commit comments