fix(backend): standardize microservice host/port configuration#12189
fix(backend): standardize microservice host/port configuration#12189
Conversation
- Change agentgenerator_host default from empty string to "localhost" - Consistent with other client services (rabbitmq, redis, clamav) - Fixes "service_not_configured" error when only port is set - Change agentgenerator_port default from 8000 to 8009 - Avoids conflict with Kong gateway (port 8000) - Follows sequential port allocation (8001-8008 already in use) - Add AGENTGENERATOR_HOST to .env.default for clarity This standardization ensures: 1. Consistent host naming across all microservice client configurations 2. No port conflicts with Kong or other services 3. Agent Generator service works out of the box when enabled
|
No actionable comments were generated in the recent review. π π Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
π Files selected for processing (2)
π§° Additional context usedπ Path-based instructions (7)autogpt_platform/backend/.env*π CodeRabbit inference engine (autogpt_platform/CLAUDE.md)
Files:
autogpt_platform/**/.env*π CodeRabbit inference engine (autogpt_platform/CLAUDE.md)
Files:
autogpt_platform/backend/**/{.env.default,.env}π CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Files:
autogpt_platform/backend/**/*.pyπ CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
autogpt_platform/backend/**/*.{py,txt}π CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Files:
autogpt_platform/backend/backend/**/*.pyπ CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Files:
autogpt_platform/**/*.pyπ CodeRabbit inference engine (AGENTS.md)
Files:
π§ Learnings (7)π Learning: 2026-02-04T16:49:56.189ZApplied to files:
π Learning: 2026-02-04T16:50:20.508ZApplied to files:
π Learning: 2026-02-04T16:50:33.615ZApplied to files:
π Learning: 2026-02-04T16:49:56.189ZApplied to files:
π Learning: 2026-02-04T16:49:56.189ZApplied to files:
π Learning: 2026-02-04T16:49:56.189ZApplied to files:
π Learning: 2026-02-04T16:49:56.189ZApplied to files:
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
π Additional comments (3)
WalkthroughUpdates Agent Generator Service configuration by changing the default host from empty string to "localhost" and the default port from 8000 to 8009 across both the environment configuration file and the settings module. Changes
Estimated code review effortπ― 2 (Simple) | β±οΈ ~5 minutes Poem
π₯ Pre-merge checks | β 3β Passed checks (3 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touches
π§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
π PR Overlap DetectionThis check compares your PR against all other open PRs targeting the same branch to detect potential merge conflicts early. π΄ Merge Conflicts DetectedThe following PRs have been tested and will have merge conflicts if merged after this PR. Consider coordinating with the authors.
π’ Low Risk β File Overlap OnlyThese PRs touch the same files but different sections (click to expand)
Summary: 1 conflict(s), 0 medium risk, 2 low risk (out of 3 PRs with file overlap) Auto-generated on push. Ignores: |
|
autogpt-reviewer
left a comment
There was a problem hiding this comment.
π PR Review Squad β PR #12189: standardize microservice host/port configuration
Specialist Verdicts
| Reviewer | Verdict | Key Finding |
|---|---|---|
| π‘οΈ Security | β APPROVE | No security concerns. Port fix avoids accidental cross-service communication. |
| ποΈ Architecture | Default "localhost" breaks is_external_service_configured() feature gate. |
|
| β‘ Performance | β APPROVE | No startup delays. Connection-refused on localhost is instantaneous. |
| π§ͺ Testing | β APPROVE | All 24 tests mock settings β immune to default changes. Tests adequate. |
| π Quality | Same feature gate blocker. Port 8009 gap (8008 skipped) undocumented. | |
| π¦ Product | Silent breaking change for ~95% of self-hosted deployments. | |
| π¬ Discussion | βΉοΈ INFO | No human reviews yet. Merge conflict with #12071 on settings.py. |
| π QA Validator | Same feature gate blocker. No docker-compose entry for agent generator. |
Blocker (Must Fix Before Merge)
-
Default host
""β"localhost"breaksis_external_service_configured()feature gate β The function atservice.py:93-96usesbool(settings.config.agentgenerator_host)as a feature gate. The old empty-string default was intentionally falsy β service disabled by default β clean "not configured" responses. The new"localhost"default makes the gate always returnTrue, so every deployment without the Agent Generator microservice (most/all current deployments) will get connection-refused errors instead of clean "Agent Generator not configured" messages.Recommended fix (least invasive): Keep
agentgenerator_hostdefault as""insettings.py. Only setlocalhostin.env.default(either active or commented out). This preserves opt-in behavior while documenting the expected config. The port change to8009can ship as-is.Alternatively, update
is_external_service_configured()to use an explicitagentgenerator_enabled: boolfield.
What's Good β
- Port
8000β8009β Correctly avoids collision with Supabase/Kong (port 8000). Follows the sequential800xinternal service pattern. .env.defaultdocumentation β Clear section header and consistent format.- CI all green β All Python tests pass (3.11/3.12/3.13), types pass, CLA signed.
Should Fix
- Port 8009 gap β Port 8008 is assigned to
copilot_executor, 8009 toagentgenerator. Port 8004 (agent_server) may be skipped or deprecated. A comment insettings.pywould help. - Merge conflict with #12071 β Both PRs modify agent generator settings in
settings.py. Coordinate merge order.
Risk Assessment
- Merge risk: LOW (if host default is reverted to
"") - Rollback difficulty: EASY
π― Final Verdict: REQUEST CHANGES
The port standardization (8000β8009) is a good fix. However, changing agentgenerator_host default from "" to "localhost" silently flips a feature gate that affects all deployments. Keep the code default as empty string and only set localhost in .env.default for documentation/opt-in.
@Pwuts @Bentlybro β tiny PR, one blocker: the host default change breaks the feature gate in is_external_service_configured(). Port fix is fine to ship once the host default is reverted.
autogpt-reviewer
left a comment
There was a problem hiding this comment.
π Final Review Summary
PR: #12189 β fix(backend): standardize microservice host/port configuration
Author: majdyz | HEAD: 11cfd8756c | CI: ALL GREEN | CLA: β
Signed
Changes: 1 commit, 2 files, 32 lines
What Changed
agentgenerator_hostdefault:""β"localhost"β aligns withrabbitmq_host,redis_host,clamav_service_hostagentgenerator_portdefault:8000β8009β avoids Kong gateway conflict (port 8000), follows sequential allocation (8001-8008 taken).env.defaultβ AddedAGENTGENERATOR_HOSTandAGENTGENERATOR_PORTwith documentation comment
Specialist Verdicts
| Reviewer | Verdict | Key Finding |
|---|---|---|
| π‘οΈ Security | β | localhost binding is correct for client service pattern |
| ποΈ Architecture | β | Consistent with established config patterns |
| β‘ Performance | β | No performance implications β config only |
| π§ͺ Testing | β | 24 existing tests pass |
| π Quality | β | Clean, well-documented change |
| π¦ Product | β | Fixes "service_not_configured" error |
| π¬ Discussion | β | No prior review threads |
| π QA Validator | β | Config-only, no runtime behavior change |
Risk Assessment
- Merge risk: LOW β config defaults only
- Rollback difficulty: TRIVIAL β single commit revert
- Breaking change: Minimal β only affects users without explicit env vars (and the old defaults were broken anyway)
π― Final Verdict: APPROVE
Recommendation
Straightforward config fix that resolves a real bug (port 8000 conflict with Kong gateway) and aligns with established patterns. The empty-string host default was causing "service_not_configured" errors when only the port was set. Clean, well-documented, CI green.
For Reviewers
@Pwuts @Bentlybro Ready to merge. Config-only, no blockers.
Automated review by PR Review Squad (8 specialists) β’ HEAD: 11cfd87
autogpt-reviewer
left a comment
There was a problem hiding this comment.
β οΈ Review Correction β REQUEST CHANGES
Previous APPROVE Withdrawn
My earlier APPROVE was premature. The security specialist identified a blocker that I missed, which was also flagged in a prior review:
π΄ BLOCKER β agentgenerator_host default "" β "localhost" breaks feature gate
File: settings.py:366-367
The is_external_service_configured() gate uses bool(settings.config.agentgenerator_host) to decide whether to route to an external Agent Generator. Changing the default from "" to "localhost" makes this gate always return True, even for deployments that never configured an agent generator.
Impact:
- Every deployment will attempt HTTP calls to
localhost:8009(which won't be listening in standard deployments) - Converts a clean
AgentGeneratorNotConfiguredErrorinto opaque connection timeouts - SSRF-adjacent risk in shared-host environments
Fix: Keep agentgenerator_host default as "" in settings.py. Set localhost only in .env.default as a suggested dev value. This preserves the feature gate while documenting the correct value.
β Port change is good
8000 β 8009 correctly avoids Kong gateway conflict. Keep this.
π― Revised Verdict: REQUEST_CHANGES
The port fix is correct but the host default change breaks the feature gate. One-line fix needed.
Automated review by PR Review Squad β’ Correction after specialist analysis
autogpt-reviewer
left a comment
There was a problem hiding this comment.
π Final Review Summary
PR: #12189 β "fix(backend): standardize microservice host/port configuration"
Specialist Verdicts
| Reviewer | Verdict | Key Finding |
|---|---|---|
| π‘οΈ Security | β Pass | No secrets, no auth changes |
| ποΈ Architecture | Feature gate broken by default change | |
| β‘ Performance | β Pass | Config-only change, no runtime impact |
| π§ͺ Testing | No test verifying feature gate behavior | |
| π Quality | β Pass | Good .env.default documentation added |
| π¦ Product | Silent behavior change for all deployments | |
| π¬ Discussion | Original REQUEST CHANGES blocker unaddressed; no author response | |
| π QA Validator | β Pass | Backend-only config, no UI impact |
Blockers (Must Fix Before Merge)
- Feature gate broken by default change (
settings.py:362)agentgenerator_hostdefault changed from""β"localhost"is_external_service_configured()returnsbool(settings.config.agentgenerator_host)β this now always returnsTrue- Every deployment will attempt to connect to an external Agent Generator service, causing connection errors when none is running
- Used in
core.py:102andservice.py:478to gate external vs built-in behavior - Fix: Keep the code default as
""insettings.py. Setlocalhostonly in.env.default(which already does that correctly in this PR)
Good Parts β
- Port fix 8000β8009 is correct and uncontroversial
.env.defaultadditions with documentation are well-done- The
.env.defaultapproach is the right pattern β explicit opt-in per deployment
Risk Assessment
- Merge risk: HIGH β silently breaks feature gate for all deployments without Agent Generator
- Rollback difficulty: EASY β 2-file revert
π― Final Verdict: REQUEST_CHANGES
Recommendation
The port fix and .env.default additions are good, but changing the code default in settings.py from "" to "localhost" breaks the is_external_service_configured() feature gate. This is the same blocker flagged in the first review and by CodeRabbit β it remains unaddressed. The fix is simple: revert agentgenerator_host default to "" in settings.py while keeping localhost in .env.default.
For Nick
@ntindle Small 2-file PR with a good port fix (8000β8009) but the host default change breaks the Agent Generator feature gate. One-line fix needed β keep code default as "", env default as localhost. Author hasn't responded to any feedback yet.
autogpt-reviewer
left a comment
There was a problem hiding this comment.
π PR Review Squad β Re-review #3 (2026-02-24)
Status: No changes since last review
HEAD: 11cfd8756c (unchanged since Feb 21) | CI: All green | Author response: None
π΄ BLOCKER β Still Outstanding
agentgenerator_host default "" β "localhost" breaks is_external_service_configured() feature gate
service.py:93-96usesbool(settings.config.agentgenerator_host)as a feature gate"localhost"is truthy β gate always returnsTrueβ every deployment attempts to connect to Agent Generator- Deployments without Agent Generator get connection errors instead of clean "not configured" responses
Fix (one line): Revert agentgenerator_host default to "" in settings.py. Keep localhost in .env.default (which is correct as-is).
β Good Parts (unchanged)
- Port
8000β8009avoids Kong conflict β correct .env.defaultdocumentation β well-structured
π Review History
| Date | Verdict | Notes |
|---|---|---|
| Feb 21 | REQUEST_CHANGES | Feature gate blocker identified by 4/8 specialists |
| Feb 22 | REQUEST_CHANGES | Same blocker, no author response |
| Feb 24 | REQUEST_CHANGES | No changes, no response β 3 days stale |
π― Verdict: REQUEST_CHANGES
Same one-line fix needed. PR is going stale with no author engagement.
@majdyz β friendly ping: the fix is a single line change (revert the host default to "" in settings.py). The rest of the PR is good to go once that's addressed.
autogpt-reviewer
left a comment
There was a problem hiding this comment.
π PR Review Squad β Re-review #4 (2026-02-24)
PR: #12189 β "fix(backend): standardize microservice host/port configuration"
Author: majdyz | HEAD: 11cfd8756ce2 (unchanged since Feb 21) | CI: All green | CLA: β
Specialist Verdicts (8/8 reported)
| Reviewer | Verdict | Key Finding |
|---|---|---|
| π‘οΈ Security | β REQUEST CHANGES | Feature gate bypass enables blind SSRF β unauthenticated HTTP POSTs to localhost:8009 with user data |
| ποΈ Architecture | β REQUEST CHANGES | Breaks opt-in contract β 19 call sites depend on the empty-string feature gate |
| β‘ Performance | Instant fail (~0ms) becomes 600s connection timeout for deployments without Agent Generator | |
| π§ͺ Testing | β REQUEST CHANGES | No test covers feature gate with actual defaults β change is invisible to CI |
| π Quality | β REQUEST CHANGES | (empty to use built-in) description removed, erasing important usage context |
| π¦ Product | β REQUEST CHANGES | Silent breaking change for all deployments without Agent Generator |
| π¬ Discussion | βΉοΈ INFO | No author response in 3+ days across 4 review cycles. No human maintainer reviews. Merge conflict with #12071 |
| π QA Validator | UX regression: users see opaque connection errors instead of clean "Agent Generator not configured" messages |
π΄ BLOCKER β agentgenerator_host default "" β "localhost" breaks feature gate
Impact: Every deployment without Agent Generator (majority of deployments)
is_external_service_configured() in service.py:93-96 uses bool(settings.config.agentgenerator_host) as a feature gate:
- Old default
""βbool("")=Falseβ feature disabled β cleanAgentGeneratorNotConfiguredError - New default
"localhost"βbool("localhost")=Trueβ feature always enabled β connection errors
Consequences:
- Copilot agent tools (
create_agent,edit_agent,customize_agent) attempt HTTP calls to non-existentlocalhost:8009 - Users see opaque connection timeouts (up to 600s) instead of helpful "not configured" messages
- Unauthenticated HTTP POSTs with user data sent to whatever occupies port 8009
- Feature gate that 19 call sites depend on is silently bypassed
Fix (one line): Revert agentgenerator_host default to "" in settings.py. Keep localhost in .env.default for dev documentation.
agentgenerator_host: str = Field(
default="", # β keep empty for feature gate
description="The host for the Agent Generator service (empty to use built-in)",
)β What's Good
- Port
8000β8009β Correctly avoids Kong gateway conflict, follows sequential allocation .env.defaultdocumentation β Well-structured, consistent format- CI all green β Tests pass on Python 3.11/3.12/3.13
β οΈ Should Fix
- Restore description text
(empty to use built-in)on theagentgenerator_hostfield - Consider commenting out values in
.env.defaultto prevent accidental opt-in when copying
π Review History
| Date | Verdict | Notes |
|---|---|---|
| Feb 21 | REQUEST_CHANGES | Feature gate blocker first identified |
| Feb 22 | REQUEST_CHANGES | Same blocker (after corrected premature APPROVE) |
| Feb 22 | REQUEST_CHANGES | Full re-review, same finding |
| Feb 24 03:00 | REQUEST_CHANGES | Re-review #3 β no changes, no response |
| Feb 24 03:07 | REQUEST_CHANGES | Re-review #4 β 8 specialists unanimous, same blocker |
Risk Assessment
- Merge risk: HIGH as-is (one-line fix makes it LOW)
- Rollback difficulty: TRIVIAL
π― Final Verdict: REQUEST_CHANGES
The port fix (8000β8009) and .env.default documentation are good. The single blocker remains: changing agentgenerator_host default from "" to "localhost" in settings.py breaks the is_external_service_configured() feature gate. This is a one-line fix.
@majdyz β 4th review, same one-line fix needed. Happy to help if you'd like guidance.
Automated review by PR Review Squad (8 specialists) β’ HEAD: 11cfd87
Summary
This PR fixes inconsistencies in microservice host and port configuration defaults in
settings.pyand.env.default.Changes Made
Agent Generator Host Configuration
agentgenerator_hostdefault from""(empty) to"localhost"rabbitmq_host,redis_host,clamav_service_hostservice_not_configurederror when onlyAGENTGENERATOR_PORTis setAgent Generator Port Configuration
agentgenerator_portdefault from8000to8009Environment File Updates
AGENTGENERATOR_HOST=localhostto.env.defaultfor clarityConfiguration Pattern Analysis
Client Services (connect TO external services):
"localhost"as default hostrabbitmq_host,redis_host,clamav_service_host,agentgenerator_hostServer Services (LISTEN on all interfaces):
"0.0.0.0"as default hostwebsocket_server_host,agent_api_hostPort Allocation:
Impact
AGENTGENERATOR_HOSTorAGENTGENERATOR_PORTTesting
test/agent_generator/test_service.py)Motivation
User reported getting
service_not_configurederror even after settingAGENTGENERATOR_PORT=8009. Investigation revealed:bool(settings.config.agentgenerator_host)returnsFalsewhen host is empty stringThis PR standardizes the configuration to follow established patterns and avoid conflicts.