fix(controller): honor agent URL for local workers - #582
Merged
Zhiyuan He (hzy46) merged 1 commit intoSep 2, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation matches the established Kubernetes resolution rule and has regression coverage.
Pull request overview
Updates local workers to honor the agent-facing gateway URL, matching Kubernetes behavior.
Changes:
- Uses
agl_server.agent_urlwith fallback toagl_server.url. - Normalizes trailing slashes and tests both endpoint variables.
File summaries
| File | Description |
|---|---|
agentlightning/controller/local_reconciler.py |
Resolves agent-facing local worker endpoints. |
tests/controller/test_local_reconciler_env.py |
Covers override and fallback endpoint generation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Zhiyuan He (hzy46)
enabled auto-merge (squash)
September 2, 2026 04:05
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
agl_server.agent_url, falling back toagl_server.urlProblem
The documented controller/agent URL split was only honored by
build_job_spec(). Local workers always received endpoint variables rooted at the controller-facing URL, so a configured agent-reachable gateway was silently ignored.This change applies the existing Kubernetes resolution rule to
_spawn_for()while leaving the controller API client onagl_server.url.Closes #581
Verification
mainby receivinghttp://controller:8080instead ofhttp://agent-gateway:8080uv run --extra dev pytest tests/controller/test_local_reconciler_env.py -q— 2 passedpyright— 0 errorsruff check .ruff format --check .python scripts/check_headers.pyuv build --no-sourcesThis is independent of #580: that PR changes shutdown admission, while this one changes only worker endpoint construction.