Skip to content

[fix][model] read default parameter values from config - #656

Open
oleg-ai-dev wants to merge 4 commits into
coze-dev:mainfrom
oleg-ai-dev:fix/125-model-default-value
Open

[fix][model] read default parameter values from config#656
oleg-ai-dev wants to merge 4 commits into
coze-dev:mainfrom
oleg-ai-dev:fix/125-model-default-value

Conversation

@oleg-ai-dev

@oleg-ai-dev oleg-ai-dev commented Sep 9, 2026

Copy link
Copy Markdown

What type of PR is this?

fix

Check the PR title

  • This PR title matches the format: [<type>][<scope>] <description>.
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • No usage-level documentation is required for this configuration-decoding fix.
  • This PR is written in English.

(Optional) More detailed description for this PR

en:

The shipped Docker Compose and Helm model_config.yaml files define parameter defaults with the default_val key. ParamSchema originally decoded only default_value, so Viper left every shipped default empty and the model-management response did not expose those defaults.

This change decodes default_val as the canonical shipped spelling while preserving default_value for backward compatibility with existing custom configurations. The alias is normalized from the same Viper snapshot, so live reloads cannot return mixed configuration versions. When both keys are present, default_val takes precedence; the public JSON field remains default_value.

A regression test loads real YAML through the production Viper factory and verifies both spellings, nested parameter schemas, and deterministic precedence. A second test verifies normalization uses a single loader snapshot and removes the internal alias before returning the model.

Validation

  • go test -count=1 ./modules/llm/infra/config
  • go test -count=1 ./modules/llm/...
  • go vet ./modules/llm/...
  • go build ./modules/llm/...
  • git diff --check

(Optional) Which issue(s) this PR fixes

Fixes #125

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@oleg-ai-dev
oleg-ai-dev force-pushed the fix/125-model-default-value branch 2 times, most recently from 05edd95 to 31fb186 Compare September 9, 2026 21:41
@oleg-ai-dev
oleg-ai-dev force-pushed the fix/125-model-default-value branch from 31fb186 to f6c2968 Compare September 9, 2026 21:48
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.

[BUG] Model Default Value Not Working

2 participants