headroom/docs
Mateus Borges 1e437d781b
docs: document HEADROOM_BETA_HEADER_STICKY and HEADROOM_BETA_TRACKER_MAX_SESSIONS (#1060)
## Description

Documents `HEADROOM_BETA_HEADER_STICKY` and
`HEADROOM_BETA_TRACKER_MAX_SESSIONS` — two env vars that exist in source
and tests but are absent from all `.md` / `.mdx` docs. Adds a **Session
Beta Header Tracking** section explaining the `SessionBetaTracker`
behavior, its prefix-cache rationale, and the operator trade-off.

An operator debugging a beta-header-related upstream rejection cannot
discover the knob or the off-switch without reading source.

Closes #1059

## Type of Change

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring (no functional changes)

## Changes Made

**`wiki/configuration.md`**
- Two new rows in the Environment Variables table:
`HEADROOM_BETA_HEADER_STICKY` and `HEADROOM_BETA_TRACKER_MAX_SESSIONS`
- New `## Session Beta Header Tracking` section with: what the mechanism
does, why it exists (prefix-cache stability), the operator trade-off,
and how to disable

**`docs/content/docs/configuration.mdx`**
- Same two rows added to the Environment Variables table
- Same `### Session Beta Header Tracking` section (matching heading
level)

## Testing

- [ ] Unit tests pass (`pytest`)
- [ ] Linting passes (`ruff check .` — N/A, docs-only change to
`.md`/`.mdx` files)
- [ ] Type checking passes (`mypy headroom` — N/A, docs-only)
- [ ] New tests added for new functionality — N/A, docs-only
- [x] Manual testing performed

### Test Output

```text
Manual verification: confirmed env var names, accepted values, defaults, and LRU bound match code (helpers.py:1610-1629, 1613-1614, 1820-1822). Existing tests exercise the behavior (tests/test_anthropic_beta_session_sticky.py:124).
```

## Real Behavior Proof

- Environment: Ubuntu 24.04, Python 3.12, Headroom v0.25.0, provider:
Anthropic (Claude Code via `headroom wrap`)
- Exact command / steps: `grep -ri "HEADROOM_BETA_HEADER_STICKY"
README.md CHANGELOG.md wiki/ docs/` → 0 matches before; source
inspection of helpers.py:1605-1856, anthropic.py:918-961,
prefix_tracker.py:316-335
- Observed result: env vars now documented in both wiki + docs mirrors;
behavior rationale and trade-off explained
- Not tested: end-to-end proxy run with the new docs in place (docs-only
change; behavior unchanged)

## Review Readiness

- [x] I have performed a self-review
- [x] This PR is ready for human review

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works — N/A, docs-only
- [ ] New and existing unit tests pass locally with my changes — N/A,
docs-only
- [ ] I have updated the CHANGELOG.md if applicable — N/A, changelog is
auto-managed by release-please

## Screenshots (if applicable)

N/A

## Additional Notes

Mirrors the same dual-file pattern used in #579 (wiki + docs mdx). The
documented behavior is contractual — confirmed by
tests/test_anthropic_beta_session_sticky.py:124
(test_beta_seen_turn_1_present_in_turn_2_even_if_client_drops) and the
test module docstring naming Claude Code and Codex CLI as the targeted
clients.
2026-06-16 23:06:41 -07:00
..
app docs: improve discoverability for AI agents and search crawlers 2026-05-13 17:36:06 -07:00
components tokens saved grid 2026-04-12 13:42:20 +06:00
content/docs docs: document HEADROOM_BETA_HEADER_STICKY and HEADROOM_BETA_TRACKER_MAX_SESSIONS (#1060) 2026-06-16 23:06:41 -07:00
lib docs(ci): add CI/CD flow diagrams (#1062) 2026-06-16 23:05:15 -07:00
overrides fix: repair release and docs pipelines 2026-04-16 12:53:51 -05:00
proposals feat: output-token reduction — verbosity shaper, per-user learning, counterfactual savings (#965) 2026-06-16 21:06:43 -07:00
screenshots Merge pull request #147 from JerrettDavis/feat/anthropic-usage-insights 2026-04-12 10:54:22 -07:00
spec docs: align MCP proxy docs with implemented API (#614) 2026-06-10 21:14:23 -05:00
.gitignore new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
auth-modes.md fix: PR-F1 classify_auth_mode helper (Phase F kickoff) 2026-05-03 17:20:14 -07:00
bedrock.md feat(bedrock): cross-region + Converse compression; bundle proxy binary in images (#999) 2026-06-16 09:45:24 -05:00
bun.lock fix(docs): update bun.lock to next 16.2.6 for GHSA-h64f-5h5j-jqjh (CVE-2026-44577) 2026-06-02 04:25:21 +00:00
next.config.mjs new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
observability.md fix(observability): G3 remediation — bound cardinality + wire dead metrics 2026-05-24 10:41:56 -07:00
output-token-reduction-guide.md feat: output-token reduction — verbosity shaper, per-user learning, counterfactual savings (#965) 2026-06-16 21:06:43 -07:00
package-lock.json docs(ci): add CI/CD flow diagrams (#1062) 2026-06-16 23:05:15 -07:00
package.json docs(ci): add CI/CD flow diagrams (#1062) 2026-06-16 23:05:15 -07:00
postcss.config.mjs new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
proxy.ts new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
README.md new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00
rtk-architecture.md fix(observability): wire Phase G PR-G3 RTK + proxy metrics (H-blocker) 2026-05-22 13:18:42 -07:00
source.config.ts docs(ci): add CI/CD flow diagrams (#1062) 2026-06-16 23:05:15 -07:00
tsconfig.json new docs UI + ts doc coverage 2026-04-12 13:15:58 +06:00

docs

This is a Next.js application generated with Create Fumadocs.

Run development server:

npm run dev
# or
pnpm dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

Explore

In the project, you can see:

  • lib/source.ts: Code for content source adapter, loader() provides the interface to access your content.
  • lib/layout.shared.tsx: Shared options for layouts, optional but preferred to keep.
Route Description
app/(home) The route group for your landing page and other pages.
app/docs The documentation layout and pages.
app/api/search/route.ts The Route Handler for search.

Fumadocs MDX

A source.config.ts config file has been included, you can customise different options like frontmatter schema.

Read the Introduction for further details.

Learn More

To learn more about Next.js and Fumadocs, take a look at the following resources: