diff --git a/plugins/filters/async-context-compression/README.md b/plugins/filters/async-context-compression/README.md index abee133..7036d62 100644 --- a/plugins/filters/async-context-compression/README.md +++ b/plugins/filters/async-context-compression/README.md @@ -1,6 +1,6 @@ # Async Context Compression Filter -**Author:** [Fu-Jie](https://github.com/Fu-Jie) | **Version:** 1.1.0 | **License:** MIT +**Author:** [Fu-Jie](https://github.com/Fu-Jie) | **Version:** 1.1.1 | **License:** MIT This filter reduces token consumption in long conversations through intelligent summarization and message compression while keeping conversations coherent. @@ -54,6 +54,7 @@ It is recommended to keep this filter early in the chain so it runs before filte | `summary_temperature` | `0.3` | Randomness for summary generation. Lower is more deterministic. | | `model_thresholds` | `{}` | Per-model overrides for `compression_threshold_tokens` and `max_context_tokens` (useful for mixed models). | | `debug_mode` | `true` | Log verbose debug info. Set to `false` in production. | +| `show_debug_log` | `false` | Print debug logs to browser console (F12). Useful for frontend debugging. | --- diff --git a/plugins/filters/async-context-compression/README_CN.md b/plugins/filters/async-context-compression/README_CN.md index ab26ecc..8d596d5 100644 --- a/plugins/filters/async-context-compression/README_CN.md +++ b/plugins/filters/async-context-compression/README_CN.md @@ -1,6 +1,6 @@ # 异步上下文压缩过滤器 -**作者:** [Fu-Jie](https://github.com/Fu-Jie) | **版本:** 1.2.0 | **许可证:** MIT +**作者:** [Fu-Jie](https://github.com/Fu-Jie) | **版本:** 1.1.1 | **许可证:** MIT > **重要提示**:为了确保所有过滤器的可维护性和易用性,每个过滤器都应附带清晰、完整的文档,以确保其功能、配置和使用方法得到充分说明。 @@ -94,6 +94,11 @@ - **默认值**: `true` - **描述**: 是否在 Open WebUI 的控制台日志中打印详细的调试信息(如 Token 计数、压缩进度、数据库操作等)。生产环境建议设为 `false`。 +#### `show_debug_log` + +- **默认值**: `false` +- **描述**: 是否在浏览器控制台 (F12) 打印调试日志。便于前端调试。 + --- ## 故障排除 diff --git a/scripts/openwebui_community_client.py b/scripts/openwebui_community_client.py index dc41ecb..5ac29e1 100644 --- a/scripts/openwebui_community_client.py +++ b/scripts/openwebui_community_client.py @@ -469,10 +469,42 @@ class OpenWebUICommunityClient: return True, f"Created new post (ID: {new_post_id})" return False, "Failed to create new post" + # 获取远程帖子信息(只需获取一次) + remote_post = None + if post_id: + remote_post = self.get_post(post_id) + # 版本检查(仅对更新有效) - if not force and local_version: - if not self.version_needs_update(post_id, local_version): - return True, f"Skipped: version {local_version} matches remote" + if not force and local_version and remote_post: + remote_version = ( + remote_post.get("data", {}) + .get("function", {}) + .get("meta", {}) + .get("manifest", {}) + .get("version") + ) + + version_changed = local_version != remote_version + + # 检查 README 是否变化 + readme_changed = False + remote_content = remote_post.get("content", "") + local_content = readme_content or metadata.get("description", "") + + # 简单的内容比较 (去除首尾空白) + if (local_content or "").strip() != (remote_content or "").strip(): + readme_changed = True + + if not version_changed and not readme_changed: + return ( + True, + f"Skipped: version {local_version} matches remote and no README changes", + ) + + if readme_changed and not version_changed: + print( + f" ℹ️ Version match ({local_version}) but README changed. Updating..." + ) # 更新 success = self.update_plugin( @@ -484,7 +516,9 @@ class OpenWebUICommunityClient: ) if success: - return True, f"Updated to version {local_version}" + if local_version: + return True, f"Updated to version {local_version}" + return True, "Updated plugin" return False, "Update failed" def _parse_frontmatter(self, content: str) -> Dict[str, str]: