Skip to content

fix(http): honor all Accept header field lines - #886

Merged
sv merged 1 commit into
flop-labs:mainfrom
almondous:fix/http-repeated-accept-headers-20260922
Sep 23, 2026
Merged

sv merged 1 commit into
flop-labs:mainfrom
almondous:fix/http-repeated-accept-headers-20260922

Conversation

@almondous

Copy link
Copy Markdown
Contributor

What

Combine all Accept field lines in order before the existing parser. The Markdown-capable documents now negotiate identically for split and comma-combined headers.

Why

Headers.get() reads only the first field line. Accept: text/plain;q=0.2 followed by Accept: text/markdown incorrectly yields plain text; reversing the weighted preference can incorrectly yield Markdown.

RFC 9110 §5.2 defines the combined value. This leaves q-value parsing (the separate concern in PR 78), document bodies, defaults, and signing untouched.

Checks

Verified from upstream e4c4f73, resulting head 033b9c0, in fork Actions:

  • New regression: 12 fail / 18 pass before; 30 pass after, covering all four negotiating documents and both plain manuals, including body/cache/Vary parity.
  • uv run just check: 812 passed, 1 skipped; 98.05% coverage. Unmodified base: 782 passed, 1 skipped.
  • Ruff, format, types, caps/ratchet, browser probe, end-to-end example, MCP build/distribution verification.
  • Existing docs remain accurate; no new public surface or persistent state. No lifecycle-model change.

Proposed release note: Markdown negotiation honors repeated Accept field lines.

Developed with ChatGPT; verification ran in isolated fork CI, not the hosted service.

@sv
sv merged commit abaaa8e into flop-labs:main Sep 23, 2026
9 checks passed
@sv sv mentioned this pull request Sep 24, 2026
7 tasks done
sv added a commit that referenced this pull request Sep 24, 2026
## What

This PR cuts **0.14.4**. It touches the same nine files as #899:
- the CHANGELOG section gets its date;
- the version is bumped in the files the service, the MCP wrapper and
the worker share;
- the measured block of `sz-baseline.json` is re-ratcheted. No cap
moves.

## Why

**Main CI is red.** #585 grew `store.py` from 1025 to 1029 code lines,
which is under its cap of 1030. Since then every push to main has failed
`sz.py --check`, and the steps after it have been skipped: the example
e2e, the MCP wrapper build, and the image build and smoke. This PR's CI
is the first to run those steps against #585, #902 and #903.

Changes since v0.14.3. The release is PATCH, because no route, field or
cap changes:
- **#902:** `?format=json` replies are one compact line, encoded ~50x
faster. It's the same JSON value.
- **#903:** starlette 1.7.0, uvicorn 0.53.0 and cryptography 50.0.1. It
also moves the test-only httpx2 past three Dependabot alerts; the
service could never reach them, and none are open now.
- **#585:** a `?since=` past a room's head is clamped to the head
instead of echoed back.
- **#886:** repeated `Accept` lines are honored.
- **#620:** a streamed request body is measured before it is buffered.
- **#757 (edge):** `/favicon.ico?v=…` is served by the edge.

Following precedent, the test and CI PRs #788, #791 and #871 have no
entries.

**After merge:**
- Tag `v0.14.4` on the squash commit. That publishes
`ghcr.io/flop-labs/technocore-chat:0.14.4`, and the box's autoupdate
timer installs it within ~15 min.
- #757 isn't live until `edge/deploy.sh` runs.
- Whether to cut `mcp-v0.14.4` is your call. 0.14.2 and 0.14.3 skipped
it, and the wrapper hasn't changed.

## Checks

Verified against main at 7772a98, which includes #903.

- [x] `uv run coverage run -m pytest tests -q && uv run coverage
report`: 849 passed, 1 skipped.
- [x] `uv run ruff check . && uv run ruff format --check .` and `uv run
ty check`: clean
- [x] `uv lock --check` passes for the root and for `mcp/worker`, after
`uv build --project mcp` built the 0.14.4 wheel. Only version lines
moved in either lock.
- [x] `sz.py --caps` and `sz.py --check` pass.
- [x] Both `release.yml` gates pass: the tag matches the
`pyproject.toml` version, and CHANGELOG has a `[0.14.4]` section.
- [x] Docs that would now be wrong are updated: `CHANGELOG.md` is the
change
- [x] New surface on a world-writable service: nothing new
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.

2 participants