Skip to content

Fix stack 09 (breaking): open runtime-kind + async lifecycle in protocol#33

Merged
ebarti merged 1 commit into
review-fixes/08-vendor-driftfrom
review-fixes/09-open-kind-lifecycle
Jul 2, 2026
Merged

Fix stack 09 (breaking): open runtime-kind + async lifecycle in protocol#33
ebarti merged 1 commit into
review-fixes/08-vendor-driftfrom
review-fixes/09-open-kind-lifecycle

Conversation

@ebarti

@ebarti ebarti commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Stacked review-fix PR 9/N (base: review-fixes/08-vendor-drift). Breaking API change (pre-1.0, alpha).

REVIEW.md §5.1, §5.2 — the extensibility linchpins:

  • Third-party runtime kinds. AgentRuntimeKind.coerce now returns a namespaced string for non-built-in values instead of raising, so a 4th runtime can be registered/dispatched (registry.register("x-myorg-agent", factory)) without forking the enum. Adds runtime_kind_value() for the wire form; kind fields on RuntimeAvailability, the typed errors, and the registry are AgentRuntimeKind | str.
  • Async lifecycle in the protocol. AgentRuntime now declares aclose(), __aenter__, __aexit__ (the reuse adapters already implemented them; the example previously used getattr to find them). kind is a read-only property so adapters may narrow it; both fakes gained no-op lifecycle methods.

Tests: namespaced-kind registration, lenient/strict coerce, fake protocol conformance with lifecycle. Full suite 173 passed / 12 skipped; ruff + mypy strict clean.

@ebarti ebarti force-pushed the review-fixes/08-vendor-drift branch from c690cce to f61ce9e Compare July 2, 2026 10:00
@ebarti ebarti force-pushed the review-fixes/09-open-kind-lifecycle branch from 1fa35d3 to 61c32c4 Compare July 2, 2026 10:00
@ebarti ebarti force-pushed the review-fixes/08-vendor-drift branch from f61ce9e to dd94de4 Compare July 2, 2026 10:26
@ebarti ebarti force-pushed the review-fixes/09-open-kind-lifecycle branch from 61c32c4 to b3da251 Compare July 2, 2026 10:26
@ebarti ebarti force-pushed the review-fixes/08-vendor-drift branch from dd94de4 to 87d0229 Compare July 2, 2026 10:41
@ebarti ebarti force-pushed the review-fixes/09-open-kind-lifecycle branch from b3da251 to 23c6d0c Compare July 2, 2026 10:41
…o protocol

BREAKING: widens AgentRuntimeKind and the AgentRuntime protocol surface.

- AgentRuntimeKind.coerce now returns a namespaced string for values that are
  not built-in members (instead of raising), so a third party can register and
  dispatch a 4th runtime kind (e.g. 'x-myorg-agent') without forking the enum.
  Blank values still raise. Adds runtime_kind_value() for the wire form; kind
  fields on RuntimeAvailability, the typed errors, and the registry are now
  AgentRuntimeKind | str, and the registry keys/kinds() accept strings.
- AgentRuntime protocol now declares aclose(), __aenter__, __aexit__ (the reuse
  adapters already had them; the flagship example previously reached for them via
  getattr). kind is a read-only property so adapters may narrow it. Both fake
  runtimes gained no-op lifecycle methods to stay protocol-conformant.

Refs REVIEW.md §5.1, §5.2.
@ebarti ebarti force-pushed the review-fixes/08-vendor-drift branch from 87d0229 to ea010d9 Compare July 2, 2026 15:13
@ebarti ebarti force-pushed the review-fixes/09-open-kind-lifecycle branch from 23c6d0c to f6537d5 Compare July 2, 2026 15:13
@ebarti ebarti merged commit f6537d5 into review-fixes/08-vendor-drift Jul 2, 2026
8 of 16 checks passed
Sign up for free to 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