Skip to content

fix: migrate OpenWebUI drafter boundary and clean runtime state usage - #66

Merged
rlippmann merged 9 commits into
mainfrom
openwebui_drafter_refactor
Aug 10, 2026
Merged

fix: migrate OpenWebUI drafter boundary and clean runtime state usage#66
rlippmann merged 9 commits into
mainfrom
openwebui_drafter_refactor

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

Summary

  • migrate the OpenWebUI directive-drafter reference integration to the public DirectiveDrafter 0.2.0.dev1 boundary
  • switch the OpenWebUI drafter path to the async drafter API and consume DraftResult variants explicitly
  • restrict drafter-driven compiler input across OpenWebUI and LiteLLM drafter paths so only CanonicalDirective reaches engine.step(...)
  • remove leftover host-side directive parsing/rewrite logic from the OpenWebUI drafter integration
  • update OpenWebUI, LiteLLM proxy, and LiteLLM basic runtime state injection paths to read directly from engine.premise and engine.policies

Why

OpenWebUI was still using preprocessor-era directive-drafter orchestration and still carried older host-side parsing logic that no longer belongs outside the public DirectiveDrafter boundary. The cleanup also removes remaining runtime paths that rebuilt compiler state objects where the live engine fields should be the authority.

Example metadata

  • Enforcement point: compiler-owned runtime behavior in reference integrations and prompt-construction examples
  • Domain: OpenWebUI / LiteLLM integration behavior
  • Technology/runtime: Python, OpenWebUI, LiteLLM
  • Example type: reference integration / cookbook / repository maintenance
  • Does this use directive drafter? should normally be no: yes, for the explicitly drafter-enabled integrations/examples only
  • Does this derive state from model output? must be no for primary examples: no

Checklist

  • Repository scaffolding / governance change
  • One primary enforcement point
  • Explicit authoritative state
  • No model-derived state mutation
  • Adversarial stub or equivalent test
  • Observable runtime behavior change
  • Domain vocabulary is natural
  • Framework is secondary to the enforcement point
  • Docs updated
  • Tests/smoke checks added where practical

Notes

Focused validation run:

  • uv run pytest -q python/tests/test_openwebui_pipe_with_directive_drafter.py
  • uv run pytest -q python/tests/test_openwebui_pipe.py python/tests/test_litellm_proxy_hooks.py python/tests/test_litellm_proxy_runtime.py python/tests/test_litellm_proxy_with_directive_drafter.py
  • uv run pytest -q python/tests/test_openwebui_pipe_with_directive_drafter.py python/tests/test_litellm_proxy_with_directive_drafter.py python/tests/test_litellm_with_directive_drafter.py
  • uv run pytest -q python/tests/test_litellm_basic.py

@rlippmann
rlippmann marked this pull request as ready for review August 10, 2026 05:22
@rlippmann
rlippmann merged commit d081a86 into main Aug 10, 2026
6 checks passed
@rlippmann
rlippmann deleted the openwebui_drafter_refactor branch August 10, 2026 05:30
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