GLM-5.4 Screenshot Test: Can It Fix a Checkout Button?

GLM-5.4 fixed a 32px checkout button overflow with or without a screenshot. Only the image reply read the order reference. See the before and after in Chrome.

AIHubMix5 min read
GLM-5.4 Screenshot Test: Can It Fix a Checkout Button?

GLM-5.4 fixed the overflowing checkout button twice: once from the code alone and once with the same code plus a screenshot. Both replies identified the right edge and suggested the same declaration, box-sizing: border-box. Applied separately in Chrome, each patch brought the button from 352px back to 320px, flush with its panel.

The screenshot made a difference on a second question: what order reference is printed above the button? Only the image-bearing request contained the freshly generated reference. That reply transcribed TXA-B4M exactly; the text-only reply returned null as instructed. The picture supplied information the CSS couldn't, even though it didn't change the fix on this page.

Original checkout sent to the image arm. The Pay button extends past the right edge of the order panel, below reference TXA-B4M.

The CSS explains all 32 pixels

The page is a small checkout built for this test, with no customer data. In a 390px-wide viewport, its order panel is 320px wide. The button has no border. These are the declarations that determine its width:

.pay {
  width: 100%;
  padding: 0 16px;
  border: 0;
  box-sizing: content-box;
}

With content-box, 100% gives the content all 320px. Padding adds 16px on either side, taking the button to 352px. We applied the declaration from each reply to a separate copy of the broken page. At the same viewport width, Chrome's bounding rectangles measured a 0px difference at both the left and right edges after each fix. Both 16px paddings and the “Pay $12.00” label survived. MDN's box model explanation shows why that one change works.

Chrome after applying the image arm's CSS declaration. The Pay button fits the panel; the text-only arm produced the same render.

Give the screenshot a job the code can't do

Use two fresh Chat Completions requests. Give both the same HTML and CSS, viewport width and question. Keep the order reference out of the text: the template contains {{ORDER_REF}}, replaced only when rendering the page. Attach the original, broken screenshot to the second request as an image_url content part. Both calls here used the AIHubMix model ID coding-glm-5.4, POST /v1/chat/completions, the same 1,800-token output cap and no specified temperature. The channel guide lists image input without publishing a verified vision flag. Reading the reference is direct evidence for this PNG on this route.

Ask which edge the button crosses, which single CSS declaration would fix it while preserving the padding, and what order reference is visible. Ask for null if no screenshot shows the reference. For a new run, generate a fresh reference before taking the screenshot. Reusing the example printed here makes it easier to guess.

The HTML and prompt below are shorter than the ones we measured. They reproduce the layout bug, not the exact token counts. Save this as checkout.html. Make a second copy, replace the placeholder only in that copy, open it in a 390px-wide viewport at 100% zoom, and save a screenshot as before.png. Keep the unfilled file for the model:

<!doctype html><meta name="viewport" content="width=device-width, initial-scale=1">
<style>
  .panel { width: 320px; margin: 32px auto; outline: 2px solid #687f7a; }
  .pay { display: block; width: 100%; padding: 0 16px; border: 0;
         box-sizing: content-box; height: 48px; }
</style>
<main class="panel"><p>Order ref: {{ORDER_REF}}</p><button class="pay">Pay $12.00</button></main>

This OpenAI-compatible client sends two requests. Use a funded AIHubMix key. Both get the same question, and only the second gets the image.

import base64, os
from pathlib import Path
from openai import APIStatusError, OpenAI

client = OpenAI(base_url="https://aihubmix.com/v1", api_key=os.environ["AIHUBMIX_API_KEY"], max_retries=0)
question = ("390px viewport. Which panel edge does .pay cross? Give one CSS declaration "
            "that keeps both 16px paddings and full width. Read the order reference only "
            "if visible in a screenshot, else null. Return JSON: edge, property, value, order_ref.\n")
text = {"type": "text", "text": question + Path("checkout.html").read_text()}
png = base64.b64encode(Path("before.png").read_bytes()).decode()
image = {"type": "image_url", "image_url": {"url": "data:image/png;base64," + png}}
for arm, parts in [("text", [text]), ("image", [text, image])]:
    try:
        reply = client.chat.completions.create(model="coding-glm-5.4", max_tokens=1800,
                    messages=[{"role": "user", "content": parts}])
        print(arm, reply.choices[0].message.content)
    except APIStatusError as error:
        print(arm, error.status_code)

Keep the two scores separate. Image reading: the text-only answer should return null; the image answer should transcribe the fresh reference exactly. Repair: apply each reply's declaration to a clean copy of the broken page. Check that both button edges are within 1 CSS pixel of their respective panel edges, both paddings remain 16px, and the button still says “Pay $12.00”. A plausible explanation isn't a passing patch. Reading the reference is also no guarantee the proposed CSS works.

What came back from the gateway

Both requests completed with HTTP 200 at 10:07 UTC on November 23, 2026. We sent coding-glm-5.4 in the request's model field; both responses reported glm-5.4. Here are the actual answers and the gateway's token counts:

Input Edge Order reference Input tokens Output tokens
Code only Right null 573 28
Code + screenshot Right TXA-B4M 743 66

Both replies returned box-sizing as the property and border-box as the value. The text reply was plain JSON; the image reply wrapped its JSON in a Markdown code block. After stripping those backticks and applying each declaration, the two patched pages rendered identically.

The screenshot run used 170 more input tokens for the same prompt text. The replies also had different lengths; their output tokens aren't part of that 170. For the distinction between the Coding Plan and the AIHubMix channel, see the GLM-5.4 launch guide.

FAQ

Would a correct 352px answer prove the model saw the image?
No. The stylesheet gives the width, padding and box model even in the text-only request.

Can the fixed screenshot serve as the image input?
Use the broken version. The corrected screenshot shown here was taken only after applying the model's CSS.

Why keep the padding in the acceptance check?
Removing it would make the button fit, but would change the design the task asks the model to preserve.

Did GLM-5.4 edit the PNG itself?
No. It received the screenshot and returned a CSS declaration. Chrome rendered the corrected checkout after we applied that declaration.

How much did the screenshot add to the token count?
The gateway reported 743 input tokens with the screenshot and 573 without it: a difference of 170 for this image. Neither request reported a cache hit.

Did including a screenshot make the repair better?
Both patches passed the same browser checks. The image added a correct order reference, not a better layout repair in this example. One pair cannot establish general accuracy.

Sources

  1. Original checkout sent to the model and checkout after the model's CSS fix: same viewport, same order reference.
  2. AIHubMix channel guide: endpoint, ID and image-capability caveat.
  3. Zixuan Li's release announcement: vision on the GLM Coding Plan.
  4. MDN: box-sizing: how padding changes the used width.
  5. MDN: getBoundingClientRect: measuring element edges in the viewport.

Keep reading

One gateway to multiple AI providers. Built for production.

Visit AIHubMix