Codex sandbox task: agentkit-sdk-python - #2
Open
xgtcode wants to merge 1 commit into
Open
Conversation
xgtcode
force-pushed
the
codex/sandbox-poc-20260812t131048
branch
from
August 12, 2026 13:34
b60ee07 to
ae6f672
Compare
Add an optional public_url keyword argument to AgentkitAgentServerApp.__init__. When provided, the URL is parsed via urllib.parse.urlparse into protocol, host, and port (defaulting to 443 for https / 80 for http when no explicit port is given) and forwarded to to_a2a. When None (default), behaviour is unchanged. Added tests/apps/test_agent_server_public_url.py with 6 test cases covering default behaviour, custom URLs with/without ports, and validation errors.
xgtcode
force-pushed
the
codex/sandbox-poc-20260812t131048
branch
from
August 12, 2026 13:37
ae6f672 to
5169246
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fix
AgentkitAgentServerAppnot supporting a custom public URL for the AgentCard.Problem
AgentkitAgentServerAppcalledto_a2a(agent=root_agent, runner=runner)without passinghost,port, orprotocol, so the AgentCardurl(served at/.well-known/agent-card) was always hardcoded tohttp://localhost:8000— even when the server was deployed behind a reverse proxy or on a different host/port.Solution
public_url: str | None = Nonekeyword argument toAgentkitAgentServerApp.__init__.urllib.parse.urlparseintoprotocol,host, andport(defaulting to 443 for https / 80 for http when no explicit port is given) and forwarded toto_a2a.None(default), behaviour is unchanged — full backward compatibility.ValueErrorotherwise.Tests
Added
tests/apps/test_agent_server_public_url.pywith 6 test cases:public_url) →http://localhost:8000https://agent.example.com:8443http://agent.example.com:80https://agent.example.com:443ValueErrorValueErrorAll 199 tests in
tests/appspass.Changed files
agentkit/apps/agent_server_app/agent_server_app.py— addedpublic_urlparamtests/apps/test_agent_server_public_url.py— new test file