fix(BA-5665): apply VFolder model-definition.yaml override for all runtime variants on Agent#10984
Draft
jopemachine wants to merge 4 commits intomainfrom
Draft
fix(BA-5665): apply VFolder model-definition.yaml override for all runtime variants on Agent#10984jopemachine wants to merge 4 commits intomainfrom
jopemachine wants to merge 4 commits intomainfrom
Conversation
…stom runtime variants Agent was ignoring VFolder model-definition.yaml for non-custom runtime variants (vllm, tgi, nim, sglang, modular-max), using only hardcoded defaults. Now reads the VFolder yaml and deep-merges it on top of variant defaults, mirroring Manager's _apply_vfolder_override(). Extract _read_model_definition_from_vfolder() and _try_read_model_definition_from_vfolder() helpers to share VFolder reading logic between custom (required) and non-custom (optional override) variants. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Agent’s runtime model definition loading so that non-custom runtime variants can optionally apply user-provided model-definition.yaml overrides from the model VFolder (deep-merged on top of variant defaults), aligning behavior with the Manager’s merge strategy.
Changes:
- Added Agent-side reading of
model-definition.yamlfrom the model VFolder for non-custom runtime variants and deep-merge viaModelDefinition.merge(). - Refactored VFolder YAML reading into
_read_model_definition_from_vfolder()and_try_read_model_definition_from_vfolder(). - Added a towncrier news fragment documenting the behavioral fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/ai/backend/agent/agent.py |
Reads optional VFolder model-definition overrides for non-custom variants and merges them into generated defaults; refactors YAML reading into helpers. |
changes/10952.fix.md |
News fragment describing the Agent-side override behavior change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5ad67f3 to
5af3b4a
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5af3b4a to
36ab267
Compare
- Wrap VFolder override merge in try/except, fall back to variant defaults on failure (mirrors Manager's _try_merge_vfolder_definition) - Validate yaml.load() returns a mapping, raise on list/string/None - Log warning (with traceback) when VFolder yaml exists but is invalid, silently skip only when file is not found Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests for: - VFolder override applied for non-custom variants (parametrized) - Fallback to hardcoded defaults when no VFolder yaml - Graceful fallback on invalid YAML, non-mapping YAML, merge failure - _read/_try_read helpers: parsed yaml, missing file, invalid file, custom definition_path from internal_data Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
Although this PR only removes dead code, I am keeping it as a draft for now to avoid any unintended side effects |
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.
Summary
model-definition.yamlfor non-custom runtime variants (vllm, tgi, nim, sglang, modular-max), using only hardcoded defaultsModelDefinition.merge(), mirroring Manager's_apply_vfolder_override()indefinition_generator/registry.pyJira
BA-5665
Changes (1 file:
agent/agent.py)_read_model_definition_from_vfolder()(required, for custom) and_try_read_model_definition_from_vfolder()(optional, returns None if not found) from inline custom variant code_try_read_model_definition_from_vfolder()andbase.merge(override)for non-custom variantsApproach
Agent reads VFolder yaml directly — same approach Manager already uses. Works for both legacy (
POST /services) and sokovan (POST /v2/deployments) paths without Manager-side changes.See #10951 for the alternative approach (Manager → Agent passing) which was drafted because it breaks the legacy WebUI path.
Test plan
🤖 Generated with Claude Code