Files
automaker/apps
USerik 47a6033b43 fix(opencode-provider): correct z.ai coding plan model mapping (#625)
* fix(opencode-provider): correct z.ai coding plan model mapping

The model mapping for 'z.ai coding plan' was incorrectly pointing to 'z-ai'
instead of 'zai-coding-plan', which would cause model resolution failures
when users selected the z.ai coding plan provider.

This fix ensures the correct model identifier is used for z.ai coding plan,
aligning with the expected model naming convention.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* test: Add unit tests for parseProvidersOutput function

Add comprehensive unit tests for the parseProvidersOutput private method
in OpencodeProvider. This addresses PR feedback requesting test coverage
for the z.ai coding plan mapping fix.

Test coverage (22 tests):
- Critical fix validation: z.ai coding plan vs z.ai distinction
- Provider name mapping: all 12 providers with case-insensitive handling
- Duplicate aliases: copilot, bedrock, lmstudio variants
- Authentication methods: oauth, api_key detection
- ANSI escape sequences: color code removal
- Edge cases: malformed input, whitespace, newlines
- Real-world CLI output: box characters, decorations

All tests passing. Ensures regression protection for provider parsing.

---------

Co-authored-by: devkeruse <devkeruse@gmail.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-20 21:03:38 +01:00
..