[Refactor] Reuse shared OpenAI-compatible connection helpers in the worker#579
Merged
mrubens merged 1 commit intoJul 19, 2026
Merged
Conversation
Point worker named connection discovery at @roomote/types helpers so id and env naming stay a single source of truth.
Contributor
Author
mrubens
marked this pull request as ready for review
July 19, 2026 13:39
mrubens
requested review from
brunobergher,
daniel-lxs and
mrubens
as code owners
July 19, 2026 13:39
mrubens
deleted the
refactor/reuse-openai-compatible-helpers-35oy31loegy7w
branch
July 19, 2026 13:39
Merged
8 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related issue
Internal maintenance follow-up to multi named OpenAI-compatible connections (related #572 / #562 / #571).
Why this PR exists
What changed
Worker OpenCode config generation no longer invents its own OpenAI-compatible provider id and env-var naming for named connections. Discovery and naming now go through the shared
@roomote/typeshelpers, while ollama/vllm/litellm and the defaultopenai-compatibleentry stay on an explicit static runtime catalog.Why this change was made
After multiple named OpenAI-compatible connections shipped, the worker still had a second, looser parsing path. That could drift from the validated types helpers on env names and invalid segments. One ownership path removes that maintenance risk without changing intended provider behavior.
Impact
No intentional user-facing behavior change. Named and default OpenAI-compatible connections still resolve base URL, optional API key, no
OPENAI_*fallback, and gateway rebase the same way; invalid env segments now follow the shared validation rules. Tests cover company-proxy/local named configs, invalid segment rejection, and no OpenAI credential leakage.How it was tested
pnpm exec dotenvx run -f .env.test -- pnpm --filter @roomote/worker exec vitest run src/run-task/agent-home.test.ts(26 passed)pnpm --filter @roomote/worker check-typesChecklist
[Fix],[Feat],[Improve],[Refactor],[Docs], or[Chore]followed by a user-facing descriptionpnpm lintandpnpm check-typespass locallypnpm changeset