This repository was archived by the owner on Nov 12, 2026. It is now read-only.
Repository navigation
fix: Read HOST and PORT from env vars instead of hardcoding - #254
Merged
Merged
Conversation
All A2A agent examples hardcoded host=0.0.0.0 and port=8000 in their run() functions. The kagenti operator's proxy-sidecar mode uses port-stealing — it sets the PORT env var to move the agent to a free port so the reverse proxy can take over the original port. Agents that ignore PORT fail with 'address already in use'. Now all 8 agents read HOST and PORT from environment variables with the same defaults (0.0.0.0:8000), so they work with both envoy-sidecar mode (no env vars set, uses defaults) and proxy-sidecar mode (operator sets PORT to the relocated port). Signed-off-by: Hai Huang <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Hai Huang <[email protected]>
…cher Read PORT env var instead of SERVICE_PORT to align with the operator's port-stealing convention. Also fixes a bug in slack_researcher/config.py that was reading SERVICE_URL instead of SERVICE_PORT. Updated: config.py, .env files, .env.template, README.md for both agents. Signed-off-by: Hai Huang <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Hai Huang <[email protected]>
huang195
added a commit
to rossoctl/cortex
that referenced
this pull request
Apr 21, 2026
Aligns with rossoctl/examples#254 which renamed the env var from SERVICE_PORT to PORT across all agents. The operator sets PORT during proxy-sidecar port-stealing. Signed-off-by: Hai Huang <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Hai Huang <[email protected]>
Remove --host and --port CLI args from CMD since run() reads HOST and PORT env vars directly. Add EXPOSE 8000 for documentation and a comment explaining the PORT env var convention and operator port-stealing. Signed-off-by: Hai Huang <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Hai Huang <[email protected]>
EXPOSE is purely documentation and has no effect in Kubernetes. Removing it and the associated comments to avoid confusion since the actual port is controlled by the PORT env var at runtime. Signed-off-by: Hai Huang <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Hai Huang <[email protected]>
This was referenced Apr 27, 2026
huang195
added a commit
to huang195/kagenti-extensions
that referenced
this pull request
May 5, 2026
Aligns with rossoctl/examples#254 which renamed the env var from SERVICE_PORT to PORT across all agents. The operator sets PORT during proxy-sidecar port-stealing. Signed-off-by: Hai Huang <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Hai Huang <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
HOSTandPORTfrom environment variables in theirrun()functions0.0.0.0:8000— no behavior change for existing deploymentsContext
The kagenti operator's proxy-sidecar mode uses port-stealing: the reverse proxy takes over the agent's original port (e.g. 8000), and the agent is moved to a free port via the
PORTenv var. Agents that ignorePORTfail withaddress already in usebecause both the reverse proxy and the agent try to bind to 8000.Agents fixed
Assisted-By: Claude (Anthropic AI) [email protected]