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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ jobs:
# force-include can't build via the sdist-then-wheel default.
run: uv build --all-packages --wheel

- name: Smoke-test wheel install
# Both wheels must install together into one working agentex.* namespace.
run: ./scripts/check-wheel-install

- name: Get GitHub OIDC Token
if: |-
github.repository == 'stainless-sdks/agentex-sdk-python' &&
Expand Down
2 changes: 1 addition & 1 deletion adk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ readme = "README.md"
dependencies = [
# Co-released in lockstep; floor-only by design — a ceiling would
# eventually exclude the co-versioned slim (release-please can't bump it).
"agentex-client>=0.12.0",
"agentex-client>=0.13.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Update the lockfile

This PR raises the ADK dependency to agentex-client>=0.13.0, but uv.lock still records the workspace packages as 0.12.0 and the ADK lock metadata still has only the editable agentex-client dependency without this floor. A frozen or locked install can keep resolving the stale 0.12.0 metadata, so tests and local installs may not exercise the package contract this change is meant to enforce. Please regenerate uv.lock so it records the 0.13.0 package versions and updated ADK dependency floor.

Artifacts

Repro: TOML metadata inspection script

  • Contains supporting evidence from the run (text/x-python; charset=utf-8).

Repro: lock inspection output showing stale package versions and missing dependency floor

  • Keeps the command output available without making the summary code-heavy.

Repro: uv lock check attempt showing uv unavailable

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: adk/pyproject.toml
Line: 18

Comment:
**Update the lockfile**

This PR raises the ADK dependency to `agentex-client>=0.13.0`, but `uv.lock` still records the workspace packages as `0.12.0` and the ADK lock metadata still has only the editable `agentex-client` dependency without this floor. A frozen or locked install can keep resolving the stale 0.12.0 metadata, so tests and local installs may not exercise the package contract this change is meant to enforce. Please regenerate `uv.lock` so it records the 0.13.0 package versions and updated ADK dependency floor.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Cursor Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lockfile is now updated.

# CLI surface (agentex.lib.cli.*, agentex.lib.sdk.config.*)
"typer>=0.16,<0.17",
"questionary>=2.0.1,<3",
Expand Down
25 changes: 25 additions & 0 deletions scripts/check-wheel-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Smoke: agentex-client + agentex-sdk must install together into one working
# agentex.* namespace. Builds + installs in a clean temp dir to avoid stale dist/.

set -euo pipefail

cd "$(dirname "$0")/.."

work="$(mktemp -d)"
echo "==> building both wheels into $work/dist"
uv build --all-packages --wheel --out-dir "$work/dist"

venv="$work/venv"
uv venv "$venv" >/dev/null
echo "==> installing both wheels into a fresh venv"
uv pip install --python "$venv" "$work"/dist/agentex_client-*.whl "$work"/dist/agentex_sdk-*.whl

echo "==> importing the merged namespace from the installed wheels"
"$venv/bin/python" - <<'PY'
import agentex.lib.adk # ADK overlay — ships in agentex-sdk
from agentex.types import Event # client surface — ships in agentex-client
from agentex.resources import states # client surface that "didn't land" in the incident

print("agentex namespace OK:", Event.__name__, states.__name__)
PY
4 changes: 4 additions & 0 deletions src/agentex/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from agentex.lib._version_guard import verify_client_compatibility

# Fail fast + clearly on a skewed/incomplete agentex-client install.
verify_client_compatibility()
28 changes: 28 additions & 0 deletions src/agentex/lib/_version_guard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Fail fast with a clear error on an incomplete agentex-client install instead
of a cryptic `cannot import name ... from agentex.types`."""

from __future__ import annotations

from importlib.metadata import PackageNotFoundError, version


def _installed(package: str) -> str:
try:
return version(package)
except PackageNotFoundError:
return "unknown"


def verify_client_compatibility() -> None:
# Canary on the client REST surface, not the version: newer clients are fine
# (additive); we only fail if a symbol/resource the ADK needs is absent.
try:
from agentex.types import Event as _Event # noqa: F401
from agentex.resources import states as _states # noqa: F401
except (ImportError, AttributeError) as exc:
raise ImportError(
f"agentex-sdk could not import the agentex-client REST surface it "
f"depends on (agentex-sdk={_installed('agentex-sdk')}, "
f"agentex-client={_installed('agentex-client')}). Reinstall both at a "
f"compatible version, e.g. `pip install --force-reinstall agentex-sdk`."
) from exc
26 changes: 26 additions & 0 deletions tests/lib/test_version_guard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""Tests for the agentex-client compatibility guard (0.13.0 split regression)."""

from __future__ import annotations

import pytest

import agentex.lib._version_guard as guard


def test_passes_when_surface_present() -> None:
guard.verify_client_compatibility() # full client surface installed


def test_newer_client_not_rejected(monkeypatch: pytest.MonkeyPatch) -> None:
# Version is not a gate: a newer client (additive) with the full surface passes.
monkeypatch.setattr(guard, "version", lambda pkg: "0.14.0" if pkg == "agentex-client" else "0.13.0")
guard.verify_client_compatibility()


def test_raises_when_client_surface_incomplete(monkeypatch: pytest.MonkeyPatch) -> None:
import agentex.types

# A partial install missing a needed symbol fails with an actionable error.
monkeypatch.delattr(agentex.types, "Event", raising=False)
with pytest.raises(ImportError, match="could not import the agentex-client REST surface"):
guard.verify_client_compatibility()
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading