fix: preserve top-level baseUrl when service entry has no explicit baseUrl#250
Open
ycls2002 wants to merge 2 commits into
Open
fix: preserve top-level baseUrl when service entry has no explicit baseUrl#250ycls2002 wants to merge 2 commits into
ycls2002 wants to merge 2 commits into
Conversation
…seUrl When a service entry in inkos.json does not specify its own `baseUrl`, `applyServiceEntry()` was unconditionally overwriting `llm.baseUrl` with the endpoint's default URL (e.g. `https://api-ai.xiaomi.com/v1` for the xiaomimimo service). This discarded the user's top-level `llm.baseUrl` configuration, causing connection failures when using a third-party proxy URL (e.g. `https://token-plan-cn.xiaomimimo.com/v1`). The fix adds `llm.baseUrl` as a fallback in the resolution chain: entry.baseUrl ?? llm.baseUrl ?? resolveServicePreset(...)?.baseUrl ?? "" This ensures the priority order is: 1. Service entry's explicit baseUrl (highest priority) 2. Top-level llm.baseUrl from user config 3. Endpoint's default baseUrl 4. Empty string fallback Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Author
|
根本原因是小米大模型的token plan和按量计费的api baseurl不一致导致 |
Two new features for InkOS Studio: 1. Outline upload (BookCreate): file upload button for .txt/.md outline files that populates the brief textarea, with file name badge and clear button. 2. Pre-chapter direction selection: "Plan directions" quick action that generates 3 story direction cards (A/B/C) before writing a chapter. User selects a direction, which is passed as context guidance to the chapter writing pipeline. Changes are purely additive — no existing functionality is modified. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Problem
applyServiceEntry()ineffective-llm-config.tsoverwrites the top-levelllm.baseUrlwith the endpoint default when the service entry doesn't have an explicitbaseUrl. This causes users who configure a custom baseUrl at the top level to have it silently replaced.Example: user configures
baseUrl: https://token-plan-cn.xiaomimimo.com/v1but the service entry forxiaomihas a default baseUrl ofhttps://api-ai.xiaomi.com/v1. The service entry's default wins, breaking the user's config.Fix
Add
llm.baseUrlas a fallback in the??chain:This ensures the priority is: entry.baseUrl > existing llm.baseUrl > endpoint default.
🤖 Generated with Claude Code