bug: OpenAI-compatible alias loses upstream model name in Home dispatch metadata

Open Beginner friendly
#111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
api, backend

Research direction

Read internal/watcher/synthesizer/config.go, especially buildOpenAICompatibilityModels, and run go test ./internal/watcher/synthesizer ./internal/cliproxy/auth. Add a focused synthesizer regression confirming the metadata contains id fractalops-coding and name glm-5.3; the fix is complete when the regression and package tests pass.

Written by the indexing model from the issue text.

Description

Problem

For an OpenAI-compatible provider model configured with a distinct alias, Home dispatches the alias literally instead of the configured upstream model name.

openai-compatibility:
  - name: zai-coding
    base-url: https://api.example.test/v1
    models:
      - name: glm-5.3
        alias: fractalops-coding

A service-key request for fractalops-coding selects the correct auth/provider, but the upstream request still contains model=fractalops-coding. The provider rejects it because only glm-5.3 exists.

Root cause

internal/watcher/synthesizer/config.go:buildOpenAICompatibilityModels creates registry.ModelInfo with ID=alias but omits Name=upstream model. The synthesized home_config_models metadata therefore cannot resolve alias to upstream name during dynamic dispatch.

This is separate from OAuth force-mapping / response rewriting fixed by #88.

Minimal fix

out = append(out, &registry.ModelInfo{
    ID:   modelID,
    Name: strings.TrimSpace(model.Name),
    // existing fields...
})

Add a synthesizer regression asserting metadata contains:

{"id":"fractalops-coding","name":"glm-5.3"}

Verification

Applied locally on current source:

  • commit: 6674658ba53a2dcafefb6686fa7fb24c7c5de15e
  • go test ./internal/watcher/synthesizer ./internal/cliproxy/auth passes
  • change is one production line plus a focused regression test

No credential values are involved.

Dominant language
Go
Stars
30
Forks
16
Avg merge
3h 59m
Merged PRs (30d)
11

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from router-for-me/CLIProxyAPIHome

All issues in router-for-me/CLIProxyAPIHome

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.