docs: add pipeline-extension recipe and x-headroom-base-url routing docs#1712
Open
Parideboy wants to merge 1 commit into
Open
docs: add pipeline-extension recipe and x-headroom-base-url routing docs#1712Parideboy wants to merge 1 commit into
Parideboy wants to merge 1 commit into
Conversation
The headroom.pipeline_extension entry-point mechanism and the x-headroom-base-url per-request upstream override both exist on main but were undocumented — users only found them by reading source. Add a docs page with a request-normalization recipe for quirky upstream providers (content: null + tool_calls rejected by some OpenAI-compatible gateways) and document per-request upstream routing via x-headroom-base-url. Fixes headroomlabs-ai#1697 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
PR governanceThis PR follows the template and is marked ready for human review. |
JerrettDavis
approved these changes
Jul 2, 2026
JerrettDavis
left a comment
Collaborator
There was a problem hiding this comment.
Docs review looks good. I checked the documented entry-point group, PipelineStage names, fail-open extension dispatch, proxy config fields, and x-headroom-base-url handling against the current source, and the new page lines up with the implemented contract. The recipe is concrete without changing runtime behavior.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Issue #1697 asked for two things: (1) a documented recipe for writing a request-normalization
headroom.pipeline_extensionfor quirky upstream providers (the reporter's provider rejects OpenAI-speccontent: null+tool_callsassistant messages, and they solved it with aPRE_SENDextension they could only discover by reading source), and (2) shipping thex-headroom-base-urlper-request upstream override. The header support already exists on main (headroom/proxy/handlers/openai.pyhonors it in the dedicated chat/responses handlers and passthrough) and will ship with the next release-please release, so this PR delivers the missing piece: documentation for both.Adds
docs/content/docs/pipeline-extensions.mdxcovering the entry-point contract (headroom.pipeline_extension,PipelineStage, fail-open dispatch,discover_pipeline_extensions/pipeline_extensionsconfig), a complete copy-pasteableNullContentNormalizerrecipe withpyproject.tomlentry-point registration, and a section on per-request upstream routing withx-headroom-base-url(including theHEADROOM_STRIP_INTERNAL_HEADERSinteraction).Fixes #1697
Type of Change
Changes Made
docs/content/docs/pipeline-extensions.mdx: lifecycle-stage table, request-normalization extension recipe (class + entry-point registration + discovery/fail-open semantics), andx-headroom-base-urlper-request routing section with acurlexample.docs/content/docs/meta.json: addedpipeline-extensionsto the nav afterconfiguration.Testing
pytest)ruff check .)mypy headroom)Test Output
Real Behavior Proof
upstream/main(9fbd47b), Python 3.13.headroom/pipeline.py(entry-point group,PipelineStage.PRE_SEND, fail-open dispatch inPipelineExtensionManager.emit, class auto-instantiation indiscover_pipeline_extensions),headroom/proxy/server.py(PipelineExtensionManager(discover=config.discover_pipeline_extensions)at proxy startup),headroom/proxy/models.py(pipeline_extensions/discover_pipeline_extensionsconfig fields),headroom/proxy/handlers/openai.py(x-headroom-base-urlconstant and_resolve_openai_upstream); validatedmeta.jsonstill parses.Review Readiness