Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
ae1d4be
feat(agents): agents follow the env's clock the way computers do (FD-…
williamloo-scale Nov 16, 2026
eea933c
refactor(agents): leave the Claude Code image to its own PR; agents s…
williamloo-scale Nov 17, 2026
608a93d
Merge origin/main
williamloo-scale Nov 17, 2026
182cef0
feat(agents): the Claude Code image follows the env's clock (FD-5916)
williamloo-scale Nov 17, 2026
bce00d4
fix(agents): agent clock review: new config's status, one clock per a…
williamloo-scale Nov 17, 2026
84381b8
fix(agents): keep each agent's clock record on a key of its own; a re…
williamloo-scale Nov 17, 2026
56dac45
fix(agents): agent clock keys can't collide; one clock env per agent;…
williamloo-scale Nov 17, 2026
c726743
chore: drop test run output committed by mistake
williamloo-scale Nov 17, 2026
5e8c756
Merge #714
williamloo-scale Nov 17, 2026
3b6f499
test(agents): the Claude Code image follows the env's clock end to en…
williamloo-scale Nov 17, 2026
cecc686
fix(agents): a failed agent sync retires its follower; the task's zon…
williamloo-scale Nov 17, 2026
afe55b4
Merge origin/main
williamloo-scale Nov 17, 2026
d523a6e
Merge #714
williamloo-scale Nov 17, 2026
ac0a39e
fix(agents): libfaketime's init can't deadlock the CLI; the CLI goes …
williamloo-scale Nov 17, 2026
c8ed6e1
fix(agents): a later clock sync leaves agents teardown_sandboxes took…
williamloo-scale Nov 17, 2026
b5d3b4b
fix(ci): the agent clock e2e skips as a declared capability gap; the …
williamloo-scale Nov 17, 2026
25af21a
chore: drop test-run output committed again, and ignore where the pro…
williamloo-scale Nov 17, 2026
7216c7c
fix(agents): route the CLI through egress by the clock page's armed f…
williamloo-scale Nov 17, 2026
fc3134b
Merge #714
williamloo-scale Nov 17, 2026
f8bd9ff
feat(a2a-agent): validate clock/v1 by the time the agent's own comman…
earakely-scale Nov 17, 2026
f9af1b6
refactor(a2a-agent): name the clock validation's timeouts and error l…
williamloo-scale Nov 17, 2026
43fdb97
fix(gateway): get_time says the machine's clock may not be synchroniz…
earakely-scale Nov 18, 2026
8bf8e4c
refactor(a2a-agent): move agent_clock to a2a_agent/clock.py, beside t…
earakely-scale Nov 18, 2026
810f42e
Merge #714
williamloo-scale Nov 18, 2026
686fdf1
test(agents): the agent clock e2e imports FOLLOWING_KEY from a2a_agen…
williamloo-scale Nov 18, 2026
9d7d6c0
Merge origin/main (#714 merged)
williamloo-scale Nov 18, 2026
1ff90bd
fix(agents): the Claude Code image installs protocol 0.1.575, the fir…
earakely-scale Nov 18, 2026
ca97b37
fix(computers): the clock follower follows a changed config while its…
earakely-scale Nov 18, 2026
0875e06
fix(agents): an armed clock keeps the agent's own NO_PROXY hosts dire…
williamloo-scale Nov 18, 2026
bb4f07f
test(agents): the agent clock checks run over every clocked agent ima…
williamloo-scale Nov 18, 2026
e64e871
feat(agents): the Gemini image follows the env's clock (FD-5916)
williamloo-scale Nov 18, 2026
a3f9e34
Merge main into #726: the clock and egress proxy now live in utils (#…
earakely-scale Nov 18, 2026
3c60fda
refactor(agents): the Claude Code image takes the clock and egress pr…
earakely-scale Nov 18, 2026
c43b294
Merge #726: the clock and egress proxy come from utils
williamloo-scale Nov 18, 2026
150c563
test(agents): Claude Code's contract test takes the folders shared_so…
williamloo-scale Nov 18, 2026
5bfe6dc
refactor(agents): the image takes the clock and egress proxy from uti…
williamloo-scale Nov 18, 2026
0a9d2be
Merge #726
williamloo-scale Nov 18, 2026
c65c5e6
test(agents): the contract test takes the folders shared_sources.toml…
williamloo-scale Nov 18, 2026
aed27ee
fix(agents): a private HTTPS model endpoint is reached directly on an…
williamloo-scale Nov 18, 2026
642c612
fix(agents): a private HTTPS model endpoint is reached directly on an…
williamloo-scale Nov 18, 2026
6f09361
Merge #726
williamloo-scale Nov 18, 2026
987da31
test(agents): the clock test's HTTPS model hosts resolve publicly wit…
williamloo-scale Nov 18, 2026
a6f3720
fix(agents): the model host's lookup is bounded and kept, so a slow r…
williamloo-scale Nov 18, 2026
62be360
fix(agents): the model host's lookup is bounded and kept, as #726's is
williamloo-scale Nov 18, 2026
5a6a42a
Merge #726
williamloo-scale Nov 18, 2026
ac0ea75
Merge main (#726 merged)
williamloo-scale Nov 18, 2026
1ab2e3f
refactor(agents): follow the merged Claude Code image (#726): the pro…
williamloo-scale Nov 18, 2026
11eb021
fix(agents): keep a provider's CA bundle trusted, and send HTTPS MCP …
williamloo-scale Nov 18, 2026
fdefbf3
Merge main: the control token (#780, #784)
williamloo-scale Nov 19, 2026
6bc6be3
Merge remote-tracking branch 'origin/main' into wloo/gemini-clock-image
williamloo-scale Nov 19, 2026
8fbb207
Merge remote-tracking branch 'origin/main' into wloo/gemini-clock-image
williamloo-scale Nov 19, 2026
4b6538a
refactor(gemini): take the shared egress rule (#818)
williamloo-scale Nov 19, 2026
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
48 changes: 43 additions & 5 deletions src/agent_env/agents/agents/gemini/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# The env's clock: the egress proxy, one static Go binary, and agent-env's libfaketime and its TLS shim, taken from
# agent-env's sources as clock/ and egress/ (shared_sources.toml) and built for this image's libc (Debian bookworm) in
# stages of their own, so no toolchain is left in the image.
FROM public.ecr.aws/docker/library/golang:1.26.11-bookworm@sha256:dc40a13b61304647ed7e5d581d246b86413dfc29d63c6d018310feb93cd98fc0 AS egress
COPY egress/ /egress/
RUN cd /egress && go vet ./... && go test -count=1 ./... \
&& CGO_ENABLED=0 GOFLAGS=-mod=readonly go build -trimpath -ldflags=-s -o /out/egress .

FROM public.ecr.aws/docker/library/python:3.11-slim@sha256:c20888b6acdd1e63e1c433a185bf3ad162c0288fe484616ce062e0d28add2900 AS clock
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential patch curl ca-certificates
COPY clock/ /clock/
RUN sh /clock/build.sh /out

FROM public.ecr.aws/docker/library/python:3.11-slim@sha256:c20888b6acdd1e63e1c433a185bf3ad162c0288fe484616ce062e0d28add2900
# Node for the Gemini CLI, checked against its published checksum; install.sh brings the same.
ARG NODE_VERSION=22.23.3
Expand All @@ -21,13 +35,37 @@ COPY requirements.txt model-requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt -r model-requirements.txt
# install.sh and run.sh are install/v1's: in the image, so they stay in its build context.
COPY a2a_server.py gemini_bridge.py gemini_changelog.py gemini_config.py gemini_kit.py entrypoint.sh install.sh run.sh ./
# The CLI's cwd and file-tool boundary, /workspace, and its state, fixed so neither follows the uid: Modal runs the
# image as root. /app is kept, empty and writable, for tasks that name it.
# Every clocked agent's egress rule, which the bridge imports, and the clock page's format it reads (shared_sources.toml).
COPY agent_clock/agent_egress.py clock/clockpage.py ./
# The CLI's cwd and file-tool boundary, /workspace, and its state, fixed so neither follows the uid. /app is kept,
# empty and writable, for tasks that name it.
RUN useradd --create-home --uid 10001 agent && mkdir -p /workspace/inputs /app /home/agent/.gemini \
&& chown agent:agent /workspace /workspace/inputs /app /home/agent/.gemini && chmod 0755 entrypoint.sh
# The env's clock: the follower and the egress proxy, each as its own user, under root's supervisord (root.conf), and
# agent-env's libfaketime and its TLS shim preloaded into every process, faking only the agent's (clock.conf). The
# follower's config is the agent's user's to write (agentenv_protocol.a2a_agent.clock) and the follower's to read.
RUN pip install --no-cache-dir supervisor==4.2.5 \
&& useradd --system --no-create-home --home-dir /nonexistent --shell /usr/sbin/nologin agentenv-clock \
&& useradd --system --no-create-home --home-dir /nonexistent --shell /usr/sbin/nologin agentenv-egress \
&& mkdir -p /usr/local/lib/agentenv-clock /usr/local/lib/agentenv-egress /etc/agentenv \
&& install -d -o agent -g agentenv-clock -m 2750 /etc/agentenv/clock \
&& touch /etc/agentenv/ca.pem \
&& cp /etc/ssl/certs/ca-certificates.crt /etc/agentenv/ca-bundle.pem \
&& cp /etc/ssl/certs/ca-certificates.crt /usr/local/lib/agentenv-egress/roots.pem
COPY --from=clock /out/libfaketimeMT.so.1 /out/libtls_realtime.so /usr/local/lib/agentenv-clock/
COPY --from=egress /out/egress /usr/local/lib/agentenv-egress/egress
COPY clock/clockpage.py clock/clock-follower /usr/local/lib/agentenv-clock/
COPY clock/clock.conf /etc/agentenv/clock.conf
COPY root.conf /etc/agentenv/root.conf
COPY start-agent /usr/local/bin/start-agent
RUN sed -i -e "s/^AGENTENV_SESSION_UID=.*/AGENTENV_SESSION_UID=$(id -u agent)/" \
-e "s/^AGENTENV_CLOCK_PAGE_UID=.*/AGENTENV_CLOCK_PAGE_UID=$(id -u agentenv-clock)/" /etc/agentenv/clock.conf \
&& chmod 0755 /usr/local/lib/agentenv-clock/clock-follower /usr/local/bin/start-agent \
&& printf '%s\n' /usr/local/lib/agentenv-clock/libfaketimeMT.so.1 /usr/local/lib/agentenv-clock/libtls_realtime.so \
> /etc/ld.so.preload
ENV A2A_PORT=8000 PYTHONPATH=/opt/agent GEMINI_CLI_HOME=/home/agent GEMINI_CWD=/workspace
USER agent
WORKDIR /workspace
EXPOSE 8000
# CMD rather than ENTRYPOINT: Modal passes a sandbox's env to the image's CMD only.
CMD ["/opt/agent/entrypoint.sh"]
# Starts as root, which start-agent needs for the clock; the A2A server and the CLI run as the agent's user. CMD rather
# than ENTRYPOINT: Modal passes a sandbox's env to the image's CMD only.
CMD ["/usr/local/bin/start-agent"]
5 changes: 4 additions & 1 deletion src/agent_env/agents/agents/gemini/a2a_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
chats_dir_for_cwd,
cli_env,
cli_model,
clock_armed,
detect_format,
find_session_file,
gemini_request_to_openai,
Expand Down Expand Up @@ -566,7 +567,9 @@ async def run(self, request: TaskRequest[GeminiConfig]) -> TaskResult:
attachment_paths=attachment_paths or None,
timeout_s=cfg.timeout_seconds,
event_callback=lambda event: self._on_event(event, request),
env=cli_env(os.environ, system_settings=settings, base_url=base_url),
env=cli_env(os.environ, system_settings=settings, base_url=base_url,
clock_armed=clock_armed(),
mcp_urls=[str(info.get("url") or "") for info in (request.mcp_servers or {}).values()]),
cwd=GEMINI_CWD,
other_sessions=lambda: {*self.bound_session_refs(), *self._claimed_sessions} - {own},
)
Expand Down
21 changes: 18 additions & 3 deletions src/agent_env/agents/agents/gemini/gemini_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
import signal
import threading
import time
from collections.abc import Callable, Collection, Mapping
from collections.abc import Callable, Collection, Iterable, Mapping
from dataclasses import dataclass, field
from datetime import datetime, timezone
from pathlib import Path

# clock_armed is re-exported: a2a_server reads the clock page through this module.
from agent_egress import clock_armed as clock_armed, egress_env
from gemini_config import SYSTEM_SETTINGS_ENV, gemini_home

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -274,16 +276,29 @@ def model_headers(raw: str | None) -> dict[str, str]:
return {str(name): str(value) for name, value in headers.items()}


def cli_env(environ: Mapping[str, str], *, system_settings: Path, base_url: str | None) -> dict[str, str]:
#: The proxy variables the CLI itself reads (its config's proxy): it routes every request it makes through that proxy,
#: NO_PROXY or not, so its model calls to the attribution proxy on 127.0.0.1 and its MCP servers would meet a proxy
#: that refuses them.
_CLI_PROXY_VARS = ("HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy")


def cli_env(environ: Mapping[str, str], *, system_settings: Path, base_url: str | None,
mcp_urls: Iterable[str] = (), clock_armed: bool = False) -> dict[str, str]:
"""The CLI's environment for one run: this process's, with the endpoint's key under the name the CLI reads, its
model calls sent to ``base_url`` (the attribution proxy, for this run) unless the environment names its own
endpoint, and the run's own system settings."""
endpoint, and the run's own system settings. On an armed clock (``clock_armed``) the commands the model runs go
out through the egress proxy (``egress_env``, given the model endpoint's URL and the env's MCP servers', ``mcp_urls``),
by ALL_PROXY alone; the CLI itself, which would send everything through a proxy it's handed, NO_PROXY or not, goes
out directly."""
env = dict(environ)
if env.get("LITELLM_API_KEY") and not env.get("GEMINI_API_KEY"):
env["GEMINI_API_KEY"] = env["LITELLM_API_KEY"]
if base_url and not environ.get("GOOGLE_GEMINI_BASE_URL"):
env["GOOGLE_GEMINI_BASE_URL"] = base_url
env[SYSTEM_SETTINGS_ENV] = str(system_settings)
urls = [env.get("GOOGLE_GEMINI_BASE_URL", ""), env.get("LITELLM_BASE_URL", ""), *mcp_urls]
egress = egress_env(environ, urls, armed=clock_armed)
env.update({name: value for name, value in egress.items() if name not in _CLI_PROXY_VARS})
return env


Expand Down
4 changes: 2 additions & 2 deletions src/agent_env/agents/agents/gemini/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ START_TIMEOUT_S=120
STOP_TIMEOUT_S=10
dockerfile_arg() { sed -n "s/^ARG $1=//p" "$here/Dockerfile"; }
NODE_VERSION=$(dockerfile_arg NODE_VERSION)
AGENT_FILES="a2a_server.py gemini_bridge.py gemini_changelog.py gemini_config.py gemini_kit.py requirements.txt run.sh"
AGENT_FILES="a2a_server.py gemini_bridge.py gemini_changelog.py gemini_config.py gemini_kit.py requirements.txt run.sh agent_clock/agent_egress.py clock/clockpage.py"

# put SRC DEST replaces DEST by a rename, so a binary an earlier install's agent still runs can be replaced; put_dir SRC
# DEST copies a folder to DEST, which isn't there.
Expand Down Expand Up @@ -132,7 +132,7 @@ put "$stage/agent.env" "$root/agent.env"
put "$here/package.json" "$root/npm/package.json"
put "$here/package-lock.json" "$root/npm/package-lock.json"
for file in $AGENT_FILES; do
put "$here/$file" "$root/app/$file"
put "$here/$file" "$root/app/${file##*/}"
done
on "chmod 0600 $r/agent.env && chmod 0755 $r/bin/uv $r/bin/gemini $r/app/run.sh"

Expand Down
62 changes: 62 additions & 0 deletions src/agent_env/agents/agents/gemini/root.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
; Root's supervisord (start-agent, FD-5916): the clock follower and the egress proxy, each as its own user, on real
; time, and the A2A server as the agent's user. The server starts with the real-time marker, which agent-env's
; libfaketime takes out of its environment, so the server's own records keep real timestamps and everything it starts,
; the CLI and the model's commands, reads the env's time. Its socket and logs are root's alone, so the agent's user can
; neither stop nor restart any of them. The follower follows nothing until the server writes its config, which
; sync_env_clock has it do, then picks it up within a quarter second.
[supervisord]
nodaemon=true
user=root
logfile=/var/log/agentenv-root/supervisord.log
pidfile=/run/agentenv-root/supervisord.pid
childlogdir=/var/log/agentenv-root

[unix_http_server]
file=/run/agentenv-root/supervisor.sock
chmod=0700

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///run/agentenv-root/supervisor.sock

[program:clock]
command=/usr/local/bin/python3 -I /usr/local/lib/agentenv-clock/clock-follower
user=agentenv-clock
directory=/
priority=3
autorestart=true
startsecs=1
startretries=1000
redirect_stderr=true
stdout_logfile=/var/log/agentenv-root/clock.log
environment=HOME="/nonexistent",USER="agentenv-clock",LOGNAME="agentenv-clock"

[program:egress]
command=/usr/local/lib/agentenv-egress/egress serve
user=agentenv-egress
directory=/
priority=3
autorestart=true
startsecs=1
startretries=1000
redirect_stderr=true
stdout_logfile=/var/log/agentenv-root/egress.log
environment=HOME="/nonexistent",USER="agentenv-egress",LOGNAME="agentenv-egress",AGENTENV_EGRESS_PRIVATE="allow"

; uvicorn itself, not entrypoint.sh: the marker holds for the process it's given to alone, and a shell that execs
; uvicorn would hand uvicorn an environment without it.
[program:agent]
command=/usr/local/bin/python3 -m uvicorn a2a_server:app --host 0.0.0.0 --port %(ENV_A2A_PORT)s --timeout-graceful-shutdown 5
user=agent
directory=/workspace
priority=10
autorestart=true
stopasgroup=true
killasgroup=true
stopwaitsecs=30
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
environment=HOME="/home/agent",USER="agent",LOGNAME="agent",AGENTENV_REAL_TIME="1",AGENTENV_EGRESS_PROXY="http://127.0.0.1:3128",NODE_EXTRA_CA_CERTS="/etc/agentenv/ca.pem",SSL_CERT_FILE="/etc/agentenv/ca-bundle.pem",REQUESTS_CA_BUNDLE="/etc/agentenv/ca-bundle.pem"
5 changes: 5 additions & 0 deletions src/agent_env/agents/agents/gemini/shared_sources.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# What this image's build context takes from agent-env's own sources, at the name its Dockerfile copies it from: one
# copy of each, shared with the other images that take it (utils/docker/context.py). Paths are under src/agent_env.
clock = "utils/faketime_clock"
egress = "utils/egress_proxy"
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
agent_clock = "utils/agent_clock"
30 changes: 30 additions & 0 deletions src/agent_env/agents/agents/gemini/start-agent
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
# The image's start (FD-5916). As root, it makes what the agent's user must not touch, the clock page and file (the
# clock user's from their first byte) and the egress proxy's CA (its key the egress user's alone, trusted in the
# system store, agent-env's trust files and every certifi bundle), then starts root's supervisord (root.conf), which
# runs the clock follower and the egress proxy, each as its own user on real time, and the A2A server as the agent's
# user on real time, everything it starts reading the env's time from the page. Until sync_env_clock has the agent
# follow a clock, the page holds real time and the proxy relays TLS untouched. Started as another user, the image runs
# the A2A server alone, as before, on real time.
set -eu
if [ "$(id -u)" != 0 ]; then
exec /opt/agent/entrypoint.sh
fi
install -d -o root -g root -m 0700 /var/log/agentenv-root /run/agentenv-root
install -d -o agentenv-clock -g agentenv-clock -m 0755 /run/agentenv-clock
python3 -I /usr/local/lib/agentenv-clock/clockpage.py create agentenv-clock
AGENTENV_SESSION_USER=agent AGENTENV_EGRESS_NSS=off \
/usr/local/lib/agentenv-egress/egress boot > /var/log/agentenv-root/egress-boot.log 2>&1 \
|| { cat /var/log/agentenv-root/egress-boot.log >&2; echo "the egress proxy's boot failed" >&2; exit 2; }
# A provider's own CA bundle stays trusted: Sail, for one, points SSL_CERT_FILE and the like at the bundle it signs
# model requests under, and root.conf points the server's trust at agent-env's bundles instead, so the provider's goes
# into them, and into the egress proxy's roots, which carry those requests once the clock is armed.
for bundle in "${SSL_CERT_FILE:-}" "${REQUESTS_CA_BUNDLE:-}" "${NODE_EXTRA_CA_CERTS:-}" "${CURL_CA_BUNDLE:-}"; do
case "$bundle" in ""|/etc/agentenv/*) continue ;; esac
[ -r "$bundle" ] || continue
for target in /etc/agentenv/ca-bundle.pem /etc/agentenv/ca.pem /usr/local/lib/agentenv-egress/roots.pem; do
grep -qxF "# agentenv: $bundle" "$target" 2>/dev/null && continue
{ printf '\n# agentenv: %s\n' "$bundle"; cat "$bundle"; } >> "$target"
done
done
exec supervisord -c /etc/agentenv/root.conf
1 change: 1 addition & 0 deletions tst/integration/task_step/test_agent_env_clock_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class Agent:
AGENTS = {
"claude-code": Agent(bridge="claude_bridge", version=("claude", "--version"), shows="(Claude Code)",
turn=_claude_turn),
"gemini": Agent(bridge="gemini_bridge", version=("gemini", "--version"), shows="0.38.2"),
"opencode": Agent(bridge="opencode_bridge", version=("opencode", "--version"), shows="1.17.18"),
}

Expand Down
12 changes: 9 additions & 3 deletions tst/unit/agents/gemini/agent.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
"""The Gemini agent's modules, imported from its folder as its image runs them: by their own names, from the folder on
the path."""
"""The Gemini agent's modules, imported as its image runs them: by their own names, from its folder and from the folders
its build context takes as agent_clock/ and clock/, whose modules the image copies beside the bridge."""

import importlib
import importlib.util
import os
import sys
from pathlib import Path

import agent_env
from tst.util.build_context import sent

AGENT_DIR = Path(agent_env.__file__).parent / "agents" / "agents" / "gemini"
sys.path.insert(0, str(AGENT_DIR))
IMPORTED = [str(AGENT_DIR), str(sent(AGENT_DIR, "agent_clock/agent_egress.py").parent),
str(sent(AGENT_DIR, "clock/clockpage.py").parent)]
PYTHONPATH = os.pathsep.join(IMPORTED)
sys.path[:0] = IMPORTED
gemini_config = importlib.import_module("gemini_config")
gemini_kit = importlib.import_module("gemini_kit")
gemini_changelog = importlib.import_module("gemini_changelog")
gemini_bridge = importlib.import_module("gemini_bridge")
agent_egress = importlib.import_module("agent_egress")
# By its path: another agent's a2a_server, imported by the same name, may be loaded already.
_spec = importlib.util.spec_from_file_location("gemini_a2a_server", AGENT_DIR / "a2a_server.py")
a2a_server = importlib.util.module_from_spec(_spec)
Expand Down
4 changes: 2 additions & 2 deletions tst/unit/agents/gemini/test_card_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import subprocess
import sys

from tst.unit.agents.gemini.agent import AGENT_DIR, a2a_server
from tst.unit.agents.gemini.agent import AGENT_DIR, PYTHONPATH, a2a_server
from tst.unit.agents.gemini.support import card

_GEMINI_SKILL = {
Expand Down Expand Up @@ -232,7 +232,7 @@ def test_install_mode_reads_the_card_by_importing_agent_card():
"from a2a_server import AGENT_CARD; "
"print(json.dumps(AGENT_CARD.model_dump()))"
)
env = {k: v for k, v in os.environ.items() if not k.startswith("LITELLM_")}
env = {**{k: v for k, v in os.environ.items() if not k.startswith("LITELLM_")}, "PYTHONPATH": PYTHONPATH}
out = subprocess.run([sys.executable, "-c", script], cwd=AGENT_DIR, env=env, capture_output=True, text=True,
check=True)
exported = json.loads(out.stdout)
Expand Down
Loading
Loading