Skip to content

feat(design): support OPENAI_BASE_URL for API calls - #932

Closed
jackjin1997 wants to merge 1 commit into
garrytan:mainfrom
jackjin1997:feat/design-openai-base-url
Closed

jackjin1997 wants to merge 1 commit into
garrytan:mainfrom
jackjin1997:feat/design-openai-base-url

Conversation

@jackjin1997

@jackjin1997 jackjin1997 commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add a central openaiUrl() resolver that honors OPENAI_BASE_URL, trims whitespace/trailing slashes, and defaults to https://api.openai.com/v1
  • route every current design OpenAI API call through the resolver, including design/prototype.ts
  • add regression coverage for default/custom/blank base URLs and for future hardcoded design API call sites

Why

Some environments route OpenAI requests through an internal or compatible API gateway. The design tools previously hardcoded the public OpenAI endpoint at each call site.

Validation

  • bun test design/test/auth.test.ts design/test/daemon.test.ts design/test/gallery.test.ts design/test/serve.test.ts — 67 passed, 0 failed
  • bun build for all nine changed API-call entry points — succeeded
  • git diff --check — clean

The broader local design suite also contains environment-dependent tests: Playwright Chromium is not installed, daemon-discovery assumes a parent/child PID shape that differs under the local Bun runtime, and one existing HTTP-date retry assertion is timing-sensitive. None of those paths are changed here.

@time-attack

time-attack commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

@jackjin1997 Rewrite this to support OPENAI_BASE_URL across every current design API call site, not only the paths covered by the existing helper.

@jackjin1997
jackjin1997 force-pushed the feat/design-openai-base-url branch from c8a9668 to 0a55a44 Compare July 25, 2026 17:46
@jackjin1997

Copy link
Copy Markdown
Contributor Author

Reworked this on top of current main to address the requested scope.

All current design OpenAI call sites now use the shared OPENAI_BASE_URL resolver, including design/prototype.ts. I also added a regression test that scans the design sources so a future hardcoded public endpoint is caught.

Fresh local verification: 67 relevant tests passed, all nine changed API-call entry points bundled successfully, and git diff --check is clean. Ready for another review.

@capy-ai

capy-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Landed in v1.91.66.0 (#3087): OPENAI_BASE_URL for the design binary, rewritten on current main with credit to you (Co-authored-by). Thank you @jackjin1997!

@capy-ai capy-ai Bot closed this Oct 8, 2026
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