Skip to content

feat: add bounded runtime readiness probes#47

Merged
ebarti merged 1 commit into
mainfrom
agent/stack-07-runtime-readiness
Jul 10, 2026
Merged

feat: add bounded runtime readiness probes#47
ebarti merged 1 commit into
mainfrom
agent/stack-07-runtime-readiness

Conversation

@ebarti

@ebarti ebarti commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What

  • separates side-effect-free package availability from explicit async execution readiness
  • adds RuntimeReadiness, ReadinessStatus, optional RuntimeReadinessProvider, and bounded check_readiness()
  • exposes readiness through the registry, AgentKit, provider diagnostics, and live smoke path
  • probes Claude credential signals without claiming local/provider chains are verified
  • probes Codex through the supported account API with guaranteed temporary-client cleanup
  • probes Antigravity API-key/ADC setup off the event loop and converts timeout/failure into secret-safe diagnostics

Why

availability() mixed package presence with potentially blocking credential discovery. In particular, Antigravity could read files or contact Google metadata services from a synchronous setup check, while Claude/Codex package success was easy to misread as execution readiness.

Root cause

One diagnostic type represented two different questions: “is the adapter installed?” and “is enough setup present to attempt a provider call?” Provider authentication mechanisms also differ in how safely they can be probed.

Semantics

  • availability(): synchronous, package-only, side-effect-free
  • READY_TO_ATTEMPT: setup signal confirmed, not a guarantee of execution
  • NOT_READY: a concrete package/credential problem was established
  • INDETERMINATE: provider-owned/local chains, timeout, or probe failure require caller policy
  • readiness remains an optional extension, so the AgentRuntime protocol is unchanged

Checks

  • ruff check src tests
  • strict mypy
  • full suite: 380 passed, 3 skipped in the all-extras verification environment
  • delegated run: 371 passed, 12 skipped; 90.92% coverage
  • uv lock --check
  • uv build plus wheel/sdist content inspection

Stack

@ebarti ebarti force-pushed the agent/stack-06-task-support branch from a7b1e80 to 38e9f7c Compare July 10, 2026 22:45
ebarti added a commit that referenced this pull request Jul 10, 2026
## What

- adds side-effect-free `TaskSupportReport` preflight for built-in and
third-party runtimes
- keeps `AgentRuntime` migration-compatible through the optional
`TaskSupportProvider` protocol
- reports granular task capability gaps, configured model allow-list
mismatches, and static Antigravity constraints
- makes built-in dispatch consume the same support report used by public
preflight
- adds a machine-readable compatibility manifest tied to
`pyproject.toml` and exact `uv.lock` versions

## Why

Capability booleans and per-adapter rejection branches had drifted
apart. Callers could not discover all incompatible fields before
starting a run, provider-specific rules were delayed until dispatch, and
compatibility ranges/tested runtime binaries existed only as duplicated
prose and package metadata.

## Root cause

Task support was encoded in several imperative adapter paths rather than
one additive preflight contract. An initial implementation also made
`validate_task` mandatory on `AgentRuntime`, which would have broken
existing structural third-party runtimes; this PR uses an optional
extension plus a declared-capability fallback instead.

## Checks

- `ruff check src tests`
- `mypy`
- `pytest -q --cov=agent_runtime_kit --cov-report=term-missing
--cov-fail-under=85` (340 passed, 3 skipped; 90.86%)
- installed SDK contracts: 19 passed
- `uv lock --check`
- `uv build`

## Stack

- Base: #45
- Next: #47
Base automatically changed from agent/stack-06-task-support to main July 10, 2026 22:46
@ebarti ebarti force-pushed the agent/stack-07-runtime-readiness branch from b18fd9b to 4bcfab9 Compare July 10, 2026 22:46
@ebarti ebarti marked this pull request as ready for review July 10, 2026 22:46
@ebarti ebarti merged commit 5d96201 into main Jul 10, 2026
11 checks passed
@ebarti ebarti deleted the agent/stack-07-runtime-readiness branch July 10, 2026 22:47
ebarti added a commit that referenced this pull request Jul 10, 2026
## What

- delegates the no-override model choice to each provider instead of
pinning library-owned names
- preserves one precedence chain: task field > legacy metadata >
constructor override > provider-native
- omits vendor model kwargs when selection is provider-native
- records `model_source` on every provider result and records `model`
only when known
- keeps `default_model=` as an explicit migration override
- makes configured model allow-lists fail closed when provider-native
selection cannot be verified

## Why

Hard-coded adapter defaults age faster than the SDK and can override
supported provider configuration. The SDK-evolution docs already
described Claude and Antigravity as provider-native, but the adapters
silently forced stale model names.

## Root cause

Model resolution treated the library constructor default as mandatory
rather than an optional override, and result metadata could not
distinguish task, metadata, constructor, and provider-native selection.

## Compatibility

This is an intentional pre-1.0 behavior change. Applications that need
the prior pin can pass the same value through `default_model=`; task and
metadata overrides keep their existing precedence.

## Checks

- `ruff check src tests`
- strict `mypy`
- full all-extras suite: 396 passed, 3 skipped
- model-policy coverage run: 356 passed, 3 skipped; 91.00% coverage
- installed SDK contracts: 23 passed
- `uv lock --check`
- `uv build`

## Stack

- Base: #47
- Next: #49
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