Commit Graph

133 Commits

Author SHA1 Message Date
Fahad
18464a8b54 fix: gemini 3.0 pro does not currently support medium thinking level, updated to use high 2025-11-18 20:32:05 +04:00
Fahad
25fd72fbd3 feat: gemini 3.0 pro preview added (as default gemini pro model)
refactor: code cleanup
2025-11-18 20:28:27 +04:00
Bjorn Melin
8e9aa2304d feat: add new GPT-5.1 models to configuration files and update model selection logic in OpenAI provider 2025-11-14 01:35:11 -07:00
Fahad
ece8a5ebed feat!: Full code can now be generated by an external model and shared with the AI tool (Claude Code / Codex etc)!
model definitions now support a new `allow_code_generation` flag, only to be used with higher reasoning models such as GPT-5-Pro and-Gemini 2.5-Pro

 When `true`, the `chat` tool can now request the external model to generate a full implementation / update / instructions etc and then share the implementation with the calling agent.

 This effectively allows us to utilize more powerful models such as GPT-5-Pro to generate code for us or entire implementations (which are either API-only or part of the $200 Pro plan from within the ChatGPT app)
2025-10-07 18:49:13 +04:00
Fahad
7c36b9255a refactor: moved registries into a separate module and code cleanup
fix: refactored dial provider to follow the same pattern
2025-10-07 12:59:09 +04:00
Fahad
9268ddad2a feat: provider cleanup 2025-10-07 12:32:00 +04:00
Fahad
02d13da897 refactor: new base class for model registry / loading 2025-10-07 12:31:34 +04:00
Fahad
2a706d5720 feat: all native providers now read from catalog files like OpenRouter / Custom configs. Allows for greater control over the capabilities 2025-10-07 12:17:47 +04:00
Fahad
5f0aaf5f69 feat: more aliases 2025-10-07 09:50:50 +04:00
Fahad
a33efbde52 fix: use CUSTOM_CONNECT_TIMEOUT for gemini too
feat: add grok-4 to openrouter_models.json
2025-10-06 23:23:24 +04:00
Fahad
a65485a1e5 feat: support for GPT-5-Pro highest reasoning model https://github.com/BeehiveInnovations/zen-mcp-server/issues/275 2025-10-06 22:36:44 +04:00
Fahad
3824d13161 feat: OpenAI/compatible models (such as Azure OpenAI) can declare if they use the response API instead via use_openai_responses_api 2025-10-04 21:20:47 +04:00
Fahad
ff9a07a37a feat!: breaking change - OpenRouter models are now read from conf/openrouter_models.json while Custom / Self-hosted models are read from conf/custom_models.json
feat: Azure OpenAI / Azure AI Foundry support. Models should be defined in conf/azure_models.json (or a custom path). See .env.example for environment variables or see readme. https://github.com/BeehiveInnovations/zen-mcp-server/issues/265

feat: OpenRouter / Custom Models / Azure can separately also use custom config paths now (see .env.example )

refactor: Model registry class made abstract, OpenRouter / Custom Provider / Azure OpenAI now subclass these

refactor: breaking change: `is_custom` property has been removed from model_capabilities.py (and thus custom_models.json) given each models are now read from separate configuration files
2025-10-04 21:10:56 +04:00
Fahad
2c534ac06e feat: centralized environment handling, ensures ZEN_MCP_FORCE_ENV_OVERRIDE is honored correctly
fix: updated tests to override env variables they need instead of relying on the current values from .env
2025-10-04 14:28:56 +04:00
Fahad
4015e917ed fix: listmodels to always honor restricted models
fix: restrictions should resolve canonical names for openrouter
fix: tools now correctly return restricted list by presenting model names in schema
fix: tests updated to ensure these manage their expected env vars properly
perf: cache model alias resolution to avoid repeated checks
2025-10-04 13:46:22 +04:00
Fahad
06d7701cc3 refactor: removed subclass override when the base class should be resolving the model name
refactor: always disable "stream"
2025-10-04 10:35:32 +04:00
Fahad
d184024820 refactor: don't retry on 429 2025-10-03 23:52:03 +04:00
Fahad
f955100f3a refactor: improved retry logic and moved core logic to base class 2025-10-03 23:48:55 +04:00
Fahad
4968e1f7bc refactor: cleanup, remove unused method 2025-10-03 23:26:22 +04:00
aberemia24
82b021d75a fix: add GPT-5-Codex to Responses API routing and simplify comments
- Route GPT-5-Codex to /v1/responses endpoint (same as o3-pro)
- Simplify verbose comments per code review feedback

Addresses code review from @gemini-code-assist
2025-10-03 13:59:55 +03:00
aberemia24
f2653427ca feat: add GPT-5-Codex support with Responses API integration
Adds support for OpenAI's GPT-5-Codex model which uses the new Responses API
endpoint (/v1/responses) instead of the standard Chat Completions API.

Changes:
- Add GPT-5-Codex to MODEL_CAPABILITIES with 400K context, 128K output
- Prioritize GPT-5-Codex for EXTENDED_REASONING tasks
- Add aliases: codex, gpt5-codex, gpt-5-code
- Update tests to expect GPT-5-Codex for extended reasoning

Benefits:
- 40-80% cost savings through Responses API caching
- 3% better performance on coding tasks (SWE-bench)
- Leverages existing dual-API infrastructure
2025-10-03 13:59:44 +03:00
Fahad
7a6fa0e77a refactor: generic name for the CLI agent 2025-10-03 10:55:10 +04:00
Fahad
6cab9e56fc feat: added intelligence_score to the model capabilities schema; a 1-20 number that can be specified to influence the sort order of models presented to the CLI in auto selection mode
fix: model definition re-introduced into the schema but intelligently and only a summary is generated per tool. Required to ensure CLI calls and uses the correct model
fix: removed `model` param from some tools where this wasn't needed
fix: fixed adherence to `*_ALLOWED_MODELS` by advertising only the allowed models to the CLI
fix: removed duplicates across providers when passing canonical names back to the CLI; the first enabled provider wins
2025-10-02 21:43:44 +04:00
Fahad
d285fadf4c fix: custom provider must only accept a model if it's declared explicitly. Upon model rejection (in auto mode) the list of available models is returned up-front to help with selection. 2025-10-02 13:49:23 +04:00
Fahad
82a03ce63f fix: baseclass should return MODEL_CAPABILITIES 2025-10-02 13:04:33 +04:00
Fahad
693b84db2b refactor: cleanup provider base class; cleanup shared responsibilities; cleanup public contract
docs: document provider base class
refactor: cleanup custom provider, it should only deal with `is_custom` model configurations
fix: make sure openrouter provider does not load `is_custom` models
fix: listmodels tool cleanup
2025-10-02 12:59:45 +04:00
Fahad
6ec2033f34 refactor: cleanup 2025-10-02 11:47:09 +04:00
Fahad
7fe9fc49f8 refactor: cleanup token counting 2025-10-02 11:35:29 +04:00
Fahad
14a35afa1d refactor: moved image related code out of base provider into a separate utility 2025-10-02 11:23:15 +04:00
Fahad
a254ff2220 refactor: removed method from provider, should use model capabilities instead
refactor: cleanup temperature factory method
2025-10-02 11:08:56 +04:00
Fahad
9c11ecc4bf refactor: clean temperature inference 2025-10-02 10:41:05 +04:00
Fahad
6d237d0970 refactor: moved temperature method from base provider to model capabilities
refactor: model listing cleanup, moved logic to model_capabilities.py
docs: added AGENTS.md for onboarding Codex
2025-10-02 10:25:41 +04:00
Fahad
f461cb4519 refactor: moved temperature method from base provider to model capabilities
docs: added AGENTS.md for onboarding Codex
2025-10-02 09:17:36 +04:00
Fahad
1dc25f6c3d refactor: renaming to reflect underlying type
docs: updated to reflect new modules
2025-10-02 09:07:40 +04:00
Fahad
2b10adcaf2 refactor: removed hook from base class, turned into helper static method instead 2025-10-02 08:45:59 +04:00
Fahad
250545e34f refactor: removed hard coded checks, use model capabilities instead 2025-10-02 08:32:51 +04:00
Fahad
182aa627df refactor: code cleanup 2025-10-02 08:09:44 +04:00
Beehive Innovations
48885e7a5b Merge pull request #250 from DragonFSKY/feat/custom-gemini-endpoint
feat: add custom Gemini endpoint support
2025-10-02 06:01:38 +04:00
Fahad
bf9344963f Merge branch 'pr-247-modified' 2025-10-01 19:51:29 +04:00
Fahad
acef7da93c Cleanup 2025-10-01 19:51:24 +04:00
Fahad
484d78d96b Cleanup 2025-10-01 19:46:43 +04:00
Beehive Innovations
f51da6e5f8 Merge branch 'main' into main 2025-10-01 18:19:02 +04:00
Devon Hillard
c29e7623ac fix: Remove duplicate OpenAI models from listmodels output
Fixed issue where OpenAI models appeared twice in listmodels output by:
- Removing self-referencing aliases from OpenAI model definitions (e.g., "gpt-5" no longer includes "gpt-5" in its aliases)
- Adding filter in listmodels.py to skip aliases that match the model name
- Cleaned up inconsistent alias naming (o3-pro -> o3pro)

This ensures each model appears only once in the listing while preserving all useful aliases.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 19:00:43 -06:00
Sven Lito
525f4598ce refactor: address code review feedback from Gemini
- Extract restriction checking logic into reusable helper method
- Refactor validate_model_name to reduce code duplication
- Fix logging import by using existing module-level logger
- Clean up test file by removing print statement and main block
- All tests continue to pass after refactoring
2025-09-05 11:04:45 +07:00
Sven Lito
2db1323813 fix: respect custom OpenAI model temperature settings (#245)
- OpenAI provider now checks custom models registry for user configurations
- Custom models with supports_temperature=false no longer send temperature to API
- Fixes 400 errors for custom o3/gpt-5 models configured without temperature support
- Added comprehensive tests to verify the fix works correctly
- Maintains backward compatibility with built-in models

Fixes #245
2025-09-05 10:53:28 +07:00
Beehive Innovations
472c13bb2e Merge pull request #253 from svnlto/fix/consensus-temperature-handling
fix: resolve temperature handling issues for O3/custom models (#245)
2025-08-24 21:29:14 +04:00
Fahad
a07036e680 fix: another fix for https://github.com/BeehiveInnovations/zen-mcp-server/issues/251 2025-08-24 21:25:01 +04:00
Sven Lito
6bd9d6709a fix: address test failures and PR feedback
- Fix ModelContext constructor call in consensus tool (remove invalid parameters)
- Refactor temperature pattern matching for better readability per code review
- All tests now passing (799/799 passed)
2025-08-23 18:50:49 +07:00
Sven Lito
3b4fd88d7e fix: resolve temperature handling issues for O3/custom models (#245)
- Fix consensus tool hardcoded temperature=0.2 bypassing model capabilities
- Add intelligent temperature inference for unknown custom models
- Support multi-model collaboration (O3, Gemini, Claude, Mistral, DeepSeek)
- Only OpenAI O-series and DeepSeek reasoner models reject temperature
- Most reasoning models (Gemini Pro, Claude, Mistral) DO support temperature
- Comprehensive logging for temperature decisions and user guidance

Resolves: https://github.com/BeehiveInnovations/zen-mcp-server/issues/245
2025-08-23 18:43:51 +07:00
Fahad
f89afd1a72 fix: https://github.com/BeehiveInnovations/zen-mcp-server/issues/251 added handling for safety_feedback from Gemini. FinishReason.STOP can be a hidden safety block from gemini or issued when it chooses not to respond. 2025-08-23 14:03:46 +04:00