From 19e02a8fba3355ea98902db04dc96ce7a25bead4 Mon Sep 17 00:00:00 2001 From: huashen <2494946808@qq.com> Date: Tue, 28 Jul 2026 23:28:13 +0800 Subject: [PATCH 1/2] feat: migrate plugin api v2 --- .github/workflows/plugin-api-v2.yml | 26 ++++++++++++++++++++++++++ plugin.py | 1 + 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/plugin-api-v2.yml diff --git a/.github/workflows/plugin-api-v2.yml b/.github/workflows/plugin-api-v2.yml new file mode 100644 index 0000000..d754535 --- /dev/null +++ b/.github/workflows/plugin-api-v2.yml @@ -0,0 +1,26 @@ +name: plugin-api-v2 + +on: + pull_request: + push: + +permissions: + contents: read + +jobs: + contract: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: akashic-plugins/plugin-contracts + ref: 24543445c7b99ca63fcd90b5828f754a148b184c + path: .plugin-contracts + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + - name: Check Plugin API v2 + env: + PYTHONPATH: .plugin-contracts + run: python -m akashic_plugin_contracts check plugin.py diff --git a/plugin.py b/plugin.py index ca7ba4e..4dc605b 100644 --- a/plugin.py +++ b/plugin.py @@ -42,6 +42,7 @@ async def run(self, frame: object) -> object: class ContextPressurePlugin(Plugin): + api_version = 2 name = "context_pressure" version = "1.0.0" desc = "上下文压力过高时请求被动循环阶段性收尾" From dbb969f5a70fbfcd50a9f22239b7d9082168f5b2 Mon Sep 17 00:00:00 2001 From: huashen <2494946808@qq.com> Date: Wed, 29 Jul 2026 01:56:00 +0800 Subject: [PATCH 2/2] ci: avoid duplicate branch contract gate --- .github/workflows/plugin-api-v2.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/plugin-api-v2.yml b/.github/workflows/plugin-api-v2.yml index d754535..7c1876b 100644 --- a/.github/workflows/plugin-api-v2.yml +++ b/.github/workflows/plugin-api-v2.yml @@ -3,6 +3,8 @@ name: plugin-api-v2 on: pull_request: push: + branches: + - main permissions: contents: read