From d392af66c9a2099b70b96985047b7fe7a662d048 Mon Sep 17 00:00:00 2001 From: fujie Date: Sat, 28 Feb 2026 15:29:46 +0800 Subject: [PATCH] chore: rename update_pipe.py to deploy_pipe.py to reflect its creation capabilities and update skills reference --- .agent/skills/test-copilot-pipe/SKILL.md | 8 ++++---- scripts/{update_pipe.py => deploy_pipe.py} | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) rename scripts/{update_pipe.py => deploy_pipe.py} (83%) diff --git a/.agent/skills/test-copilot-pipe/SKILL.md b/.agent/skills/test-copilot-pipe/SKILL.md index b069887..6bc9e72 100644 --- a/.agent/skills/test-copilot-pipe/SKILL.md +++ b/.agent/skills/test-copilot-pipe/SKILL.md @@ -18,7 +18,7 @@ This is a **universal testing framework** for publishing the latest `github_copi | Attribute | Fixed Value | |------|--------| -| **Deployment Script** | `/Users/fujie/app/python/oui/openwebui-extensions/scripts/update_pipe.py` | +| **Deployment Script** | `/Users/fujie/app/python/oui/openwebui-extensions/scripts/deploy_pipe.py` | | **Python Path** | `/opt/homebrew/Caskroom/miniconda/base/envs/ai/bin/python3` | | **Test URL** | `http://localhost:3003/?model=github_copilot_official_sdk_pipe.github_copilot_sdk-gpt-4.1` | @@ -36,11 +36,11 @@ Example: *Modified tool calling logic -> Test prompt should trigger a specific t Use the `run_command` tool to execute the fixed update task: ```bash -/opt/homebrew/Caskroom/miniconda/base/envs/ai/bin/python3 /Users/fujie/app/python/oui/openwebui-extensions/scripts/update_pipe.py +/opt/homebrew/Caskroom/miniconda/base/envs/ai/bin/python3 /Users/fujie/app/python/oui/openwebui-extensions/scripts/deploy_pipe.py ``` -> **Mechanism**: `update_pipe.py` automatically loads the API Key from `scripts/.env` in the same directory. -> **Verification**: Look for `✅ Successfully updated... version X.X.X`. If a 401 error occurs, remind the user to generate a new API Key in OpenWebUI and update `.env`. +> **Mechanism**: `deploy_pipe.py` automatically loads the API Key from `scripts/.env` in the same directory. +> **Verification**: Look for `✅ Successfully updated... version X.X.X` or `✅ Successfully created...`. If a 401 error occurs, remind the user to generate a new API Key in OpenWebUI and update `.env`. ### Step 3: Verify via Browser Subagent (Verify) diff --git a/scripts/update_pipe.py b/scripts/deploy_pipe.py similarity index 83% rename from scripts/update_pipe.py rename to scripts/deploy_pipe.py index 8e14993..1dc9a93 100644 --- a/scripts/update_pipe.py +++ b/scripts/deploy_pipe.py @@ -36,7 +36,7 @@ def _load_api_key() -> str: raise ValueError("api_key not found in .env file.") -def update_pipe() -> None: +def deploy_pipe() -> None: """Push the latest local github_copilot_sdk.py content to OpenWebUI.""" # 1. Load API key try: @@ -100,11 +100,23 @@ def update_pipe() -> None: if response.status_code == 200: print("✅ Successfully updated GitHub Copilot Official SDK Pipe!") else: - print(f"❌ Failed to update. Status: {response.status_code}") - print(f" Response: {response.text[:500]}") + print( + f"⚠️ Update failed with status {response.status_code}, attempting to create instead..." + ) + CREATE_URL = "http://localhost:3003/api/v1/functions/create" + res_create = requests.post( + CREATE_URL, headers=headers, data=json.dumps(payload) + ) + if res_create.status_code == 200: + print("✅ Successfully created GitHub Copilot Official SDK Pipe!") + else: + print( + f"❌ Failed to update or create. Status: {res_create.status_code}" + ) + print(f" Response: {res_create.text[:500]}") except Exception as e: print(f"❌ Request error: {e}") if __name__ == "__main__": - update_pipe() + deploy_pipe()