Update and Modernization for Qwen3 Coder Next#2
Open
eleqtrizit wants to merge 13 commits intoflorath:masterfrom
Open
Update and Modernization for Qwen3 Coder Next#2eleqtrizit wants to merge 13 commits intoflorath:masterfrom
eleqtrizit wants to merge 13 commits intoflorath:masterfrom
Conversation
- Introduced DETAILED_GUIDE.md to provide comprehensive documentation on the proxy's functionality, architecture, installation, configuration, and fix rules. - Removed the install.sh script and requirements.txt as part of the transition to a new installation method using Hatchling. - Updated pyproject.toml to reflect changes in build system and dependencies. - Refactored README.md to link to the new detailed guide and clarify installation instructions. This commit enhances user experience by centralizing documentation and streamlining installation processes.
- Introduced argparse to allow configuration of target URL, host, and port for the Qwen3 Call Patch Proxy. - Updated logging to reflect the specified host and port during server startup. This enhancement improves flexibility in server configuration and usability.
- Updated configuration constants to use DEFAULT_ prefix for clarity. - Improved logging format for console and file handlers for better readability. - Added whitespace for improved code structure and readability. These changes enhance the maintainability of the code and improve the clarity of log outputs.
- Introduced a `--verbose` command-line argument to enable detailed logging of SSE stream responses. - Enhanced logging within the `handle_request` function to include request and response details, including elapsed time for requests. - Updated application initialization to store the verbose setting for use in logging. These changes improve the observability of the proxy's operations and provide better insights during debugging.
…tion clarity - Revised the Table of Contents in DETAILED_GUIDE.md for better organization. - Streamlined installation instructions in README.md, swapping the order of `uv` and `uvx` methods for clarity. - Enhanced the configuration section in README.md to include detailed command-line arguments and their defaults. These updates improve the documentation's usability and ensure users have clear guidance on installation and configuration options.
- Introduced a new `__main__.py` file to serve as the entry point for the application. - The main function from the `qwen3_call_patch_proxy` module is called when the script is executed. This addition enables direct execution of the proxy, improving usability for users running the application.
- Introduced a mechanism to detect and warn about duplicate tool calls based on function name and arguments. - Enhanced the handling of incomplete JSON content by merging it into a shared buffer for later processing. - Improved logging to provide clearer insights into tool call processing and recovery attempts. These changes enhance the robustness of the tool call handling and improve observability during execution.
- Introduced `test_glob_debug.py` to simulate various scenarios of SSE tool call events, including complete, fragmented, and malformed JSON cases. - Implemented multiple test scenarios to validate the behavior of the proxy when handling tool calls, ensuring robustness in processing and recovery. - The script serves as a mock backend to facilitate testing and debugging of the Qwen3 Call Patch Proxy. This addition enhances testing capabilities and improves the reliability of tool call handling in the application.
- Introduced a new helper function to strip malformed trailing duplicate keys from JSON strings, addressing cases where a key is followed by a value without a colon. - Updated the recovery attempts list to include this new function, enhancing the robustness of JSON handling in the proxy.
- Added `Qwen/Qwen3-Coder-Next-GGUF:Q8_0` to the list of models in the README, enhancing the documentation by providing users with additional resources for tool calls.
- Introduced a new `coverage.json` file to track code coverage metrics, aiming to boost coverage from 52% to over 85%. - Updated `pyproject.toml` to include necessary dependencies for testing, such as `pytest`, `pytest-asyncio`, and `pytest-cov`. - Refactored existing test cases to utilize assertions for better clarity and reliability, replacing print statements with assert statements. - Added comprehensive tests targeting previously uncovered code paths, enhancing the robustness of the test suite and ensuring better validation of tool call handling. These changes significantly improve the testing framework and code quality, providing a solid foundation for future development and maintenance.
- Replaced specific model references with broader categories: `Qwen3 models` and `Qwen3.5 models`, simplifying the documentation and making it more inclusive for users exploring available models.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Qwen3 Call Patch Proxy — Hardening, CLI, Observability & Test Coverage
Now Installable as a Tool
The proxy is now packaged and installable via
uv,uvx, orpip— no manual setup required.(change the URLs below if merged)
Run without installing (uvx):
Install globally (uv):
Install via pip:
Once installed, run the proxy with:
Summary
This PR covers 12 commits of improvements since
3b411310, spanning build system modernization, CLI ergonomics, proxy robustness, observability, and a major test suite overhaul.Changes
Build System Modernization
install.sh,requirements.txt, andsetup.py.pyproject.tomlwithuvlockfile (uv.lock).docs/detailed-guide.md, replaced with top-levelDETAILED_GUIDE.md(340 lines covering architecture, configuration, fix rules, and installation).pytest,pytest-asyncio, andpytest-covas test dependencies inpyproject.toml.CLI & Configuration
argparsesupport (ae6e03d): Themain()function now accepts--target-url,--host, and--portarguments with sensible defaults, replacing hardcoded values.DEFAULT_prefix (dc02a89): All configuration constants renamed withDEFAULT_prefix for clarity.--verboseflag (eca6265): New CLI option to enable detailed SSE stream logging. Request/response details and elapsed time are logged when verbose mode is active.__main__.py(751094d): Added module entry point enablingpython -m qwen3_call_patch_proxyexecution.Proxy Robustness
6d6d0fa): The proxy now detects and warns when the same tool call (by function name + arguments) is emitted more than once in a stream, preventing downstream double-execution.6d6d0fa): Fragmented JSON content is merged into a shared buffer and retried, rather than being dropped.38719e2): New helper function strips trailing duplicate keys (a pattern where a key appears again without a colon), added as an additional JSON recovery strategy.dc02a89,eca6265): Console and file log formats updated for readability; request lifecycle (start, proxied, elapsed) is now traceable.Documentation
DETAILED_GUIDE.md(bfa023d,41b7546): Comprehensive guide covering proxy architecture, fix rule YAML schema, all configuration options, and step-by-step installation for bothuv/uvxand pip workflows.README.md(74ca95e,41b7546,7f623a1): Updated repository URL, reordered installation methods, added full CLI argument reference table, addedQwen/Qwen3-Coder-Next-GGUF:Q8_0to the tested models list.Test Suite
test_coverage_boost.py(983259d): 1,644-line new test file targeting previously uncovered code paths, pushing statement coverage toward 85%+.983259d): All existing test files refactored —printstatements replaced withassertstatements for proper test validation across 22 test files.test_glob_debug.py(27b1fd8): Debug script simulating SSE tool call event streams (complete, fragmented, and malformed JSON cases) for manual and automated proxy validation.coverage.jsonadded tracking 52% statement coverage as the starting baseline beforetest_coverage_boost.pyimprovements.Stats