Repository navigation
[FD-5916] feat(agents): the Codex image follows the env's clock #765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
65 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 eea933c
refactor(agents): leave the Claude Code image to its own PR; agents s…
williamloo-scale 608a93d
Merge origin/main
williamloo-scale 182cef0
feat(agents): the Claude Code image follows the env's clock (FD-5916)
williamloo-scale bce00d4
fix(agents): agent clock review: new config's status, one clock per a…
williamloo-scale 84381b8
fix(agents): keep each agent's clock record on a key of its own; a re…
williamloo-scale 56dac45
fix(agents): agent clock keys can't collide; one clock env per agent;…
williamloo-scale c726743
chore: drop test run output committed by mistake
williamloo-scale 5e8c756
Merge #714
williamloo-scale 3b6f499
test(agents): the Claude Code image follows the env's clock end to en…
williamloo-scale cecc686
fix(agents): a failed agent sync retires its follower; the task's zon…
williamloo-scale afe55b4
Merge origin/main
williamloo-scale d523a6e
Merge #714
williamloo-scale ac0a39e
fix(agents): libfaketime's init can't deadlock the CLI; the CLI goes …
williamloo-scale c8ed6e1
fix(agents): a later clock sync leaves agents teardown_sandboxes took…
williamloo-scale b5d3b4b
fix(ci): the agent clock e2e skips as a declared capability gap; the …
williamloo-scale 25af21a
chore: drop test-run output committed again, and ignore where the pro…
williamloo-scale 7216c7c
fix(agents): route the CLI through egress by the clock page's armed f…
williamloo-scale fc3134b
Merge #714
williamloo-scale f8bd9ff
feat(a2a-agent): validate clock/v1 by the time the agent's own comman…
earakely-scale f9af1b6
refactor(a2a-agent): name the clock validation's timeouts and error l…
williamloo-scale 43fdb97
fix(gateway): get_time says the machine's clock may not be synchroniz…
earakely-scale 8bf8e4c
refactor(a2a-agent): move agent_clock to a2a_agent/clock.py, beside t…
earakely-scale 810f42e
Merge #714
williamloo-scale 686fdf1
test(agents): the agent clock e2e imports FOLLOWING_KEY from a2a_agen…
williamloo-scale 9d7d6c0
Merge origin/main (#714 merged)
williamloo-scale 1ff90bd
fix(agents): the Claude Code image installs protocol 0.1.575, the fir…
earakely-scale ca97b37
fix(computers): the clock follower follows a changed config while its…
earakely-scale 0875e06
fix(agents): an armed clock keeps the agent's own NO_PROXY hosts dire…
williamloo-scale bb4f07f
test(agents): the agent clock checks run over every clocked agent ima…
williamloo-scale f228c9e
feat(agents): the Codex image follows the env's clock (FD-5916)
williamloo-scale a3f9e34
Merge main into #726: the clock and egress proxy now live in utils (#…
earakely-scale 3c60fda
refactor(agents): the Claude Code image takes the clock and egress pr…
earakely-scale dd8de29
Merge #726: the clock and egress proxy come from utils
williamloo-scale 150c563
test(agents): Claude Code's contract test takes the folders shared_so…
williamloo-scale cc3ff73
refactor(agents): the image takes the clock and egress proxy from uti…
williamloo-scale 655614e
Merge #726
williamloo-scale 84ca228
test(agents): the contract test takes the folders shared_sources.toml…
williamloo-scale aed27ee
fix(agents): a private HTTPS model endpoint is reached directly on an…
williamloo-scale 2cea6f9
fix(agents): a private HTTPS model endpoint is reached directly on an…
williamloo-scale 1837705
Merge #726
williamloo-scale b605046
test(agents): the clock test's HTTPS model hosts resolve publicly wit…
williamloo-scale a6f3720
fix(agents): the model host's lookup is bounded and kept, so a slow r…
williamloo-scale b47867b
fix(agents): the model host's lookup is bounded and kept, as #726's is
williamloo-scale 9eff419
Merge #726
williamloo-scale ff48a8f
Merge main (#726 merged)
williamloo-scale 155ef84
refactor(agents): follow the merged Claude Code image (#726): the pro…
williamloo-scale ef0d8de
fix(agents): keep a provider's CA bundle trusted, and send HTTPS MCP …
williamloo-scale 716f5fc
Merge main: the control token (#780, #784)
williamloo-scale 96ad61c
fix(egress): leaves start at the Unix epoch, which rustls accepts
williamloo-scale 158f548
Merge remote-tracking branch 'origin/main' into wloo/codex-clock-image
williamloo-scale 0a90ec9
Merge remote-tracking branch 'origin/main' into wloo/codex-clock-image
williamloo-scale d864a99
refactor(codex): take the shared egress rule (#818)
williamloo-scale 764a13c
fix(codex): mcp-remote reaches the env's MCP servers through the egre…
williamloo-scale 94b7ddd
Merge remote-tracking branch 'origin/main' into wloo/codex-clock-image
williamloo-scale e2fa4b7
Merge remote-tracking branch 'origin/main' into wloo/codex-clock-image
earakely-scale 79bc6cb
revert(egress): leaves start in 1950 again, as the shared proxy had them
earakely-scale 4677d85
fix(codex): the CLI stays on real time; only the model's commands fol…
earakely-scale 2bb858f
test(codex): the local agent clock e2e runs a real Codex turn against…
earakely-scale ee083b0
Merge remote-tracking branch 'origin/main' into wloo/codex-clock-image
earakely-scale a689200
fix(codex): mcp-remote starts by Node itself on an armed clock; only …
earakely-scale 4f0f0b9
test(codex): the local clock e2e expects every mcp-remote on real tim…
earakely-scale 2ef1f9f
fix(codex): a restarted server kills the CLIs the crashed one left ru…
earakely-scale 4bd82a8
Merge remote-tracking branch 'origin/main' into wloo/codex-clock-image
earakely-scale e07b556
fix(codex): the A2A server's exit ends the image's container, as on main
earakely-scale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| ; Root's supervisord (start-agent): 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 the model's commands, which it starts | ||
| ; through the CLI, read the env's time; the Codex CLI itself is a static binary the library doesn't reach, so it stays | ||
| ; on real 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. It is never started again (agent-exit below). | ||
| [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=/app | ||
| priority=10 | ||
| autorestart=false | ||
| startretries=0 | ||
| 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" | ||
|
|
||
| ; The A2A server's exit, for any reason, ends the container, as it did when the server was the image's only process: a | ||
| ; server started again would have lost the task's MCP servers, peers and running tasks, and the CLIs the dead one | ||
| ; started would go on in the workspace beside it. This listener has root's supervisord, its parent, shut down when the | ||
| ; server exits or can't start; the follower and the proxy restart in place. | ||
| [eventlistener:agent-exit] | ||
| command=/usr/local/bin/python3 -I -c "import os, signal, sys | ||
| fields = lambda line: dict(field.split(b':', 1) for field in line.split()) | ||
| stdin, stdout = sys.stdin.buffer, sys.stdout.buffer | ||
| while True: stdout.write(b'READY\n'); stdout.flush(); header = fields(stdin.readline()); event = fields(stdin.read(int(header[b'len']))); event[b'processname'] == b'agent' and os.kill(os.getppid(), signal.SIGTERM); stdout.write(b'RESULT 2\nOK'); stdout.flush()" | ||
| events=PROCESS_STATE_EXITED,PROCESS_STATE_FATAL | ||
| directory=/ | ||
| autorestart=true | ||
| stdout_logfile=NONE | ||
| stderr_logfile=/var/log/agentenv-root/agent-exit.log | ||
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
| 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" | ||
| agent_clock = "utils/agent_clock" |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.