Read the BytePlus image table under its annotated header (#640) #642
main fromrefs/pull/642/head·merged by tombeckenham View on GitHubFixes #640.
What changed on the page#
Read from https://docs.byteplus.com/en/docs/ModelArk/1544106 on 2026-11-13:
- The image table's
Output imageheader gained a note line ("P is the total pixel count of a single output image."). The header no longer matched, so no image table was found and every poll threwbyteplus pricing page (images): parsed 0 model rows. - Seedream 5.0 pro's tiers are reworded:
P ≤ 2.61 million (1.5K or lower): $0.045 P > 2.61 million (higher than 1.5K): $0.09(was "Up to 2.61 million pixels … More than …").
Fix#
imageRows(shared byparseByteplusImagesandparseByteplusPixelTiers) takes the output column as the single header starting "Output image".PIXEL_TIER_OUTPUTfollows the new wording. The old wording is gone from the page, so it is not kept.- Still fail-closed: no matching table, or a row in any other wording, gives no price, and an empty image map still throws in
assertParsed. - Fixture
fixtures/byteplus-pricing-images.jsonis the image table cut verbatim from the live doc (row, column and cell zones).
Run against the full live page: chat 14, video 7, images 5, pixel tiers 1.
Not fixed here#
- The 400
pricing_lost/parser_missevents are not a parser miss. The page dropped its folded "Retiring models" section. Eight rows that hold a stored card no longer have a row:deepseek-v3-2-251201,glm-4-7-251222,seed-1-6-250915,seed-1-6-flash-250715,seed-1-8-251228,seed-2-0-lite-260228,seed-2-0-mini-260215,seedance-1-5-pro-251215(8 per poll x ~50 polls = 400). All eight are on the model deprecation notice. Stored cards are kept and the event will keep firing each poll until that is decided separately. dola-seedream-5-5-261028stays unpriced (it has no stored card). Its row is a new shape:$0.008per input image and two bounded pixel tiers. The parser warns and skips it.
Checks#
bun run test src/server/providers/byteplus-pricing.test.ts src/server/providers/byteplus.test.ts (43 passed), bun run typecheck, bun --bun run lint, bun --bun run check. No packages/* change, so no changeset.
Summary by CodeRabbit#
- Bug Fixes
- BytePlus image pricing now reflects published flat rates and pixel-based pricing tiers, including the current “P ≤” and “P >” thresholds.
- Pricing results are empty when a table has no output-image pricing column, and unpriced models are omitted.
- Tables with missing or ambiguous output-image columns are handled more consistently.
- 1
tombeckenham linked this to fix #640
tanstack-source added labelsbug
No actionable comments were generated in the recent review.
Walkthrough
-
The BytePlus image pricing parser now extracts rows from the updated table layout and recognizes the published pixel-tier wording. A fixture and tests cover flat image prices, pixel tiers, and tables without a valid output-image column.
Changes: BytePlus image pricing
Layer / File(s) Summary Shared image-row extraction
src/server/providers/byteplus-pricing.tsA shared extractor selects image pricing tables with exactly one output-image column and returns trimmed row values. Pricing parsing and fixture validation
src/server/providers/byteplus-pricing.ts,src/server/providers/byteplus-pricing.test.ts,src/server/providers/fixtures/byteplus-pricing-images.jsonThe flat-price and pixel-tier parsers use the shared rows. Pixel-tier parsing matches the published P ≤andP >wording. Fixture-based tests check prices, tiers, and tables without an output-image column.Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk:
Minimal · up to9a87d-
The change lets the BytePlus pricing parser read the updated image table and pixel-tier wording, with a fixture and tests. No merge-blocking risk was found. The unpriced Seedream 5.5 model and the pricing_lost events for retired models are known and handled separately.
Pre-merge checks:
4-
Check name Status Explanation Description Check Check skipped - CodeRabbit’s high-level summary is enabled. Title check The title names the main change: the BytePlus image table parser now reads the table under its annotated 'Output image' header. The raw summary confirms this: imageRows matches a header beginning with… Linked Issues check Issue #640requires four things: (1) update the parser for the changed ModelArk page, (2) keep parsing fail-closed with no fallback prices, (3) keep throwing when a page parses nothing, and (4) add a …Out of Scope Changes check All changed areas connect to #640. The parser change in byteplus-pricing.ts updates the image-table header match and pixel-tier wording, which is the reported cause of the 'parsed 0 model rows' failur…Full details: Title check
-
Explanation
The title names the main change: the BytePlus image table parser now reads the table under its annotated 'Output image' header. The raw summary confirms this: imageRows matches a header beginning with 'Output image', and the PR adds a live-table fixture. The title is specific and matches the changeset. The '(
#640)' reference points to the linked issue and is acceptable. The title is 63 characters, which is concise.
Full details: Linked Issues check
-
Explanation
Issue
#640requires four things: (1) update the parser for the changed ModelArk page, (2) keep parsing fail-closed with no fallback prices, (3) keep throwing when a page parses nothing, and (4) add a fixture from the current page. The diff to src/server/providers/byteplus-pricing.ts meets (1): the newimageRowshelper selects the output column by the header prefixOutput image, andPIXEL_TIER_OUTPUTmatches the revisedP ≤/P >wording. BothparseByteplusImagesandparseByteplusPixelTiersuseimageRows. Requirement (2) holds:imageRowsreturns no rows when no single matching output column exists, and no fallback price is added. Requirement (3) relies on the existingassertParsedpath for an empty image map, which the PR states and which this change does not alter. Requirement (4) is met byfixtures/byteplus-pricing-images.jsonand the test additions described in the summary. The PR does not restore the eight retired-model rows that cause the 400pricing_lostevents. The PR argues these rows left the page in a folded 'Retiring models' section and are not a parser miss. That is a product decision, not a coding requirement of#640, so it does not fail this assessment.dola-seedream-5-5-261028stays unpriced by design, and the parser warns and skips it. I did not open the test file or the fixture; the test results come from the PR description.
Full details: Out of Scope Changes check
-
Explanation
All changed areas connect to
#640. The parser change in byteplus-pricing.ts updates the image-table header match and pixel-tier wording, which is the reported cause of the 'parsed 0 model rows' failure. The new fixture is a verbatim cut of the live image table and supports the tests. The test file changes cover the same image and pixel-tier paths. The sharedimageRowshelper is needed because both parsers read the same table. The pixel-tier wording change replaces the old 'Up to' and 'More than' text, which the PR says is no longer on the page. No unrelated chat, video, or package changes appear in the reviewed scope. I did not inspect the test file or the fixture contents directly.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
011bf08c-e740-47bc-af4a-f5b0bdf5ac57
Commits-
Reviewing files that changed from the base of the PR and between 20d83ebb4b4281219e04526ed348c46cf671f2e3 and 9a87d9511b0718587d888b68044f05ecf16f1054.
Files selected for processing: 3-
src/server/providers/byteplus-pricing.test.tssrc/server/providers/byteplus-pricing.tssrc/server/providers/fixtures/byteplus-pricing-images.json
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
-
-
tombeckenham merged this3110d82
tombeckenham closed this
Sign in to join this conversation.
⚠️ No Changeset found#
Latest commit: 9a87d9511b0718587d888b68044f05ecf16f1054
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR