Skip to content

refactor: replace DialectManager class with resolveModelDialect function#79

Open
MayCXC wants to merge 2 commits intoMadAppGang:mainfrom
MayCXC:refactor/unified-provider-registry
Open

refactor: replace DialectManager class with resolveModelDialect function#79
MayCXC wants to merge 2 commits intoMadAppGang:mainfrom
MayCXC:refactor/unified-provider-registry

Conversation

@MayCXC
Copy link
Copy Markdown

@MayCXC MayCXC commented Mar 19, 2026

Summary

Replace the stateless DialectManager class with a pure resolveModelDialect() function. The class had no state: constructor allocated all dialects eagerly, getAdapter() did a linear scan, needsTransformation() called getAdapter() again. The function does the same work without the class ceremony.

Rebased onto v6.2.2.

  • DialectManager class replaced by resolveModelDialect(modelId): BaseAPIFormat
  • All callers updated: composed-handler, cli, local-adapter, openrouter-api-format, all test files
  • CLAUDE.md updated
  • 11 files changed, -54 lines net

Test plan

  • bun test passes (149/149 across 3 test files)
  • All dialect selection tests pass (correct routing, false positive prevention)

@MayCXC MayCXC force-pushed the refactor/unified-provider-registry branch 3 times, most recently from e12ccfd to 3cc0e69 Compare March 19, 2026 11:05
@MayCXC MayCXC changed the title refactor: unify provider registry with transport-based handler construction refactor: unified provider registry with DIP and type-safe adapter layers Mar 19, 2026
@MayCXC MayCXC changed the title refactor: unified provider registry with DIP and type-safe adapter layers refactor: unified provider registry and type-safe adapter layers Mar 19, 2026
@MayCXC MayCXC force-pushed the refactor/unified-provider-registry branch 4 times, most recently from dbe349b to 110d503 Compare March 20, 2026 03:04
MayCXC added 2 commits March 24, 2026 05:18
DialectManager had no state: constructor allocated all dialects,
getAdapter() did a linear scan, needsTransformation() called
getAdapter() again. Replace with a pure function that does the
same scan without the class ceremony.

All callers updated: composed-handler, cli, local-adapter,
openrouter-api-format, and all test files.
@MayCXC MayCXC force-pushed the refactor/unified-provider-registry branch from 110d503 to 78b1f5d Compare March 24, 2026 05:21
@MayCXC MayCXC changed the title refactor: unified provider registry and type-safe adapter layers refactor: replace DialectManager class with resolveModelDialect function Mar 24, 2026
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.

1 participant