Skip to content

feat: add task compatibility preflight#46

Merged
ebarti merged 1 commit into
mainfrom
agent/stack-06-task-support
Jul 10, 2026
Merged

feat: add task compatibility preflight#46
ebarti merged 1 commit into
mainfrom
agent/stack-06-task-support

Conversation

@ebarti

@ebarti ebarti commented Jul 10, 2026

Copy link
Copy Markdown
Owner

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

@ebarti ebarti force-pushed the agent/stack-05-domain-invariants branch from d0f2673 to da08b3d Compare July 10, 2026 22:44
ebarti added a commit that referenced this pull request Jul 10, 2026
## What

- reject blank task, session, MCP, tool, artifact, and result identities
- require positive execution hints and finite non-negative
budgets/counts
- reject ambiguous session start/resume state, duplicate MCP names, and
conflicting tool filters
- canonicalize sequence value fields while rejecting scalar strings
- add AgentResult.is_success
- represent unknown Usage and cost as None while preserving reported
zero
- preserve partial provider telemetry without inventing cache counts
- fix Claude resume result fallback when the SDK omits its session id

## Why

Several invalid or ambiguous states were constructible, and missing
telemetry was indistinguishable from a real zero.

## Root cause

The frozen dataclasses provided immutability but did not own their
cross-field invariants, while adapter coercion helpers normalized
missing and malformed counters to zero.

## Checks

- 321 passed, 12 skipped
- independent domain audit completed
- ruff check src tests
- mypy
- uv lock --check
- wheel and sdist build

## Compatibility

This intentionally rejects previously accepted invalid constructor
inputs and changes unknown Usage fields from zero to None.

## Stack

- Base: #44
- Next: #46
Base automatically changed from agent/stack-05-domain-invariants to main July 10, 2026 22:45
@ebarti ebarti force-pushed the agent/stack-06-task-support branch from a7b1e80 to 38e9f7c Compare July 10, 2026 22:45
@ebarti ebarti marked this pull request as ready for review July 10, 2026 22:45
@ebarti ebarti merged commit 900f8ec into main Jul 10, 2026
11 checks passed
@ebarti ebarti deleted the agent/stack-06-task-support branch July 10, 2026 22:46
ebarti added a commit that referenced this pull request Jul 10, 2026
## 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

- Base: #46
- Next: #48
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