Commit Graph

191 Commits

Author SHA1 Message Date
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
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
182aa627df refactor: code cleanup 2025-10-02 08:09:44 +04:00
Fahad
cc8a4dfd21 Overall savings should now be 50%+ tokens used
perf: tweaks to schema descriptions, aiming to reduce token usage without performance degradation
2025-10-01 22:39:12 +04:00
Fahad
f69ff03c4d refactor: trimmed some prompts
style: version tool output now mentions the default model in use
2025-10-01 21:55:05 +04:00
Fahad
d9449c7bb6 feat: depending on the number of tools in use, this change should save ~50% of overall tokens used. fixes https://github.com/BeehiveInnovations/zen-mcp-server/issues/255 but also refactored individual tools to instead encourage the agent to use the listmodels tool if needed. 2025-10-01 21:40:31 +04:00
Fahad
696b45f25e fix: https://github.com/BeehiveInnovations/zen-mcp-server/issues/258 2025-10-01 20:23:38 +04:00
Beehive Innovations
77caef6f54 Merge pull request #260 from DragonFSKY/fix/consensus-model-context-issue
fix: resolve consensus tool model_context parameter missing issue
2025-10-01 19:27:47 +04:00
Fahad
cff6d8998f fix: removed use_websearch; this parameter was confusing Codex. It started using this to prompt the external model to perform searches! web-search is enabled by Claude / Codex etc by default and the external agent can ask claude to search on its behalf. 2025-10-01 18:44:11 +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
谢栋梁
0760b31f8a style: fix trailing whitespace in consensus.py
Remove trailing whitespace to pass CI formatting checks
2025-09-03 11:10:02 +08:00
谢栋梁
30a8952fbc refactor: optimize ModelContext creation in consensus tool
Address code review feedback by creating ModelContext instance once
at the beginning of _consult_model method instead of creating it twice.

- Move ModelContext import to method beginning for better practice
- Create single ModelContext instance and reuse for both file processing
  and temperature validation
- Remove redundant ModelContext creation on line 558
- Improve code clarity and efficiency as suggested by code review
2025-09-03 11:03:04 +08:00
谢栋梁
9044b63809 fix: resolve consensus tool model_context parameter missing issue
Fixed runtime bug where _prepare_file_content_for_prompt was called
without required model_context parameter, causing RuntimeError when
processing requests with relevant_files.

- Create ModelContext instance with model_name in _consult_model method
- Pass model_context parameter to _prepare_file_content_for_prompt call
- Add comprehensive regression test to prevent future occurrences
- Maintain consensus tool's blinded design with independent model contexts
2025-09-03 10:55:22 +08: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
Fahad
4b202f5d1d feat: refactored and tweaked model descriptions / schema to use fewer tokens at launch (average reduction per field description: 60-80%) without sacrificing tool effectiveness
Disabled secondary tools by default (for new installations), updated README.md with instructions on how to enable these in .env
run-server.sh now displays disabled / enabled tools (when DISABLED_TOOLS is set)
2025-08-22 09:23:59 +04:00
Fahad
6921616db3 WIP: tool description / schema updates 2025-08-22 06:53:05 +04:00
Fahad
80d21e57c0 feat: refactored and improved codereview in line with precommit. Reviews are now either external (default) or internal. Takes away anxiety and loss of tokens when Claude incorrectly decides to be 'confident' about its own changes and bungle things up.
fix: Minor tweaks to prompts
fix: Improved support for smaller models that struggle with strict structured JSON output
Rearranged reasons to use the MCP above quick start (collapsed)
2025-08-21 14:04:32 +04:00
Fahad
d30c212029 refactor: minor prompt tweaks 2025-08-21 12:23:13 +04:00
Fahad
77e8ed1a9f Further improvements to precommit to ensure required steps are followed precisely 2025-08-20 16:08:22 +04:00
Fahad
57200a8a2e Precommit updated to always perform external analysis (via _other_ model) unless specified not to. This prevents Claude from being overconfident and inadequately performing subpar precommit checks.
Improved precommit continuations to be immediate
Workflow state restoration added between stateless calls
Fixed incorrect token limit check
2025-08-20 15:19:01 +04:00
Fahad
0af9202012 Precommit updated to take always prefer external analysis (via _other_ model) unless specified not to. This prevents Claude from being overconfident and inadequately performing subpar precommit checks. 2025-08-20 11:55:40 +04:00
google-labs-jules[bot]
0959d6f0fa feat: Update Claude models to Opus 4.1 and Sonnet 4.1
This commit updates all references to Claude Opus 4 and Sonnet 4 to their newer 4.1 versions throughout the codebase.

The changes include:
- Updating model names in `conf/custom_models.json` and `providers/dial.py`.
- Updating aliases and descriptions to match the new model versions.
- Updating `.env.example` to reflect the new model names.
- Updating all relevant test suites to use the new model names and ensure all tests pass.
2025-08-17 16:08:52 +00:00
Fahad
e29deb23db Improvements to consensus 2025-08-08 12:59:41 +05:00
Fahad
b212cae5de Fixed labeling 2025-08-08 12:35:30 +05:00
Fahad
1c3dea3a08 Fixed labeling 2025-08-08 12:33:41 +05:00
Beehive Innovations
bea021a021 Merge pull request #207 from GiGiDKR/fix/workflow-localization-signature-harmonization
fix: harmonize method signatures and add localization support for workflow tools
2025-08-07 22:35:46 -07:00
Fahad
2fa2d5a408 Fixed contamination in consensus https://github.com/BeehiveInnovations/zen-mcp-server/issues/162
Fixed broken test
2025-08-08 10:04:40 +05:00
Fahad
8203baa4ef Ensure continuation id is passed back 2025-08-08 09:01:44 +05:00
Fahad
1a8ec2e12f GPT-5, GPT-5-mini support
Improvements to model name resolution
Improved instructions for multi-step workflows when continuation is available
Improved instructions for chat tool
Improved preferred model resolution, moved code from registry -> each provider
Updated tests
2025-08-08 08:51:34 +05:00
Fahad
9a4791cb06 Updated description 2025-08-08 05:26:45 +05:00
GiGiDKR
d327c90d82 fix: use precise type hint Optional[dict[str, Any]] for arguments parameter
- Update arguments parameter type hint from Optional[dict] to Optional[dict[str, Any]] in workflow_mixin.py
- Ensures consistency with BaseTool and improves static analysis and code clarity
- No functional changes, only type annotation improvement

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-25 07:00:22 +02:00
OhMyApps
81551f8452 fix: harmonize method signatures and add localization support for workflow tools
- Add LOCALE-based localization support to all workflow tools
- Harmonize method signatures for prepare_prompt and _prepare_file_content_for_prompt
- Remove obsolete methods and clarify comments
- Ensure consistent behavior between SimpleTool and WorkflowTool
2025-07-25 06:48:44 +02:00
Fahad
268df43858 Improved auto-challenge invocation
Automatically determine MCP client's name
2025-06-30 13:31:04 +04:00
Fahad
a54343dc79 Improved challenge prompt and instructions 2025-06-29 17:52:00 +04:00
Fahad
6b495cea0b New tool! "challenge" with confidence and stop Claude from agreeing with you blindly and undoing the _correct_ strategy because you were wrong
Fixed run script to ensure pip is installed
2025-06-29 15:50:45 +04:00
Fahad
df5e8e6793 Merge remote-tracking branch 'origin/main' 2025-06-29 13:01:17 +04:00
OhMyApps
479f556535 Merge branch 'BeehiveInnovations:main' into feat-dockerisation 2025-06-29 02:07:06 +02:00
Fahad
26169ae827 Disable auto mode for consensus 2025-06-28 22:40:19 +04:00
Fahad
b9c2e4f5e6 Tweaks to prompts to prevent Claude from becoming overconfident 2025-06-28 22:30:58 +04:00
Fahad
adbc4af4a9 Update confidence enum values across workflow tools
Added new confidence values (very_high, almost_certain) to all workflow tools
to provide more granular confidence tracking. Updated enum declarations in:
- analyze.py, codereview.py, debug.py, precommit.py, secaudit.py, testgen.py
- Updated debug.py's get_required_actions to handle new confidence values
- All tools now use consistent 7-value confidence scale
- refactor.py kept its unique scale (exploring/incomplete/partial/complete)

Also fixed model thinking configuration:
- Added very_high and almost_certain to MODEL_THINKING_PREFERENCES
- Set medium thinking for very_high, high thinking for almost_certain
- Updated prompts to clarify certain means 100% local confidence

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-28 00:04:35 +04:00
Fahad
bc447d4bcd Generic naming to work with Gemini CLI / Claude Code 2025-06-27 23:41:20 +04:00
OhMyApps
62178aa073 Merge branch 'BeehiveInnovations:main' into feat-dockerisation 2025-06-27 18:45:41 +02:00
Beehive Innovations
7f6a37a7b9 Merge pull request #131 from GiGiDKR/feat-local_support_with_UTF-8_encoding-update
feat: local support with utf 8 encoding
2025-06-27 08:02:14 -07:00
Fahad
090931d7cf Fixed linebreaks
Cleanup
Pass excluded fields to the schema builder directly
2025-06-27 14:29:10 +04:00
Fahad
0237fb3419 Set read-only annotation hints on each tool for security 2025-06-26 13:16:00 +04:00
OhMyApps
453f921df6 Merge branch 'main' into feat-dockerisation 2025-06-25 18:10:26 +02:00
Fahad
3ce0f93e5b Lint 2025-06-25 19:37:25 +04:00
Fahad
6d0bafa81d Support for Gemini CLI (setup instructions) - WIP 2025-06-25 19:36:09 +04:00