Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/pr_af/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,12 @@ async def health() -> dict[str, str]:


def main() -> None:
app.run(port=8004, host="0.0.0.0")
# Honor the PORT injected by the AgentField CLI/runner (`af run` allocates a
# free port and passes it via PORT); fall back to 8004 when launched
# standalone. Previously this was hardcoded to 8004, which the SDK treats as
# an explicit override — so `af run pr-af` bound 8004 while the CLI polled its
# assigned port, and the readiness check timed out.
app.run(port=int(os.getenv("PORT", "8004")), host="0.0.0.0")


if __name__ == "__main__":
Expand Down
Loading