Skip to content

Conversation

@Gkrumbach07
Copy link
Collaborator

Avoid conflict with workspace-mcp OAuth callback server which also uses port 8000. This was causing Google Workspace MCP to fail on first run with 'port 8000 already in use' error.

Updated:

  • Dockerfile: AGUI_PORT, EXPOSE, CMD
  • Operator: container port, service port, URLs
  • Backend: websocket proxy URL

Avoid conflict with workspace-mcp OAuth callback server which also
uses port 8000. This was causing Google Workspace MCP to fail on
first run with 'port 8000 already in use' error.

Updated:
- Dockerfile: AGUI_PORT, EXPOSE, CMD
- Operator: container port, service port, URLs
- Backend: websocket proxy URL
@Gkrumbach07 Gkrumbach07 merged commit 6b33b78 into ambient-code:main Dec 19, 2025
13 of 14 checks passed
@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Contributor

github-actions bot commented Dec 19, 2025

Claude Code Review

Summary

This PR changes the AG-UI server port from 8000 to 8001 to avoid port conflicts with workspace-mcp OAuth callback server. The changes are simple, focused, and correctly implemented across all three affected components (Dockerfile, Operator, Backend).

Issues by Severity

🚫 Blocker Issues

None - PR is ready to merge.

🔴 Critical Issues

1. Python Default Port Fallback Inconsistency

  • Location: components/runners/claude-code-runner/main.py:475
  • Issue: The default fallback in Python code is still 8000
    port = int(os.getenv("AGUI_PORT", "8000"))  # Should be 8001
  • Impact: If the AGUI_PORT environment variable is not set (edge case), the server will fall back to port 8000, reintroducing the conflict
  • Recommendation: Update default to "8001" for consistency
    port = int(os.getenv("AGUI_PORT", "8001"))

🟡 Major Issues

None

🔵 Minor Issues

1. Comment Clarity

  • Location: Multiple locations with inline comments
  • Current: Comments mention the port change rationale in Dockerfile only
  • Suggestion: The operator and backend comments could also mention why 8001 was chosen (avoiding workspace-mcp conflict), but this is optional since the context is clear from the commit message

Positive Highlights

Comprehensive Coverage: All three components (Dockerfile, Operator, Backend) updated consistently

Follows Established Patterns:

  • Backend uses proper K8s service naming: session-{name}.{namespace}.svc.cluster.local
  • Operator correctly updates both Container and Service port definitions
  • SecurityContext remains properly configured (not touched, good!)

Clear Documentation: Excellent comment in Dockerfile explaining the conflict

Minimal Change Scope: Only touches port configuration, no architectural changes

Code Quality Standards:

  • No CLAUDE.md violations
  • No security issues introduced
  • Follows error handling patterns (not applicable here)
  • No K8s client pattern violations

Recommendations

Priority 1 (Fix Before Merge)

  1. Update Python default port: Change main.py:475 from "8000" to "8001"

Priority 2 (Nice to Have)

  1. Consider adding a comment in operator/internal/handlers/sessions.go:1099 explaining the port choice:
    // Port 8001 chosen to avoid conflict with workspace-mcp OAuth (port 8000)
    ContainerPort: 8001,

Testing Verification Needed

  • Verify AG-UI server starts on port 8001 in deployed pod
  • Verify backend can connect to runner via websocket proxy
  • Verify workspace-mcp OAuth no longer conflicts
  • Verify service discovery works with new port

Architecture Compliance

✅ Follows CLAUDE.md patterns
✅ No security violations
✅ No RBAC issues
✅ Container security context unchanged (proper)
✅ Service naming conventions maintained


Overall Assessment: Well-executed port change with one critical fix needed for the Python default fallback. Once that's addressed, this is ready to merge.


🔍 View AI decision process (logs available for 90 days)

📋 View memory system files loaded (click to expand)

What Amber Loaded for Code Review

Amber automatically loaded these repository standards from the memory system:

  1. CLAUDE.md - Master project instructions, development standards
  2. backend-development.md - Go backend, K8s integration patterns
  3. frontend-development.md - NextJS, Shadcn UI, React Query patterns
  4. security-standards.md - Auth, RBAC, token handling
  5. k8s-client-usage.md - User token vs service account patterns
  6. error-handling.md - Consistent error patterns
  7. react-query-usage.md - Data fetching patterns

Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines.

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.

1 participant