AAcceptMatrix
AI coding workspace

HTTP media preferences

A wildcard does not erase an explicit refusal. AcceptMatrix is a Windows AI coding client for exploring media-choice code against parsed request preferences and checking why one supported representation wins.

● ● ●AcceptMatrix●
A concrete starting point · HTTP media preferences ×
def choose_media(ranges):
    offered = ["application/json", "text/plain"]
    if not ranges:
        return offered[0]
    choices = []
    for i, media in enumerate(offered):
        family = media.split("/")[0] + "/*"
        matches = [(2 if p == media else 1 if p == family else 0, q)
                   for p, q in ranges if p in (media, family, "*/*")]
        quality = max(matches, default=(-1, 0))[1]
        if quality > 0:
            choices.append((quality, -i, media))
    return max(choices)[2] if choices else None
✳Choose between JSON and plain text using already parsed Accept ranges.
✓ ChangesReview before applying ↗
Illustrative workspace
01

Connection

Base URL, credentials and a reachable server.

02

Project

Test an exact type with quality zero beside a positive wildcard and an empty preference list, respecting specific exclusions instead of letting the wildcard override them.

03

Review before applying

Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

Workflows

HTTP media preferences

Workflows ↗
A concrete starting point
def choose_media(ranges):
    offered = ["application/json", "text/plain"]
    if not ranges:
        return offered[0]
    choices = []
    for i, media in enumerate(offered):
        family = media.split("/")[0] + "/*"
        matches = [(2 if p == media else 1 if p == family else 0, q)
                   for p, q in ranges if p in (media, family, "*/*")]
        quality = max(matches, default=(-1, 0))[1]
        if quality > 0:
            choices.append((quality, -i, media))
    return max(choices)[2] if choices else None
AI coding workspace

Make response-format decisions explainable in code review

A client can express several acceptable response formats, and a server still needs a clear rule for choosing among them. AcceptMatrix brings that decision into a Windows AI coding workspace. Open the request-handling project and discuss how parsed preferences reach the code that selects and produces a response.

One useful review task is checking a media-selection function against explicit exclusions and broader wildcard preferences. Supply the representations your application actually offers and ask the connected model to trace a few concrete requests. Keep parsing assumptions visible: a selector receiving parsed ranges cannot establish that the original header was interpreted correctly.

From those examples, define the expected response when no offered format qualifies and when preferences tie. Review both the selection change and its integration with the response writer. Run project tests that verify the chosen media type and the resulting status, so the patch does not merely return an appealing string while the handler sends something else.

AcceptMatrix connects to supported OpenAI-compatible or Anthropic endpoints. An uncensored AI model is an option when available through that connection; its response behavior and working limits remain model-dependent. The practical value is a review conversation grounded in your service contract, with proposed edits that you assess against real request cases.

Make response-format decisions explainable in code review — questions before editing

Which request examples should I bring to the review?

Include an ordinary preference, a wildcard, an explicit exclusion and a request that accepts none of the offered formats. State the expected response for each. Keep the list of server-supported representations beside those cases.

Why inspect the parser separately from the selector?

The selector may rely on already validated ranges and quality values. If parsing changes their meaning, a correct selection function can still produce the wrong response. Trace that boundary and test the assumptions each layer makes.

What should happen when no representation qualifies?

Use the response behavior required by your application contract and verify the handler implements it. Ask the model to identify the existing failure path before proposing a new one, including status handling and any fallback body.

How do I evaluate a tie-breaking change?

Make the priority rule explicit and add cases where equally acceptable formats compete. Review whether the selected representation is actually produced by the response writer. A deterministic selector is useful only when the integration respects its decision.

Get the Windows app ↗

AcceptMatrix · Updated 2026-10-25