Skip to content

Get model capabilities from metadata#395

Merged
farshidtz merged 7 commits into
mainfrom
IENG-2466-model-capabilities
Jul 10, 2026
Merged

Get model capabilities from metadata#395
farshidtz merged 7 commits into
mainfrom
IENG-2466-model-capabilities

Conversation

@mrmara

@mrmara mrmara commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Model capabilities are now retrieved from metadata inside model.yaml and passed to webui, dropping the need for hardcoded values.

Supported capabilities are validated at build time for each model against a known list (PR).

Frontend will ignore and not show any unsupported capability (PR)

Copilot AI review requested due to automatic review settings July 8, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR shifts Web UI capability handling from a hardcoded/shell-provided list to model-provided metadata (from model.yaml), so the backend forwards model capabilities directly to the frontend.

Changes:

  • Remove the hardcoded --capabilities plumbing from the snap startup script and modelctl serve-webui.
  • Load the active model’s manifest and forward its capabilities into the Web UI /config payload.
  • Relax backend capability validation (unknown capabilities are forwarded) and adjust unit tests accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
snap/local/server-webui.sh Stops passing a hardcoded capabilities list to modelctl serve-webui.
pkg/webui/config.go Updates supported capability constants/list and removes backend-side rejection of unknown capabilities.
pkg/webui/config_test.go Updates validation tests to reflect “unknown capability is accepted”; removes the SupportedCapabilities test.
cmd/modelctl/commands/serve-webui.go Removes the --capabilities flag and loads capabilities from the active model manifest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/modelctl/commands/serve-webui.go
Comment thread pkg/webui/config_test.go
Comment on lines 1 to 5
package webui

import (
"testing"
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SupportedCapabilites() is only returning a slice of strings. No relevant tests can be performed IMO

Comment thread cmd/modelctl/commands/serve-webui.go Outdated
Comment thread pkg/webui/config.go Outdated
@farshidtz farshidtz merged commit 5d66f2f into main Jul 10, 2026
6 checks passed
@farshidtz farshidtz deleted the IENG-2466-model-capabilities branch July 10, 2026 17:41
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.

3 participants