-
Notifications
You must be signed in to change notification settings - Fork 237
Make templates fully harness-agnostic: model aliases, deprecate image/auth #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ptone
merged 5 commits into
GoogleCloudPlatform:main
from
ptone:cleanup/templates-harness-agnostic
May 31, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
18c739b
Add model size aliases and deprecate harness-specific template fields
ptone ebf7545
Update templates.md: document model aliases, clarify harness-agnostic…
ptone e887d81
Add tests for model alias resolution and deprecation warnings
ptone e215ff2
Add project log for templates harness-agnostic cleanup
ptone 5795020
Add nil guard to WarnDeprecatedTemplateFields
ptone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
.design/project-log/2026-05-31-templates-harness-agnostic.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Templates Harness-Agnostic Cleanup | ||
|
|
||
| **Date:** 2026-05-31 | ||
| **Issue:** #98 (also relates to #42) | ||
|
|
||
| ## Summary | ||
|
|
||
| Made templates strictly harness-agnostic by deprecating harness-specific fields | ||
| (`image`, `model` as concrete name, `auth_selectedType`) in `scion-agent.yaml` | ||
| and introducing model size aliases (`small`, `medium`, `large`) for portable | ||
| model selection. | ||
|
|
||
| ## Changes | ||
|
|
||
| ### Model Size Aliases | ||
| - Added `ModelAliases map[string]string` to `HarnessConfigEntry` (settings_v1.go), | ||
| `HarnessConfigData` (hubclient/types.go, store/models.go) | ||
| - Added `model_aliases` to settings-v1 schema | ||
| - Added `ResolveModelAlias()` and `KnownModelAliases` to templates.go | ||
| - Wired alias resolution into `ProvisionAgent()` — resolves after harness-config | ||
| merge, before the model string is persisted | ||
| - Seeded default aliases in all harness embeds: | ||
| - Claude: small=haiku, medium=sonnet, large=opus | ||
| - Gemini: small=gemini-flash-lite, medium=gemini-flash, large=gemini-pro | ||
| - OpenCode: small=claude-sonnet, medium=claude-sonnet, large=claude-opus | ||
| - Codex: small=gpt-4.1-mini, medium=gpt-4.1, large=o3 | ||
|
|
||
| ### Deprecation Warnings | ||
| - Added `WarnDeprecatedTemplateFields()` — warns when templates use `image`, | ||
| `auth_selectedType`, or concrete (non-alias) model names | ||
| - Wired warnings into `ProvisionAgent()` after config merge | ||
| - Marked `image` and `auth_selectedType` as deprecated in agent-v1.schema.json | ||
| with `x-deprecated-by` annotations | ||
|
|
||
| ### Documentation | ||
| - Updated templates.md with a "Model Size Aliases" section | ||
| - Clarified that image/model/auth belong in harness-config, not templates | ||
| - Updated harness-config customization examples | ||
|
|
||
| ### Backward Compatibility | ||
| - Concrete model names still pass through unchanged | ||
| - `image` and `auth_selectedType` in templates still work as overrides | ||
| - No breaking changes to API types or persisted config | ||
|
|
||
| ## Observations | ||
|
|
||
| - The `docs-writer` template in `.scion/templates/` uses `model: "gemini-3.1-pro-preview"` — | ||
| a concrete name that ties it to Gemini. With this change, it could use `model: large` | ||
| instead to become portable. Left unmodified per project policy (`.scion/` managed manually). | ||
| - Pre-existing test failures in TestIsInsideProject, TestIsHubContext etc. are | ||
| environment-dependent and unrelated to this change. |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent potential nil-pointer dereference panics, add a defensive
nilcheck at the beginning ofWarnDeprecatedTemplateFields.