Skip to content

Conversation

@jacobljh
Copy link
Contributor

Context

We need CodeAssist to work in remote/tunneled environments (e.g., OctaSpace) without forcing consumers to rebuild containers locally. Currently UI embedded absolute http://localhost/:* API URLs, we can harness Next's rewrite (internal proxy) capability to map relative API into desired port.

Summary of Change

  • Use relative API paths in the UI:
  • .env.development updated to the same /api/* scheme.
  • Add server-side rewrites in Next.js:
/api/tester → codeassist-solution-tester:8008
/api/backend → codeassist-state-service:8000
/api/policy → codeassist-policy-model:8001
  • Adjusted .github/workflows/build-containers.yaml build args to bake relative /api/* into images so end users pull correct images => CI continues to publish prebuilt images per branch as before
  • Local dev with compose aligned with run.py:
    • compose.yml now uses the same /api/* build args.
    • Services get container_name matching run.py (codeassist-…), ensuring rewrites resolve whether you run via run.py or compose.
    • Updated backend env URLs in compose to codeassist-… hostnames.

Related Issues

https://linear.app/gensyn/issue/GEN-306/make-app-work-in-remotetunneled-environments

Test

  • Run: python run.py -b ui-proxy-enabled
  • Open the UI at http://localhost:3000/ and verify:
  • Network calls go to /api/tester/* and /api/backend/* (same-origin).
  • Health checks: /api/tester/health and /api/backend/health return 200.
  • Submitting a solution triggers requests under /api/tester.

Local dev path:

  • docker compose up --build (with updated compose.yml).
  • follow the above steps

@jacobljh jacobljh requested a review from space55 November 12, 2025 17:04
@jacobljh jacobljh self-assigned this Nov 12, 2025
@jacobljh jacobljh changed the title [GEN-306] Switch to internal proxy with relative API path Switch to internal proxy with relative API path Nov 12, 2025
@space55 space55 merged commit 906a34e into main Nov 13, 2025
6 checks passed
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.

2 participants