Skip to content

Size cap with max_mb opt-out, real text mode, release/CI hygiene (spec #16) - #20

Merged
ChHsiching merged 23 commits into
mainfrom
spec/16-size-cap-text-mode
Oct 31, 2026
Merged

ChHsiching merged 23 commits into
mainfrom
spec/16-size-cap-text-mode

Conversation

@ChHsiching

@ChHsiching ChHsiching commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Implements spec #16. Closes #16. Closes #17. Closes #18. Closes #19.

What

  • Size cap with max_mb opt-out (ticket Ticket: size cap with max_mb opt-out (reject, never truncate) #17, ADR-0007). Response bodies are capped at 2 MB by default on both the Passthrough and Extraction paths, enforced while reading (Content-Length allows an early reject). Over-limit documents are rejected with an error naming the size and the limit, never truncated. A new optional max_mb parameter raises the cap up to a hard ceiling of 8 for large-context models; it participates in the cache key.
  • Real return_format: text (ticket Ticket: return_format text mode for HTML pages #18). HTML pages return the article's plain text (no markdown syntax) under text, with a whole-document text fallback; raw documents keep returning identical content for both values (ADR-0006 unchanged). Unknown format values are rejected with a typed error instead of silently defaulting.
  • Release & CI hygiene (ticket Ticket: release and CI hygiene (version injection, e2e in CI, go pin, badges) #19). Server version injected from the tag via ldflags (local builds report dev), CI runs the e2e stdio suite, both workflows pin Go 1.26, release and license badges on both READMEs.

Deliberate additions beyond the spec text

Unknown-return_format rejection and case-insensitive acceptance (consistent with the max_mb validation philosophy: never silently lie), and VERSION plumbing in Makefile/build.sh so local release builds can reproduce CI binaries honestly.

Verification

Each ticket landed through an implementer running TDD on its own branch; the integration branch re-verified go test ./..., go vet ./..., and go test -tags=e2e ./internal/mcpserver after every merge. A two-axis code review (standards + spec) ran on the full diff; all findings were fixed in follow-up commits (shared max_mb validation and default-resolution helper, phrase-level test assertions, CeilingMB rename).

One inherent limit, by design: for chunked responses with unknown length the over-limit error can only name the cap and how many bytes were read before the stop, not the document's true size.

@ChHsiching
ChHsiching marked this pull request as ready for review October 31, 2026 07:44
@ChHsiching
ChHsiching merged commit 5f9b52d into main Oct 31, 2026
1 check passed
@ChHsiching
ChHsiching deleted the spec/16-size-cap-text-mode branch October 31, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant