Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to this project are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Changed

- Updated tested Claude Agent SDK to `0.2.168`, Google Antigravity SDK to
`0.1.22`, and the exactly coupled Codex SDK and CLI to `0.163.0`.
- Raised the Codex SDK upper bound to `<0.164` after exact candidate inspection.

### Fixed

- Antigravity permission lists preserve the deprecated `start_subagent` alias
after its rename to `invoke_subagent`.
- Explicit Antigravity workflow tools enable the SDK's delegation gate,
including when an independent invocation tool is denied. Strict and read-only
tasks continue to refuse delegation tools.

## 0.5.3 - 2026-10-02

### Added
Expand Down
23 changes: 20 additions & 3 deletions docs/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ escalate beyond the sandbox), `DEFAULT`/`PERMISSIVE` → `auto_review`
(escalations auto-adjudicated). Tool audits are parsed from `TurnResult.items`
(command executions, MCP tool calls, dynamic tool calls, web searches), and a
`TurnResult.status` of `failed`/`interrupted` maps to the matching
`finish_reason`. `budget_usd`, `permissions.network`, `allowed_tools`,
`finish_reason`. Audits are best effort: live checks with SDK/CLI `0.160.0`
and `0.163.0` observed a nested Code Mode `exec` call in the session log that
was absent from both `TurnResult.items` and the supported thread-read response, while a direct
shell call produced normal command items. An empty `tool_calls` tuple therefore
does not establish that no tools ran. The adapter uses the SDK item surface
and does not reconstruct execution history from local transcript files.
`budget_usd`, `permissions.network`, `allowed_tools`,
`disallowed_tools`, and `mcp_servers` have no per-task SDK surface and are
rejected with typed errors. The constructor defaults to
`config_overrides=("features.plugins=false",)` so headless runs are
Expand Down Expand Up @@ -256,8 +262,19 @@ read-only toolset, and under `DEFAULT`/`CAUTIOUS` from the nondestructive
toolset — `disabled_tools` alone would re-enable every unnamed write or
destructive tool. An explicit `allowed_tools` list is rejected if it names a
non-read-only tool under a `READ_ONLY` filesystem or `STRICT` mode. An
`allowed_tools` list containing `start_subagent` enables subagents in any mode;
the approval policy still follows the mode (only `STRICT` omits `allow_all`).
`allowed_tools` list containing a delegation tool enables the SDK's subagent
gate when the filesystem and mode permit that tool; the approval policy still
follows the mode.

Antigravity 0.1.22 names the invocation tool `invoke_subagent` and retains
`start_subagent` as a deprecated input alias. The adapter uses the installed
SDK's enum coercion for allow/deny entries, preserving that alias while still
rejecting unknown names. Both `invoke_subagent` and `run_workflow` require the
SDK's subagent gate. Selecting either enables it; denying one keeps the other
usable. To disable both forms of delegation on 0.1.22, deny both names or use an
explicit allow-list containing neither. `READ_ONLY` and `STRICT` reject either
tool, including the legacy alias. Older SDKs retain `start_subagent` support
and reject names they do not provide.

Session and app-data directories are written under
`$XDG_CACHE_HOME/agent-runtime-kit` (default `~/.cache/agent-runtime-kit`,
Expand Down
61 changes: 61 additions & 0 deletions docs/sdk-upgrade-2026-10-17.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# October 17 SDK integration review

This upgrade starts at `3fd68b0` and targets the latest stable releases observed
on October 17, 2026: Claude Agent SDK `0.2.168`, Codex SDK and its exactly coupled
CLI `0.163.0`, and Antigravity `0.1.22`. The Codex upper bound becomes `<0.164`;
its `0.157.1` floor, Python 3.10 support, and optional vendor extras remain.

## Upstream changes and adapter decisions

| Observed change | Existing behavior and decision |
| --- | --- |
| Claude `0.2.163` to `0.2.168` adds typed hook outputs, hook context, init/session payloads, and corrects the `SandboxIgnoreViolations` type. | Already supported or outside the task contract. The adapter consumes assistant/user/result messages and constructs unchanged task options. It does not configure vendor hooks or sandbox violation-reporting exceptions. Keep SDK-owned lifecycle and typed result handling. |
| Codex `0.160.0` to `0.163.0` expands generated protocol models and notifications, including thread read state and browser/prediction data. | The handwritten `AsyncCodex`/`AsyncThread` client implementation is unchanged. `CodexConfig`'s signature differs only in the default `client_version`. Existing task execution, schemas, model/effort, and permission mappings remain applicable. Thread UI state, browser extension setup, and prediction APIs are outside this execution API. |
| Codex CLI removes bundled zsh and changes resume/permission behavior. | Already delegated to the pinned SDK runtime. The adapter does not select the removed shell binary and explicitly supplies task permission settings when starting or resuming threads. Verify structured execution, process reuse, and read-only resume with the final bundled CLI. |
| Live Code Mode execution is absent from typed SDK turn items, while a direct shell call emits command items. The identical structured-resume check reproduces this on both `0.160.0` and `0.163.0`. | Document the existing visibility boundary. Tool audit normalization is best effort over SDK-provided items; preserve that supported input boundary rather than scraping local session files or disabling vendor tools. Treat exhaustive Code Mode audit coverage as unverified. |
| Antigravity `0.1.22` replaces the `start_subagent` enum value with `invoke_subagent`, retaining deprecated constructor coercion. | Adapt now. Enum iteration previously rejected the supported alias before the SDK could normalize it. Resolve allow/deny entries with the SDK enum constructor and keep unknown-name refusals. Prefer the canonical member when deriving delegation, falling back to the old member on older SDKs. |
| Antigravity adds `run_workflow` to its nondestructive/default tool collection and gates it with `enable_subagents`. | Adapt now. Derive that gate from both selected invocation and workflow tools, including after deny-list subtraction. An explicit workflow allow-list must work; denying invocation alone must not disable an independently selected workflow. Preserve strict/read-only refusal of delegation and SDK-owned default collections. |
| Antigravity adds beta workflow/Interactions APIs, inline skills, subagent skill configuration, and model output-token options. | Outside the portable task contract: the kit runs tasks through `Agent.chat`, and does not own workflow orchestration, subagent configuration, or provider model policy. Keep those vendor APIs available through the native SDK instead of adding a second orchestration abstraction. |
| Antigravity adds eager MCP loading and payload byte limits, bulk hooks/call IDs, and fixes empty-ID tool deduplication. | Stable stdio MCP launch settings and typed `ToolCall`/`ToolResult` streams remain compatible. The adapter does not register vendor hooks or deduplicate chunks; it already records every yielded request. MCP context-loading/truncation policy is outside `McpServerConfig`'s launch-settings contract. No new portable fields are required for this upgrade. |
| Claude CLI, Codex binaries/helpers, and Antigravity local harness change. | Preserve the distinction between distribution fingerprints and runtime internals. Python source/configuration probes cannot establish binary behavior or substitute for live execution. |

## Evidence and verification

The initial repository evolution run covered eight exact API snapshots, four
baseline/candidate comparisons, and fifteen recent-release implementation
snapshots without import errors. All four release-note sources were found;
the existing behavior probes had no failures or skips. The current Codex bound
selected `0.160.1`, while independent discovery and prospective resolution
selected the exactly coupled `0.163.0` pair.

Additional credential-scrubbed construction probes against the exact
Antigravity `0.1.22` wheel reproduced rejected legacy aliases and a disabled
workflow-only delegation gate. Regression tests exercise the actual adapter
with old and canonical-only fake enums, real installed SDK constructors,
allow/deny lists, and strict/read-only refusal. No Antigravity provider call is
needed for those configuration checks.

Declarations, lockfile, and compatibility manifest are applied together by the
runner's atomic transaction after the adapter repair. Reanalysis through the
final locked Codex runtime and cumulative-diff review are required after the
update; a pre-change architecture pass alone is insufficient.

The final all-extras suite passes on Python 3.10: 603 tests passed, three live
provider tests skipped, with 90.37% coverage. A separate live bundled-Codex
check confirms structured output, same-session resume, process reuse, retained
context, and a controlled read-only write denial. The attempted Code Mode call
and operating-system denial are present in its controlled session log, but
the assertion that every tool attempt appears in the normalized audit did not
pass: neither the SDK result nor its supported thread-read includes that call.
The identical structured-resume harness also fails that completeness assertion
with the original `0.160.0` SDK/CLI, confirming the limit predates this upgrade.
A separate supported turn-notification check produced direct command items.
This is an explicit coverage limit, not evidence of a permission bypass or a
claim of complete Code Mode auditing. Live Claude and Antigravity provider
execution remain outside the local configuration checks.

Sources: [Claude SDK changelog](https://github.com/anthropics/claude-agent-sdk-python/blob/main/CHANGELOG.md),
[Codex SDK documentation](https://developers.openai.com/codex/sdk),
[Codex 0.163.0 release](https://github.com/openai/codex/releases/tag/rust-v0.163.0),
[Antigravity 0.1.21 notes](https://github.com/google-antigravity/antigravity-sdk-python/discussions/250),
and [Antigravity 0.1.22 notes](https://github.com/google-antigravity/antigravity-sdk-python/discussions/255).
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ dependencies = ["jsonschema>=4.18,<5", "tomli>=2,<3; python_version < '3.11'"]
claude = ["claude-agent-sdk>=0.2.87,<0.3"]
# 0.157.1 is the minimum SDK and CLI pair for native named profiles. Earlier
# bundled CLIs do not enforce every profile rule needed by restricted runtimes.
codex = ["openai-codex>=0.157.1,<0.161"]
codex = ["openai-codex>=0.157.1,<0.164"]
antigravity = ["google-antigravity>=0.1.2,<0.2"]
all = [
"claude-agent-sdk>=0.2.87,<0.3",
"google-antigravity>=0.1.2,<0.2",
"openai-codex>=0.157.1,<0.161",
"openai-codex>=0.157.1,<0.164",
]

[project.urls]
Expand Down
40 changes: 24 additions & 16 deletions src/agent_runtime_kit/adapters/antigravity.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ def _capability_policy(
kind: AgentRuntimeKind, task: AgentTask, sdk: _AntigravitySDK
) -> tuple[Any, list[Any]]:
builtin = sdk.types.BuiltinTools
subagent = getattr(builtin, "START_SUBAGENT", None)
is_permissive = task.permissions.mode is PermissionMode.PERMISSIVE
if task.permissions.disallowed_tools:
# The real CapabilitiesConfig requires enabled_tools and disabled_tools to be
Expand Down Expand Up @@ -813,7 +812,7 @@ def _capability_policy(
]
capabilities = sdk.types.CapabilitiesConfig(
enabled_tools=tools,
enable_subagents=_contains_tool(tools, subagent),
enable_subagents=_enables_subagents(tools, builtin),
)
elif is_permissive:
# Since 0.1.17 disabled_tools subtracts from default(), which excludes
Expand All @@ -830,7 +829,7 @@ def _capability_policy(
tools = [tool for tool in all_tools() if getattr(tool, "value", tool) not in denied]
capabilities = sdk.types.CapabilitiesConfig(
enabled_tools=tools,
enable_subagents=_contains_tool(tools, subagent),
enable_subagents=_enables_subagents(tools, builtin),
)
else:
# DEFAULT/CAUTIOUS: "enable everything else" would widen access past the
Expand All @@ -845,7 +844,7 @@ def _capability_policy(
]
capabilities = sdk.types.CapabilitiesConfig(
enabled_tools=tools,
enable_subagents=_contains_tool(tools, subagent),
enable_subagents=_enables_subagents(tools, builtin),
)
else:
if task.permissions.allowed_tools == ():
Expand All @@ -862,9 +861,9 @@ def _capability_policy(
# (previously STRICT honored any named write tool). Reject rather
# than silently widen access.
_reject_non_read_only_tools(kind, tools, builtin)
# Honor an explicitly allow-listed subagent tool regardless of mode; gating
# this on PERMISSIVE left an explicit start_subagent request silently inert.
enable_subagents = _contains_tool(tools, subagent)
# Both invocation and workflow tools use the SDK's delegation gate.
# Derive it from the selected tools rather than the permission mode.
enable_subagents = _enables_subagents(tools, builtin)
capabilities = sdk.types.CapabilitiesConfig(
enabled_tools=tools,
enable_subagents=enable_subagents,
Expand All @@ -873,11 +872,19 @@ def _capability_policy(
return capabilities, policies


def _contains_tool(tools: list[Any], subagent: Any) -> bool:
def _enables_subagents(tools: list[Any], builtin: Any) -> bool:
# Prefer the canonical name without touching the deprecated 0.1.22 alias.
# Older SDKs expose only START_SUBAGENT and have no workflow tool.
subagent = getattr(builtin, "INVOKE_SUBAGENT", None)
if subagent is None:
return False
target = getattr(subagent, "value", subagent)
return any(getattr(tool, "value", tool) == target for tool in tools)
subagent = getattr(builtin, "START_SUBAGENT", None)
workflow = getattr(builtin, "RUN_WORKFLOW", None)
selected = {getattr(tool, "value", tool) for tool in tools}
return any(
getattr(target, "value", target) in selected
for target in (subagent, workflow)
if target is not None
)


def _env_first(*names: str) -> str | None:
Expand Down Expand Up @@ -932,16 +939,17 @@ def _validate_tools(
resolved: list[Any] = []
for tool in tools:
value = getattr(tool, "value", tool)
if value not in valid:
try:
# The SDK owns accepted aliases: 0.1.22 still coerces start_subagent
# to INVOKE_SUBAGENT even though enum iteration omits the old value.
resolved.append(builtin(value))
except (TypeError, ValueError):
ordered = ", ".join(sorted(valid))
raise UnsupportedTaskInputError(
kind,
f"permissions.{field}",
f"{value!r} is not an Antigravity built-in tool; valid values: {ordered}",
)
# Return real enum members so validated allow/deny lists match the type the
# default-tool paths hand CapabilitiesConfig (previously plain strings).
resolved.append(builtin(value))
) from None
return resolved


Expand Down
10 changes: 5 additions & 5 deletions src/agent_runtime_kit/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ def __post_init__(self) -> None:
package="claude-agent-sdk",
module="claude_agent_sdk",
version_specifier=">=0.2.87,<0.3",
tested_version="0.2.163",
tested_version="0.2.168",
),
RuntimeCompatibility(
kind=AgentRuntimeKind.CODEX_AGENT_SDK,
extra="codex",
package="openai-codex",
module="openai_codex",
version_specifier=">=0.157.1,<0.161",
tested_version="0.160.0",
version_specifier=">=0.157.1,<0.164",
tested_version="0.163.0",
tested_runtime_dependencies=(
PackageVersion(package="openai-codex-cli-bin", version="0.160.0"),
PackageVersion(package="openai-codex-cli-bin", version="0.163.0"),
),
),
RuntimeCompatibility(
Expand All @@ -85,7 +85,7 @@ def __post_init__(self) -> None:
package="google-antigravity",
module="google.antigravity",
version_specifier=">=0.1.2,<0.2",
tested_version="0.1.20",
tested_version="0.1.22",
),
)

Expand Down
Loading
Loading