Skip to content

fix(controller): honor agent URL for local workers - #582

Merged
Zhiyuan He (hzy46) merged 1 commit into
microsoft:mainfrom
YusefSyed:fix/local-reconciler-agent-url
Sep 2, 2026
Merged

fix(controller): honor agent URL for local workers#582
Zhiyuan He (hzy46) merged 1 commit into
microsoft:mainfrom
YusefSyed:fix/local-reconciler-agent-url

Conversation

@YusefSyed

Copy link
Copy Markdown
Contributor

Summary

  • resolve the local worker gateway from agl_server.agent_url, falling back to agl_server.url
  • normalize the trailing slash consistently with the Kubernetes reconciler
  • verify both injected worker endpoints for the override and fallback cases

Problem

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 on agl_server.url.

Closes #581

Verification

  • the override regression fails on current main by receiving http://controller:8080 instead of http://agent-gateway:8080
  • uv run --extra dev pytest tests/controller/test_local_reconciler_env.py -q — 2 passed
  • full test suite — 94 passed, 3 pre-existing dependency warnings
  • pyright — 0 errors
  • ruff check .
  • ruff format --check .
  • python scripts/check_headers.py
  • uv build --no-sources

This is independent of #580: that PR changes shutdown admission, while this one changes only worker endpoint construction.

Copilot AI balanced review requested due to automatic review settings September 2, 2026 03:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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_url with fallback to agl_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.

@hzy46
Zhiyuan He (hzy46) enabled auto-merge (squash) September 2, 2026 04:05
@hzy46
Zhiyuan He (hzy46) merged commit 7063503 into microsoft:main Sep 2, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local runner ignores agl_server.agent_url for worker endpoints

3 participants