Skip to content

Support ai-agent-toolbox 1.x without obsolete Markdown APIs - #36

Merged
mikkel merged 1 commit into
mainfrom
codex/toolbox-compatibility-code
Nov 10, 2026
Merged

mikkel merged 1 commit into
mainfrom
codex/toolbox-compatibility-code

Conversation

@mikkel

@mikkel mikkel commented Nov 10, 2026

Copy link
Copy Markdown
Member

Patchling cannot co-install with ai-agent-toolbox 1.x because metadata caps it below 1.0. Removing only that cap still breaks imports: the real published 1.x wheel no longer exports MarkdownParser/MarkdownPromptFormatter.

Use Patchling's existing extract_diff_blocks implementation for generated Markdown diffs, remove obsolete/unused formatter imports, and retain the real XMLParser + Toolbox path for apply reasoning/tool dispatch. Relax the requirement from ai-agent-toolbox>=0.2.0,<1.0 to ai-agent-toolbox>=0.2.0. No upstream Toolbox changes are needed.

Validation:

  • Original dependency resolution failure reproduced with real 1.0.3; original code also reproduces ImportError on MarkdownParser when the cap is bypassed.
  • Full suites: 263 passed / 2 skipped with actual 0.2.0 (Python 3.10 editable install), 1.0.0 (Python 3.11 installed wheel), and 1.0.3 (Python 3.10 installed source distribution).
  • 11 new regression cases verify the actual installed package/version, real XML events and Toolbox callback dispatch, generated multi-file diffs applied end to end, and provider failure propagation. LLM transport/token counting are mocked; Toolbox classes/events are not stubbed.
  • Wheel/sdist build, strict Twine check, dependency metadata, source contents, license/type marker, all four CLI entrypoints, pip check, py_compile and diff checks passed.
  • The existing CI runs the full suite with the latest compatible published dependency. An additional Python 3.10/3.12 matrix for pinned 0.2.0, 1.0.0, 1.0.3 and latest is fully prepared below, but not applied: GitHub rejected the workflow update because this OAuth credential lacks workflow scope. No credentials or permissions were changed. An owner with existing workflow-write access can apply the proposed patch.

The older task's claimed Toolbox 1.2.1 does not currently exist: official PyPI JSON returns HTTP 404 for 1.2.0 and 1.2.1 and upstream tags stop at 1.0.3. Tests use real released packages rather than inventing those versions. References: https://pypi.org/project/ai-agent-toolbox/ and https://github.com/255BITS/ai-agent-toolbox/tags .

Scope: consumer compatibility only. No version bump, package release, publishing/authentication change, main merge or documentation deployment. Previously retained release artifacts are unchanged; packaging validation used a separate test-artifact directory.

Proposed CI matrix patch (reviewable text only; not installed by this PR):

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 56a6ad7..bb025c4 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -4,22 +4,33 @@ on: [push, pull_request]
 
 jobs:
   test:
+    name: Python ${{ matrix.python }} / Toolbox ${{ matrix.toolbox }}
     runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python: ["3.10", "3.12"]
+        toolbox: ["0.2.0", "1.0.0", "1.0.3", "latest"]
 
     steps:
     - name: Checkout code
       uses: actions/checkout@v4
 
-    - name: Set up Python 3.10
+    - name: Set up Python
       uses: actions/setup-python@v4
       with:
-        python-version: '3.10'
+        python-version: ${{ matrix.python }}
 
     - name: Install dependencies
       run: |
         python -m pip install --upgrade pip
-        pip install -e .[test]
-        pip install pytest
+        if [ "$TOOLBOX_VERSION" = "latest" ]; then
+          python -m pip install --upgrade -e '.[test]' 'ai-agent-toolbox>=0.2.0'
+        else
+          python -m pip install -e '.[test]' "ai-agent-toolbox==$TOOLBOX_VERSION"
+        fi
+        python -m pip check
+        python -c "from importlib.metadata import version; print('ai-agent-toolbox=' + version('ai-agent-toolbox'))"
 
     - name: Run tests
       run: |
@@ -27,3 +38,4 @@ jobs:
 
     env:
       GPTDIFF_LLM_API_KEY: "dummy-key"  # Required but unused in mocked tests
+      TOOLBOX_VERSION: ${{ matrix.toolbox }}

@mikkel
mikkel marked this pull request as ready for review November 10, 2026 05:49
@mikkel
mikkel merged commit 031b40b into main Nov 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant