Skip to content

feat(0.9.0): remove per-process coverage counters; add nullrun.shutdown() - #44

Merged
maltsev-dev merged 1 commit into
masterfrom
0.9.0
Jun 29, 2026
Merged

feat(0.9.0): remove per-process coverage counters; add nullrun.shutdown()#44
maltsev-dev merged 1 commit into
masterfrom
0.9.0

Conversation

@maltsev-dev

Copy link
Copy Markdown
Member

Server-derived coverage replaces the in-process counter dicts. Counter-bump helpers (_safe_bump_coverage, _bump_streaming_skipped) are gone; every llm_call span now carries metadata.tracked and metadata.streaming_skipped flags so the backend's coverage_pct query can compute coverage from span metadata alone.

BREAKING CHANGES

  • NullRunRuntime.coverage_report() removed.
  • NullRunRuntime._coverage_seen / _coverage_tracked / _coverage_streaming_skipped instance attributes removed.
  • NullRunRuntime.start_coverage_reporter() daemon thread removed (no longer called from init()).
  • _safe_bump_coverage / _bump_streaming_skipped helpers removed from nullrun.instrumentation.auto.
  • tests/test_coverage_report.py and tests/test_coverage_seen_httpx.py deleted — coverage is no longer an SDK-side concept.
  • llm_call wire shape: metadata.tracked: bool and metadata.streaming_skipped: bool are now authoritative; the separate coverage_report event is dropped.

NEW API

  • nullrun.shutdown(timeout=2.0): sends a clean WebSocket close frame and drains in-flight events. Long-running scripts that exited via sys.exit() previously let the kernel RST the TCP socket, which the backend logged as WARN "Connection reset without closing handshake". Registering nullrun.shutdown in an atexit handler eliminates the noisy log. No-op if init() was never called.

WIRE TEST

  • tests/test_llm_call_metadata_flags.py pins the new contract: every llm_call span carries metadata.tracked or metadata.streaming_skipped (the latter for streaming/oversize responses that the SDK deliberately does not buffer).

Existing tests updated to match — no public API beyond the additions listed above is renamed or removed.

Branch base:master @ f36befd (after 0.8.3 release via PR #43).

…wn()
Server-derived coverage replaces the in-process counter dicts.
Counter-bump helpers (_safe_bump_coverage, _bump_streaming_skipped)
are gone; every llm_call span now carries metadata.tracked and
metadata.streaming_skipped flags so the backend's coverage_pct
query can compute coverage from span metadata alone.
BREAKING CHANGES
- NullRunRuntime.coverage_report() removed.
- NullRunRuntime._coverage_seen / _coverage_tracked /
_coverage_streaming_skipped instance attributes removed.
- NullRunRuntime.start_coverage_reporter() daemon thread removed
(no longer called from init()).
- _safe_bump_coverage / _bump_streaming_skipped helpers removed
from nullrun.instrumentation.auto.
- tests/test_coverage_report.py and tests/test_coverage_seen_httpx.py
deleted — coverage is no longer an SDK-side concept.
- llm_call wire shape: metadata.tracked: bool and
metadata.streaming_skipped: bool are now authoritative; the
separate coverage_report event is dropped.
NEW API
- nullrun.shutdown(timeout=2.0): sends a clean WebSocket close
frame and drains in-flight events. Long-running scripts that
exited via sys.exit() previously let the kernel RST the TCP
socket, which the backend logged as WARN 'Connection reset
without closing handshake'. Registering nullrun.shutdown in an
atexit handler eliminates the noisy log. No-op if init() was
never called.
WIRE TEST
- tests/test_llm_call_metadata_flags.py pins the new contract:
every llm_call span carries metadata.tracked or
metadata.streaming_skipped (the latter for streaming/oversize
responses that the SDK deliberately does not buffer).
Existing tests updated to match — no public API beyond the
additions listed above is renamed or removed.
@maltsev-dev
maltsev-dev merged commit ddd5d80 into masterJun 29, 2026
4 checks passed
@codecov

codecovBot commented Jun 29, 2026

Copy link
Copy Markdown

maltsev-dev added a commit that referenced this pull request Jun 29, 2026
…45)
Version bump after PR #44: server-derived coverage replaces the
in-process counter dicts (every llm_call span now carries
metadata.tracked / metadata.streaming_skipped flags), and
nullrun.shutdown() is the new public API for graceful WS close
on script exit.
CHANGELOG entry added above 0.8.3. The breaking-change list
(coverage_report() removed, daemon thread gone, helper functions
removed, two coverage tests deleted) is fully documented.
@maltsev-dev
maltsev-dev deleted the 0.9.0 branch July 3, 2026 07:38
maltsev-dev added a commit that referenced this pull request Aug 7, 2026
…wn() (#44)
Server-derived coverage replaces the in-process counter dicts.
Counter-bump helpers (_safe_bump_coverage, _bump_streaming_skipped)
are gone; every llm_call span now carries metadata.tracked and
metadata.streaming_skipped flags so the backend's coverage_pct
query can compute coverage from span metadata alone.
BREAKING CHANGES
- NullRunRuntime.coverage_report() removed.
- NullRunRuntime._coverage_seen / _coverage_tracked /
_coverage_streaming_skipped instance attributes removed.
- NullRunRuntime.start_coverage_reporter() daemon thread removed
(no longer called from init()).
- _safe_bump_coverage / _bump_streaming_skipped helpers removed
from nullrun.instrumentation.auto.
- tests/test_coverage_report.py and tests/test_coverage_seen_httpx.py
deleted — coverage is no longer an SDK-side concept.
- llm_call wire shape: metadata.tracked: bool and
metadata.streaming_skipped: bool are now authoritative; the
separate coverage_report event is dropped.
NEW API
- nullrun.shutdown(timeout=2.0): sends a clean WebSocket close
frame and drains in-flight events. Long-running scripts that
exited via sys.exit() previously let the kernel RST the TCP
socket, which the backend logged as WARN 'Connection reset
without closing handshake'. Registering nullrun.shutdown in an
atexit handler eliminates the noisy log. No-op if init() was
never called.
WIRE TEST
- tests/test_llm_call_metadata_flags.py pins the new contract:
every llm_call span carries metadata.tracked or
metadata.streaming_skipped (the latter for streaming/oversize
responses that the SDK deliberately does not buffer).
Existing tests updated to match — no public API beyond the
additions listed above is renamed or removed.
maltsev-dev added a commit that referenced this pull request Aug 7, 2026
…45)
Version bump after PR #44: server-derived coverage replaces the
in-process counter dicts (every llm_call span now carries
metadata.tracked / metadata.streaming_skipped flags), and
nullrun.shutdown() is the new public API for graceful WS close
on script exit.
CHANGELOG entry added above 0.8.3. The breaking-change list
(coverage_report() removed, daemon thread gone, helper functions
removed, two coverage tests deleted) is fully documented.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@maltsev-dev