Skip to content

fix(runtime): bind hook ports to the serving host - #758

Open
jariy17 wants to merge 1 commit into
mainfrom
fix/hook-host-d9
Open

jariy17 wants to merge 1 commit into
mainfrom
fix/hook-host-d9

Conversation

@jariy17

@jariy17 jariy17 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

The build warmup hook (#754 / #332) serves its routes on a separate port when HookConfig.port is set, but that port always bound to 127.0.0.1. Inside a container, agentcore dev reaches the agent through the published port on the container's external interface, so it couldn't reach the hook and the local warmup call failed.

This binds hook ports to the same host as the serving port (0.0.0.0 in a container, 127.0.0.1 otherwise), so the hook is reachable wherever the main server is.

Cherry-picked from the original warmup PR's final commit, which missed the first public merge. Author: @naviret.

A hook on its own port listened on 127.0.0.1 only. In a container the
serving port binds 0.0.0.0, but the hook port stayed on the container's
loopback, so a published port (docker -p 9000:9000, as agentcore dev
does) could never reach it.

Bind hook ports to the same host as the serving port again: run()'s
host (0.0.0.0 in a container, 127.0.0.1 otherwise). The runtime calls
hooks on 127.0.0.1, which both hosts accept.
@github-actions

Copy link
Copy Markdown
Contributor

✅ No Breaking Changes Detected

No public API breaking changes found in this PR.

@github-actions github-actions Bot added the size/s PR size: S label Nov 25, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 25, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Nov 25, 2026

This branch was previously deployed

1 inactive deployment
auto-approve — 336c0002 Deployed Nov 25, 2026 by jariy17 via Test (runtime) #1740
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants