Commit Graph

14 Commits

Author SHA1 Message Date
YeonGyu-Kim f3840a7325 Merge pull request #2843 from code-yeongyu/refactor/model-alias-pattern-matching
refactor(aliases): migrate to pattern-based model alias resolution
2026-04-04 20:34:38 +09:00
YeonGyu-Kim 861ce1c161 test: remove provider and cache mock leak paths 2026-04-04 20:06:56 +09:00
YeonGyu-Kim a4db240d47 test: localize mock.module setup to fresh imports 2026-04-04 19:49:25 +09:00
YeonGyu-Kim 6acca09bd0 fix(ci): resolve mock.module() cross-file leakage in test suite
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-04 02:35:23 +09:00
YeonGyu-Kim 9daaeedc50 fix(test): restore shared Bun mocks after suite cleanup
Prevent src/shared batch runs from leaking module mocks into later files, which was breaking Linux CI cache metadata and legacy plugin warning assertions.
2026-03-27 00:08:20 +09:00
YeonGyu-Kim b34eab3884 fix(test): isolate model-capabilities from local provider cache
Mock connected-providers-cache in model-capabilities.test.ts to prevent
findProviderModelMetadata from reading disk-cached model metadata.

Without this mock, the 'prefers runtime models.dev cache' test gets
polluted by real cached data from opencode serve runs, causing the
test to receive different maxOutputTokens/supportsTemperature values
than the mock runtime snapshot provides.

This was the last CI-only failure — passes locally with cache, fails
on CI without cache, now passes everywhere via mock isolation.

Full suite: 4484 pass, 0 fail.
2026-03-26 18:14:51 +09:00
YeonGyu-Kim 4efc181390 fix(ci): resolve all test failures + complete rename compat layer
Sisyphus-authored fixes across 15 files:

- plugin-identity: align CONFIG_BASENAME with actual config file name
- add-plugin-to-opencode-config: handle legacy→canonical name migration
- plugin-detection tests: update expectations for new identity constants
- doctor/system: fix legacy name warning test assertions
- install tests: align with new plugin name
- chat-params tests: fix mock isolation
- model-capabilities tests: fix snapshot expectations
- image-converter: fix platform-dependent test assertions (Linux CI)
- example configs: expanded with more detailed comments

Full suite: 4484 pass, 0 fail, typecheck clean.
2026-03-26 18:04:31 +09:00
YeonGyu-Kim 829c58ccb0 refactor(aliases): migrate to pattern-based model alias resolution
Move from hardcoded exact aliases to pattern-based canonicalization:

- Populate PATTERN_ALIAS_RULES with regex patterns for:
  - Claude thinking variants (claude-opus-4-6-thinking → claude-opus-4-6)
  - Gemini tier suffixes (gemini-3.1-pro-{high,low} → gemini-3.1-pro)
- Add stripProviderPrefixForAliasLookup() for provider-prefixed models
  (anthropic/claude-sonnet-4-6 → claude-sonnet-4-6 for capability lookup)
- Preserve requestedModelID (with prefix) for API transport
- Reduce EXACT_ALIAS_RULES to exceptional cases only
  (gemini-3-pro-{high,low} → gemini-3-pro-preview)
- Comprehensive test coverage for patterns, prefix stripping, negatives

Addresses Discussion #2835 (pattern matching architecture)
Related to PR #2834 (alias guardrails)

41 targeted tests pass, 4467 full suite tests pass, tsc clean.
2026-03-26 12:04:50 +09:00
Ravi Tharuma ec20a82b4e fix(model-capabilities): align gemini aliases and alias lookup 2026-03-25 22:19:51 +01:00
Ravi Tharuma 5043cc21ac fix(model-capabilities): harden canonical alias guardrails 2026-03-25 22:11:45 +01:00
Ravi Tharuma a15f6076bc feat(model-capabilities): add maintenance guardrails 2026-03-25 16:14:19 +01:00
Ravi Tharuma 7c0289d7bc fix(model-capabilities): honor root thinking flags 2026-03-25 15:41:12 +01:00
Ravi Tharuma 613ef8eee8 fix(model-capabilities): harden runtime capability handling 2026-03-25 15:09:25 +01:00
Ravi Tharuma 2af9324400 feat: add models.dev-backed model capabilities 2026-03-25 14:47:46 +01:00