Skip to content

[FD-5916] feat(agents): the Claude Code image follows the env's clock - #726

Merged
earakely-scale merged 37 commits into
mainfrom
wloo/claude-code-clock-image
Nov 18, 2026
Merged

earakely-scale merged 37 commits into
mainfrom
wloo/claude-code-clock-image

Conversation

@williamloo-scale

@williamloo-scale williamloo-scale commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The image half of FD-5916. The framework half, #714, has merged. With it, the Claude Code image runs the clock follower, which makes the A2A server serve clock/v1's sync_time. Once a task sets the clock, the CLI and every command the model runs read the env's time, datetime.now() included.

What changes

  • The image takes the clock library and the egress proxy from utils/faketime_clock and utils/egress_proxy through a shared_sources.toml, as the computer bases do since [FD-5700] refactor(computers): the clock library and the egress proxy live once, in utils, and each image takes them #763 (FD-5700). It holds no copy; its Dockerfile still copies from clock/ and egress/.
  • The egress proxy (utils/egress_proxy) gains AGENTENV_SESSION_USER and AGENTENV_EGRESS_NSS=off. Defaults are unchanged.
  • New start-agent and root.conf: root's supervisord runs the follower, the proxy and the A2A server. libfaketime is preloaded for the agent's user only. The A2A server starts with the real-time marker.
  • claude_bridge.py routes the CLI through the egress proxy while the clock page holds an armed clock. clock_armed reads the page libfaketime reads, so a follower that is reconnecting or restarting doesn't change the answer. It reaches the env's MCP hosts and a plain-HTTP model endpoint directly. When the clock isn't set, the CLI goes out directly, as before.
  • libfaketime init guard (from review): the CLI read the clock during libfaketime's init, and pthread_once waited on itself, so claude --version never returned. That, not the proxy, was [FD-5916] feat(agents): agents can follow the env's clock the way computers do #714's CI timeout. The guard is in the shared utils/faketime_clock/libfaketime.patch, so the computer bases build it too. A unit test checks the patch has it.
  • Model endpoints on an armed clock: a plain-HTTP endpoint is reached directly, since it has no certificate to check at the env's date. An HTTPS one, public or private, goes through the egress proxy, which checks its certificate on real time. Going direct, Claude Code would check it at the env's date, and fail once that date is outside the certificate's validity. The proxy takes AGENTENV_EGRESS_PRIVATE=allow, which this image's root.conf sets: it then also reaches private networks' addresses (RFC 1918, RFC 6598, IPv6 unique local), which the agent's processes can reach directly anyway. Loopback, link-local and the rest stay refused, and the computer bases don't set it.
  • Protocol floor raised to >=0.1.575, the release that carries [FD-5916] feat(agents): agents can follow the env's clock the way computers do #714. The image is rebuilt only when this folder changes, so the floor is what makes the shipped image serve clock/v1.
  • Clock follower fix, in utils/faketime_clock/clock-follower, which the bases and this image take. After a failed watch, the follower noticed a changed config only when a watch hung for a quarter second. With a gateway that refused at once, it retried the old URL in a tight loop, using about 0.6 of a core. It never followed the new config, and every write that waited for it answered 504. It now checks the config after each failed watch. test_computer_clock_follower.py has a regression test.
  • New tst/integration/task_step/test_agent_env_clock_local.py: the end-to-end test below. It skips unless AGENTENV_E2E_CLAUDE_CODE_IMAGE names an image built from this branch.

End-to-end test (local Docker)

This and the next section ran before the image moved onto the shared folders; the files the image builds from are the same, plus the guard now reaching the bases.

The image was built from this branch, with the branch's protocol installed on top, because PyPI had no CLOCK_V1 yet. The test ran it with a real env, gateway and follower. It passes in 57 s.

  • Build: the image builds, including the copied Go proxy tests and libfaketime. The follower, the proxy and the A2A server each run as their own user, and the card offers sync_time.
  • Before the clock is set: the agent user's date shows real time.
  • sync_env_clock (require_agent_clock=True): the agent follows, and its sync_time answers once the follower shows the gateway's version.
  • With the clock frozen at 2031-03-04T05:06:07Z:
    • date shows 2031-03-04T05:06:07Z;
    • datetime.now() shows 2031-03-04T05:06:07+00:00;
    • date with the AGENTENV_REAL_TIME=1 marker shows real time.
  • claude --version returns under the preload.
  • One turn of the real CLI against a stub Messages endpoint, with the clock set: its Today's date is line was 2031-03-04, and a Bash date the model ran printed 2031-03-04T05:06:07Z.
  • Clock writes that wait for followers: one is acknowledged in 0.01 s, and date shows the new time at once. With the container paused, one answers 504 with stale: ["agent-solver"] after its 3 s wait. Once unpaused, the follower catches up on its own.
  • After teardown_sandboxes: the follower is removed from the gateway, and writes no longer wait for the agent.

E2E and chaos on a Linux VM

Re-run at 150c563a (2026-11-18), with the image the bundle builds from the shared folders and the init guard in the shared patch: every case below passed again, in 7 minutes. Separately, test_agent_env_clock_local.py passed against an image build_image built at 3c60fda1.

The image was built by the bundle from this branch, with protocol 0.1.575 from PyPI and no workarounds. The run used a real gateway env and a stub Messages endpoint that runs the model's Bash calls. The clock was armed at 2026-05-04 09:30 America/Chicago.

  • Following: sync_env_clock armed in 0.34 s, and the gateway saw agent-solver at its current version.
  • What the model sees: a Bash date, Python and Node read 2026-05-04T09:30-05:00 (CDT). Root, and the A2A server's records, stay on real time. The CLI's date line said 2026-05-04, then 2026-01-02 after a jump back.
  • TLS at a date months off: curl, pip, Python urllib, Node fetch, and the CLI itself all went through egress. The CLI reached api.anthropic.com and got "Invalid API key" back from a bogus key.
  • Clock changes: jumps forward and back, advance, freeze and 3600× were all seen at once. Five jumps during a live turn showed up in order.
  • Late deploy: an agent deployed after arming follows on its own. Two followers both acknowledge a write. A paused one gets a 504 naming it, and catches up when unpaused.
  • kill -9 of the follower, the egress proxy and the A2A server: each restarts under supervisord and the clock keeps following. The zone survives the A2A server's restart.
  • A failed sync_time: the follower is retired, and later writes answer 200 at once.
  • Follower detached while the page is armed: the CLI still goes through egress. After clear, it reads real time and goes out directly.
  • Detach, then reattach: the agent follows again at once. This is the case that found the follower bug above.
  • The A2A validator's clock/v1 check on this image's Claude Code agent records supported: true.
  • test_agent_env_clock_local.py passes against the image.

arm64 (EC2 Mac, colima, at 660d8163 and 8848ea0f)

  • Computer: agent-env run desktop --task probe --no-emulate composes ubuntu-24.04 with the reference driver natively for arm64 and passes the probe at full. The composed computer carries the clock library, follower and page.
  • Claude Code image: the bundle builds it for arm64 from the shared folders in 84 s. All three e2e and chaos drivers pass in 7 minutes, with the same results as on amd64.
  • Private networks: the arm64 image's proxy logs "private_networks": true. It reaches a private address ("allowed": "private"), and still answers 403 for loopback and link-local. Public TLS through it answers 200.
  • The Mac's Homebrew Docker CLI needed the buildx and compose plugins (brew install docker-buildx docker-compose); without them the composer's --network build and the gateway's docker compose fail.

Known limits and follow-ups

  • The image starts as root instead of USER agent. The CLI and the model's commands still run as agent.
  • No run against a real model yet. The CLI's own model traffic through egress was checked against api.anthropic.com with a bogus key.
  • A gateway restart loses the clock and its declarations. The agent follows again once the clock is re-armed, but writes no longer wait for it.
  • test_agent_env_clock_local.py skips in CI, because no job builds agent images. The release's claude --version smoke would catch a broken CLI, but it has no timeout.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The changes since the previous review appear safe to merge.

Summary

The PR makes Claude Code follow the environment’s clock while keeping its server and certificate checks on real time.

  • Claude Code agents follow the task environment’s clock.
  • Claude Code routes armed-clock TLS traffic through egress.
  • Clock followers check for new settings after a failed watch.
  • Clock reads during libfaketime startup no longer wait on startup itself.

No new issues found in the changes since the previous review. The duplicate-settings finding is fixed; a strict configuration parse passed.

Reviews (13) · Last reviewed commit: "fix(agents): the egress proxy's private-..." · Reviewed by Greptile

williamloo-scale and others added 4 commits November 16, 2026 11:29
…5916)

Prototype of the Agents on the Env Clock design, to size the change. The gateway takes followers declared after it
starts; every AgentEnvAgent in an image that runs the clock follower serves clock/v1 sync_time; sync_env_clock and
deploy_agent declare each agent as a follower and hand it its config; the Claude Code image runs the computer base's
follower, egress proxy and libfaketime, copied in until FD-5700; get_time no longer calls the machine's clock unsynced.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…kip unless require_agent_clock

The image's changes move to wloo/claude-code-clock-image, along with the computer base's egress options only it uses:
on CI the image's Claude Code timed out reaching the test's model endpoint. What stays serves sync_time for an agent
whose image runs the follower and is otherwise inert. An agent that can't follow is now skipped even when
tolerate_missing_sync_time is false, which stays about the env's servers; require_agent_clock fails the step instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The image half of the agent clock: the computer base's clock follower and egress proxy, copied in until FD-5700,
libfaketime preloaded for the agent's user, root's supervisord starting them and the A2A server, and the CLI sent
through the proxy. Needs #714 and an agentenv-protocol release with CLOCK_V1.

Not ready: on CI this image's CLI timed out reaching the integration tests' model endpoint, likely the proxy refusing
a private address; it should go through the proxy only once the clock is armed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale and others added 6 commits November 16, 2026 16:37
…gent, retire on teardown

- An agent's sync_time takes only a status of the config it just wrote (its URL and name, written after it), so what
  the follower showed of an earlier gateway or token never passes for success.
- An agent follows one env's clock; another env's is skipped as follows_another_env, as its one follower can't watch
  two gateways. deploy_agent's late follows are recorded with the sync's, so both see it.
- teardown_sandboxes retires a torn-down agent's follower (DELETE /clock/followers, retire_follower), so later writes
  don't wait for it or answer 504 naming it. A declaration no longer replaces a follower the gateway started with.
- Logs say an outcome's synced, reason and follower, never the agent's answer; the timeouts, token size and error
  length are named constants.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tirement wakes waiting writes

- Which env an agent follows moves from clock_configurations' items to metadata.agent_clock_following, one key per
  agent, so late deploy_agent steps that save at once never overwrite each other's record and teardown still finds it.
- Retiring a follower notifies writes waiting for it, and a watch by a follower retired meanwhile acknowledges nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… retire however its sandbox goes

- Agent names are percent-encoded into their metadata keys, so team.solver and team_solver never share a record.
- An agent follows the clock of the first env it's registered with, fixed by the agent alone, so two steps arming two
  of its envs at once never both take its one follower.
- teardown_sandboxes retires the follower of every agent whose sandbox it takes down, by agent, sandbox or env name.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…d on local Docker (FD-5916)

Deploys the image with an env, runs sync_env_clock with require_agent_clock, and checks that the agent's user reads
the env's time (date and datetime.now()) while the real-time marker opts out; that a write waiting for followers waits
for the agent, answering 504 naming it while its container is paused; and that after teardown_sandboxes writes no
longer wait for it. Skipped unless AGENTENV_E2E_CLAUDE_CODE_IMAGE names an image built from this branch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
-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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Blocker: with this preload the Claude Code CLI deadlocks at startup. claude --version never returns, as the agent user or root, armed or not.

  • Without /etc/ld.so.preload it returns at once.
  • Preloading only libtls_realtime.so is fine; preloading only libfaketimeMT.so.1 hangs.
  • gdb on the hung process: clock_gettime → ftpl_init → pthread_once waiting on itself (futex, single thread). Upstream 0.9.12's own comment at that call says "If ftpl_init ends up recursing, pthread_once will deadlock."

I think this, not the proxy, is the claude CLI timed out after 600s on #714's CI: the CLI never gets as far as a request.

A per-thread guard fixed it on my box: a clock call made while libfaketime's init is running reads the kernel clock instead of waiting. With it, the whole flow worked end to end:

  • the CLI's Today's date is line and the model's commands followed the env's clock, including jumps during a turn;
  • the CLI reached api.anthropic.com through egress at a date outside its certificate.

The computer base ships the same patch, so other programs on computers that call the clock this way might freeze too; I haven't checked that.

The guard I tested (on top of libfaketime.patch)
--- a/src/libfaketime.c
+++ b/src/libfaketime.c
@@ -329,6 +329,9 @@
   check_missing_real(#name, (NULL == real_##name))
 
 static pthread_once_t initialized_once_control = PTHREAD_ONCE_INIT;
+/* Set on the thread running ftpl_really_init: a time call it makes, as an allocator that reads the clock does when
+ * dlsym allocates, takes the kernel's clock instead of waiting on the init it is part of. */
+static __thread int ftpl_initializing = 0;
 
 /* prototypes */
 static int    fake_gettimeofday(struct timeval *tv);
@@ -2326,6 +2329,7 @@
   int result;
 
   ftpl_init();
+  if (ftpl_initializing) return syscall(SYS_clock_gettime, clk_id, tp);
   // If ftpl_init ends up recursing, pthread_once will deadlock.
   // (Previously we attempted to detect this situation, and bomb out,
   // but the approach taken wasn't thread-safe and broke in practice.)
@@ -3103,8 +3107,15 @@
   dont_fake = dont_fake_final;
 }
 
+static void ftpl_really_init_guarded(void) {
+  ftpl_initializing = 1;
+  ftpl_really_init();
+  ftpl_initializing = 0;
+}
+
 inline static void ftpl_init(void) {
-  pthread_once(&initialized_once_control, ftpl_really_init);
+  if (ftpl_initializing) return;
+  pthread_once(&initialized_once_control, ftpl_really_init_guarded);
 }
 
 void *ft_dlvsym(void *handle, const char *symbol, const char *version,

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.

Thank you, this was the real blocker. I reproduced it: claude --version hung (killed by timeout after 20 s) with /etc/ld.so.preload in place, and returned at once without it. Fixed in ac0a39e with your guard, appended to the agent's clock/libfaketime.patch. It applies cleanly after the existing patch, and claude --version now returns as root and as agent. The computer base doesn't take it yet, so the drift test now checks that the agent's patch is the base's, byte for byte, followed by the guard. Whether computers need it too is worth its own PR. I agree this, not the proxy, explains the 600 s timeouts. I also made the CLI go through egress only while the follower follows an armed clock, and reach a plain-HTTP model endpoint directly, so a private endpoint keeps working when the clock isn't set.


@pytest.mark.skipif(not IMAGE, reason="set AGENTENV_E2E_CLAUDE_CODE_IMAGE to an image built from this branch")
@pytest.mark.asyncio
async def test_the_claude_code_image_follows_the_envs_clock_until_it_is_torn_down(local_registry):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This test passes on an image where claude --version hangs: I ran it against one and got 1 passed in 72 s. It never starts the CLI, so the libfaketime deadlock above gets through.

Suggest running claude --version under the preload in the image tests. Also add one turn against a stub Messages endpoint that checks the request's Today's date is <env date> line and a Bash date.

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.

Agreed, it never exercised the CLI. As of ac0a39e, the test checks timeout 30 claude --version as agent under the preload. Once the clock is set, it runs one real CLI turn against tst/util/fake_anthropic.py (tool_then_answer("Bash", {"command": "date -u +%FT%TZ"})) and asserts the requests' Today's date is line is the env's date and the Bash date result is the env's time. Locally it passes in 57 s: the date line was 2031-03-04 and Bash printed 2031-03-04T05:06:07Z. One local quirk: on macOS _host_ips() is only loopback, so the stub's URL is passed through host_url_for. It still only runs where AGENTENV_E2E_CLAUDE_CODE_IMAGE names a built image.

williamloo-scale and others added 6 commits November 17, 2026 09:54
…e survives a server restart; get_time keeps its sentence

- follow retires the follower it declared when the agent's sync_time fails, by an HTTP error or a transport one, so the
  gateway isn't left waiting on every later write for a follower that never watches.
- sync_time saves the task's zone in the follower's config, and the A2A server takes it back when it starts, so a
  server supervisord restarts mid-run keeps the zone as the follower keeps the clock.
- get_time's description keeps "the clock on the machine you are running on is not synchronized": most agents
  won't follow the clock for a while yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…through the proxy only on an armed clock

- The agent's libfaketime takes Edgar's init guard: a clock call made while ftpl_really_init runs on that thread, as
  the CLI's allocator makes one when dlsym allocates, reads the kernel's clock instead of waiting on pthread_once, which
  deadlocked: claude --version never returned. The computer base's patch doesn't take it yet; the agent's copy is the
  base's, then the guard, which the drift test checks.
- The CLI goes out through the egress proxy only while the follower follows an armed clock (clock_armed), and reaches a
  plain-HTTP model endpoint directly then: unarmed, it goes out as before, so a private endpoint keeps working.
- egress/ is the base's again after main moved it.
- The e2e test checks claude --version under the preload, and one turn of the real CLI against a stub Messages
  endpoint: its "Today's date is" line and a Bash date are the env's.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… down alone

Their records stay in deployed_agents after teardown, and calling their gone servers failed the step.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…browser base's egress copy takes boot.go

- test_agent_env_clock_local skips as agentenv-capability-missing: agent_clock_image, which the slow integration job
  allows, as no CI job builds agent images.
- ubuntu-24.04-browser's egress/ is ubuntu-24.04's again, with this PR's AGENTENV_SESSION_USER and AGENTENV_EGRESS_NSS.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
status = json.loads(Path(status_path or CLOCK_STATUS).read_text())
except (OSError, ValueError):
return False
return isinstance(status, dict) and bool(status.get("connected")) and bool(status.get("armed"))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This sends the CLI through egress only while the follower reports connected and armed. But the CLI's clock comes from the clock page, which keeps the last armed time either way. There are two windows where the status and the page disagree:

  • The follower loses its gateway. It reports connected: false, but the page stays armed until it reconnects.
  • The follower restarts. Its first status is {"connected": false, "waiting": ...}, then one with armed: false, until its first watch answers. Meanwhile the page still holds the env's time.

A CLI started in either window reads a clock that may be months off, but goes out directly. So an HTTPS model endpoint's real certificate fails at that date, and the turn fails.

I saw the follower go through both states in the chaos run (a gateway restart and a kill -9), but I didn't start a CLI inside either window, so the failure itself is from reading the code.

Suggest deciding from the page's own armed flag, since that's what libfaketime reads, or at least dropping the connected condition. A unit test for each window would pin it.

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.

Agreed. The status was the wrong source. Fixed in 7216c7c: clock_armed now reads the clock page itself (/dev/shm/agentenv-clock, the version 2 layout) the way libfaketime does. It retries while seq is odd or the check doesn't match, and returns the page's armed flag. The follower's status isn't consulted at all, so in both windows (the follower lost its gateway, or restarted before its first watch answers) a CLI started then goes through egress while the page still holds the env's time. Unit tests:

  • test_while_the_follower_reconnects_or_restarts_the_page_still_routes_the_cli_through_the_proxy, one case per status you describe, with an armed page;
  • test_the_clock_is_armed_when_the_page_libfaketime_reads_says_so: armed, unarmed, a write left mid-way, a short file, no magic, no page.

Pages are built with the image's own clockpage.encode. The local e2e still passes after the change (57 s).

williamloo-scale and others added 9 commits November 17, 2026 11:33
…tocol's tests write it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…lag, not the follower's status

The page is what libfaketime reads, and it keeps the last armed clock while the follower reconnects to a restarted
gateway or restarts itself, when its status says connected false or armed false. A CLI started then reads the env's
time, so it must go through the proxy. Unit tests pin both windows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ds show

An agent whose card serves clock/v1 sync_time is now checked end to end after the validation DAG: the validation
env's clock is armed frozen in America/Chicago with require_agent_clock, the agent runs `date` through its harness
and must show that instant and zone, a write that waits for followers must be acknowledged, and `date` must show the
time it moved to. A synced follower alone doesn't pass: an image whose preload is missing, or whose harness can't run
under it, follows and still fails. An agent whose card serves no sync_time is skipped. The result is recorded under
validated_a2a_extensions[urn:agentenv:clock/v1] and verifications["a2a_clock"].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ength

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ed with the env

An agent in an image that follows the env's clock reads the env's time, so "is not synchronized, so do not use it"
is false for it. "May not be" holds for every agent, following or not, and get_time answers what a following
agent's clock already shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he other agent extension clients

It drives an agent's clock/v1 sync_time and the gateway's follower declarations for the steps that call it
(sync_env_clock, deploy_agent, teardown_sandboxes), as object_transfer does for snapshot transfers; it defines no step.
The name mirrors agentenv_protocol.a2a_agent.clock, the agent's side of the same extension. The persisted
metadata key agent_clock_following is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t.clock, where #714 moved it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
earakely-scale added a commit that referenced this pull request Nov 18, 2026
…nt.clock

No changes: #726's 686fdf1 moved the only caller of the old agent_clock path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from wloo/agent-env-clock-follower to main November 18, 2026 01:18
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
…roxy, which the agent's image lets reach it

Reached directly, Claude Code checks the endpoint's certificate at the env's date, so a private HTTPS model endpoint
failed once that date left the certificate's validity; and the bridge's DNS lookup could cache a failed answer for the
server's life. Now only a plain-HTTP endpoint is direct. The egress proxy takes AGENTENV_EGRESS_PRIVATE=allow, which
the agent image's root.conf sets: it then reaches private networks' addresses too (RFC 1918, RFC 6598, IPv6 unique
local), which the agent's processes reach directly anyway, and checks the certificate on real time as for any site.
Loopback, link-local and the rest stay refused, and a computer's proxy doesn't set it. The bridge's lookup and cache
are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gram's one environment line

supervisord keeps the last environment= of a program, so the separate line was dropped and the proxy still refused
private addresses (seen on an arm64 build: "private_networks": false). The test reads the line supervisord uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 5e02397 into main Nov 18, 2026
39 of 40 checks passed
@earakely-scale
earakely-scale deleted the wloo/claude-code-clock-image branch November 18, 2026 18:28
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
# Conflicts:
#	src/agent_env/agents/README.md
#	src/agent_env/agents/agents/claude-code/claude_bridge.py
#	src/agent_env/agents/agents/claude-code/root.conf
#	tst/integration/task_step/test_agent_env_clock_local.py
#	tst/unit/agents/claude_code/test_env_clock_image.py
#	tst/unit/agents/test_agent_clock_images.py
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
…xy reaches private networks, a plain-HTTP model endpoint alone is direct

The bridge takes #726's final helpers (model_direct_hosts without a lookup), and root.conf gives the egress proxy
AGENTENV_EGRESS_PRIVATE=allow, so a model endpoint over TLS at a private address goes through it at any date.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
# Conflicts:
#	src/agent_env/agents/README.md
#	src/agent_env/agents/agents/claude-code/claude_bridge.py
#	src/agent_env/agents/agents/claude-code/root.conf
#	tst/integration/task_step/test_agent_env_clock_local.py
#	tst/unit/agents/claude_code/test_env_clock_image.py
#	tst/unit/agents/test_agent_clock_images.py
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
…xy reaches private networks, a plain-HTTP model endpoint alone is direct

The bridge takes #726's final helpers (model_direct_hosts without a lookup), and root.conf gives the egress proxy
AGENTENV_EGRESS_PRIVATE=allow, so a model endpoint over TLS at a private address goes through it at any date.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
# Conflicts:
#	src/agent_env/agents/README.md
#	src/agent_env/agents/agents/claude-code/claude_bridge.py
#	src/agent_env/agents/agents/claude-code/root.conf
#	tst/integration/task_step/test_agent_env_clock_local.py
#	tst/unit/agents/claude_code/test_env_clock_image.py
#	tst/unit/agents/test_agent_clock_images.py
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
…xy reaches private networks, a plain-HTTP model endpoint alone is direct

The bridge takes #726's final helpers (model_direct_hosts without a lookup), and root.conf gives the egress proxy
AGENTENV_EGRESS_PRIVATE=allow, so a model endpoint over TLS at a private address goes through it at any date.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
# Conflicts:
#	src/agent_env/agents/README.md
#	src/agent_env/agents/agents/claude-code/claude_bridge.py
#	src/agent_env/agents/agents/claude-code/root.conf
#	tst/integration/task_step/test_agent_env_clock_local.py
#	tst/unit/agents/claude_code/test_env_clock_image.py
#	tst/unit/agents/test_agent_clock_images.py
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
…xy reaches private networks, a plain-HTTP model endpoint alone is direct

The bridge takes #726's final helpers (model_direct_hosts without a lookup), and root.conf gives the egress proxy
AGENTENV_EGRESS_PRIVATE=allow, so a model endpoint over TLS at a private address goes through it at any date.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
# Conflicts:
#	src/agent_env/agents/README.md
#	src/agent_env/agents/agents/claude-code/claude_bridge.py
#	src/agent_env/agents/agents/claude-code/root.conf
#	tst/integration/task_step/test_agent_env_clock_local.py
#	tst/unit/agents/claude_code/test_env_clock_image.py
#	tst/unit/agents/test_agent_clock_images.py
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
…xy reaches private networks, a plain-HTTP model endpoint alone is direct

The bridge takes #726's final helpers (model_direct_hosts without a lookup), and root.conf gives the egress proxy
AGENTENV_EGRESS_PRIVATE=allow, so a model endpoint over TLS at a private address goes through it at any date.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
# Conflicts:
#	src/agent_env/agents/README.md
#	src/agent_env/agents/agents/claude-code/claude_bridge.py
#	src/agent_env/agents/agents/claude-code/root.conf
#	tst/integration/task_step/test_agent_env_clock_local.py
#	tst/unit/agents/claude_code/test_env_clock_image.py
#	tst/unit/agents/test_agent_clock_images.py
williamloo-scale added a commit that referenced this pull request Nov 18, 2026
…xy reaches private networks, a plain-HTTP model endpoint alone is direct

The bridge takes #726's final helpers (model_direct_hosts without a lookup), and root.conf gives the egress proxy
AGENTENV_EGRESS_PRIVATE=allow, so a model endpoint over TLS at a private address goes through it at any date.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants