feat: add task compatibility preflight#46
Merged
Conversation
This was referenced Jul 10, 2026
d0f2673 to
da08b3d
Compare
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
a7b1e80 to
38e9f7c
Compare
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
TaskSupportReportpreflight for built-in and third-party runtimesAgentRuntimemigration-compatible through the optionalTaskSupportProviderprotocolpyproject.tomland exactuv.lockversionsWhy
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_taskmandatory onAgentRuntime, 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 testsmypypytest -q --cov=agent_runtime_kit --cov-report=term-missing --cov-fail-under=85(340 passed, 3 skipped; 90.86%)uv lock --checkuv buildStack