Make templates fully harness-agnostic: model aliases, deprecate image/auth#276
Merged
ptone merged 5 commits intoMay 31, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request makes templates harness-agnostic by deprecating harness-specific fields (such as image, auth_selectedType, and concrete model names) in the agent configuration and introducing abstract model size aliases (small, medium, large). These aliases are mapped to concrete models within the harness configuration and resolved during agent provisioning. The feedback suggests adding a defensive nil check to WarnDeprecatedTemplateFields to prevent potential nil-pointer dereference panics.
Comment on lines
+635
to
+636
| func WarnDeprecatedTemplateFields(cfg *api.ScionConfig) []string { | ||
| var warnings []string |
Contributor
There was a problem hiding this comment.
To prevent potential nil-pointer dereference panics, add a defensive nil check at the beginning of WarnDeprecatedTemplateFields.
Suggested change
| func WarnDeprecatedTemplateFields(cfg *api.ScionConfig) []string { | |
| var warnings []string | |
| func WarnDeprecatedTemplateFields(cfg *api.ScionConfig) []string { | |
| if cfg == nil { | |
| return nil | |
| } | |
| var warnings []string |
5 tasks
scion-gteam Bot
pushed a commit
to ptone/scion
that referenced
this pull request
May 31, 2026
Adds a defensive nil check at the start of WarnDeprecatedTemplateFields to prevent nil-pointer dereference panics when called with a nil config. Addresses review feedback on PR GoogleCloudPlatform#276.
Templates should be strictly harness-agnostic. This change: - Adds ModelAliases (small/medium/large) to HarnessConfigEntry so each harness-config can map abstract sizes to concrete model names - Adds ResolveModelAlias() to resolve aliases at provision time - Adds WarnDeprecatedTemplateFields() to warn when templates use image, auth_selectedType, or concrete model names - Marks image and auth_selectedType as deprecated in agent-v1 schema - Updates model field description to recommend size aliases - Adds model_aliases to settings-v1 schema - Seeds default model_aliases in all harness embeds (claude, gemini, opencode, codex) - Wires alias resolution and deprecation warnings into ProvisionAgent Concrete model names in templates still work (pass-through) for backward compatibility. Refs #98, relates to #42.
… boundary - Add note that image/model/auth belong in harness-config, not templates - Add "Model Size Aliases" section explaining small/medium/large aliases - Update harness-config customization example to show alias mapping Refs #98
Tests cover: - ResolveModelAlias: alias resolution, concrete passthrough, nil/empty handling, unmapped aliases - WarnDeprecatedTemplateFields: clean templates, size alias models, deprecated image/auth/concrete-model fields - KnownModelAliases: validates the canonical alias set Refs #98
Adds a defensive nil check at the start of WarnDeprecatedTemplateFields to prevent nil-pointer dereference panics when called with a nil config. Addresses review feedback on PR GoogleCloudPlatform#276.
eeba480 to
5795020
Compare
krohnjw
pushed a commit
to ParkWhiz/scion
that referenced
this pull request
Jun 3, 2026
…/auth (GoogleCloudPlatform#276) * Add model size aliases and deprecate harness-specific template fields Templates should be strictly harness-agnostic. This change: - Adds ModelAliases (small/medium/large) to HarnessConfigEntry so each harness-config can map abstract sizes to concrete model names - Adds ResolveModelAlias() to resolve aliases at provision time - Adds WarnDeprecatedTemplateFields() to warn when templates use image, auth_selectedType, or concrete model names - Marks image and auth_selectedType as deprecated in agent-v1 schema - Updates model field description to recommend size aliases - Adds model_aliases to settings-v1 schema - Seeds default model_aliases in all harness embeds (claude, gemini, opencode, codex) - Wires alias resolution and deprecation warnings into ProvisionAgent Concrete model names in templates still work (pass-through) for backward compatibility. Refs GoogleCloudPlatform#98, relates to GoogleCloudPlatform#42. * Update templates.md: document model aliases, clarify harness-agnostic boundary - Add note that image/model/auth belong in harness-config, not templates - Add "Model Size Aliases" section explaining small/medium/large aliases - Update harness-config customization example to show alias mapping Refs GoogleCloudPlatform#98 * Add tests for model alias resolution and deprecation warnings Tests cover: - ResolveModelAlias: alias resolution, concrete passthrough, nil/empty handling, unmapped aliases - WarnDeprecatedTemplateFields: clean templates, size alias models, deprecated image/auth/concrete-model fields - KnownModelAliases: validates the canonical alias set Refs GoogleCloudPlatform#98 * Add project log for templates harness-agnostic cleanup * Add nil guard to WarnDeprecatedTemplateFields Adds a defensive nil check at the start of WarnDeprecatedTemplateFields to prevent nil-pointer dereference panics when called with a nil config. Addresses review feedback on PR GoogleCloudPlatform#276.
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
Templates should be strictly harness-agnostic — they define the agent's role, not its execution mechanics. This PR:
small,medium,large) to harness-configs, resolved to concrete model names at provision time. Templates can usemodel: largeinstead ofmodel: opus, making them portable across Claude, Gemini, and other backends.image,auth_selectedType, concretemodelnames) inscion-agent.yamlwith warnings, guiding users to move these to harness-configconfig.yaml.templates.md) to clarify the template/harness-config boundary and document model aliases.Closes ptone#98. Implements the model alias portion of #42.
Changes
pkg/config/settings_v1.go: AddModelAliasestoHarnessConfigEntrypkg/config/templates.go: AddResolveModelAlias(),WarnDeprecatedTemplateFields(),KnownModelAliasespkg/agent/provision.go: Wire alias resolution and deprecation warnings into provisioning flowpkg/config/schemas/agent-v1.schema.json: Markimage,auth_selectedTypeas deprecated; updatemodeldescriptionpkg/config/schemas/settings-v1.schema.json: Addmodel_aliasesproperty to harness config schemapkg/hubclient/types.go,pkg/store/models.go: AddModelAliasestoHarnessConfigDatapkg/harness/*/embeds/config.yaml: Seed default model aliases for all harnessesdocs-site/src/content/docs/advanced-local/templates.md: Document model aliases, clarify harness-agnostic boundaryBackward Compatibility
imageandauth_selectedTypestill work as override valuesTest plan
ResolveModelAlias()— alias resolution, concrete passthrough, nil/empty handlingWarnDeprecatedTemplateFields()— all deprecated field combinationsKnownModelAliases— canonical alias set validationgo vetandgo buildpass