Repository navigation
fix(byteplus): restore the docs content class and stop capturing a malformed status - #429
Merged
Merged
Conversation
…lformed status Three post-merge defects from PR #424. The docs page used `<main class="content">` where every one of the 40+ sibling pages uses `docs-content`. That class owns the content margin, padding, sizing and word-wrapping, and `sidebar.js` selects `.docs-content` to build the page TOC, returning early when it is absent. One root cause, two visible effects: the fixed sidebar overlaid the title, prose and code examples at 1440x900 and content lost its gutter at 375x667 and 430x932, and the page generated zero TOC links with all six h2 ids left empty. Verified by screenshot at all three viewports against `docs/video/` as the control; TOC links go 0 -> 6 and every heading id populates. No other page in `docs/` carries the wrong class. The poll handler coerced the upstream status with `String(status ?? "")`, so an absent status became `""` and a numeric `123` became `"123"`. Terminal is the complement of the non-terminal pair, so both read as terminal: record mode persisted an envelope replay cannot serve and swapped the job to replay, after which every later poll 502s on that same envelope and a corrected upstream response is never fetched for that job. The status now has to clear the same predicate replay applies — a non-empty string — before it can be terminal. This is malformed-upstream robustness only. Ark is not known to emit such a body, and 4xx/5xx, non-JSON and non-object bodies are out of scope, already rejected upstream of this check. Also corrects two inaccurate descriptions, neither a runtime change: the docs promised the stale-URL warning fires once per job when it latches once per shared fixture envelope, and the match-key docblock promised an unconditional newline when a text-free key is the bare `[media: ...]` suffix.
commit: |
Merged
jpr5
added a commit
that referenced
this pull request
Sep 11, 2026
Cuts the accumulated `[Unreleased]` work. **MINOR** — a new provider surface (BytePlus Ark video) and new endpoints, no breaking changes. **Prepared, not merged.** `publish-release.yml` fires on push-to-main, so merging this publishes to npm, tags `v1.41.0`, cuts the GitHub Release, dispatches the Docker build, and posts to Slack. Merge when you want it live. ## What ships Only **#424** (plus its follow-up **#429**, which fixes the same never-released BytePlus code) touches the published package. Verified against `package.json` `files` + `tsconfig` include/exclude: ``` git log v1.40.0..origin/main --oneline -- src/ ':(exclude)src/__tests__/' fixtures/ .claude-plugin/ skills/ CHANGELOG.md ``` …returns byteplus commits only. #422, #423, #425, #426, #427, #428 touch scripts/, .github/ and docs/ exclusively and are deliberately **not** in the CHANGELOG. ### Added - BytePlus Ark (Seedance) video record/replay — submit, poll and retrieve, stored as the raw Ark task envelope - `--provider-byteplus` flag ### Changed - `/api/v3` chat and image requests are attributed to the `byteplus` provider - `aimock-pytest` pin moves to 1.41.0 ### Fixed - Startup error when a BytePlus provider base already ends in `/api/v3` ## Version surfaces — seven, all bumped Found by grepping the tree for `1.40.0`, not from a checklist. **Zero occurrences of the old string remain** (excluding `CHANGELOG.md` history, `fixtures/` and `pnpm-lock.yaml`): | File | Field | 1.40.0 → 1.41.0 | | --- | --- | --- | | `package.json` | `version` | ✔ | | `charts/aimock/Chart.yaml` | `appVersion` (chart `version` stays `0.1.0`) | ✔ | | `.claude-plugin/plugin.json` | `version` | ✔ | | `.claude-plugin/marketplace.json` | `plugins[0].source.version` (`^1.41.0`) | ✔ | | `docs/index.html` | demo banner `aimock v…` | ✔ | | `packages/aimock-pytest/src/aimock_pytest/_version.py` | `AIMOCK_VERSION` npm pin | ✔ | | `packages/aimock-pytest/README.md` | `--aimock-version` default | ✔ | `AIMOCK_VERSION` **must** move this release: `/api/v3/contents/generations/tasks` is a new server route, so a default-download pytest user on the 1.40.0 pin would run a server without it. `packages/aimock-pytest/pyproject.toml` is deliberately untouched — that package versions on its own PyPI cadence. There is **no version constant in `src/cli.ts`** and **no `metadata.version` in `marketplace.json`** in this tree; both surfaces exist only in the release checklist, not in the repo. ## Drive-by: the npm description has been `<div align="center">` since the README got a centered header `npm view @copilotkit/[email protected] description` returns the literal string `<div align="center">`. Both README-subtitle extractors — the inline `node -e` in `publish-release.yml` and `syncDescriptionFromReadme()` in `scripts/drift-sync.ts` — skip `#`, `[`, ` https://claude.ai/code/session_01AvkmhXVLqSSEW6FvPQHSu5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three defects an independent review found on
mainafter PR #424 merged. All three were reproduced onorigin/main@7040a2dbefore any change was made.1. P2 — the docs page is visually broken
docs/byteplus-video/index.htmlused<main class="content">. Every other page indocs/usesdocs-content— a sweep of all 40+ pages found this one as the sole exception, so it is template drift, not an alternate layout.docs/style.cssputs the content margin, padding, sizing, max/min width and word-wrapping on.docs-content, anddocs/sidebar.js:151selects.docs-contentand returns early when it is absent, before assigning heading ids or building the TOC. One root cause, two visible effects.Verified by Playwright screenshots on a locally served
docs/tree at 1440x900, 375x667 and 430x932, withdocs/video/as the control, and the images inspected directly rather than trusting measurements.Before — 1440x900: the fixed sidebar overlays the content; the title renders as "…eedance) Video" with its left half hidden, and every paragraph and code block is clipped on the left. 375x667 and 430x932: content has no gutter at all, starting flush at x=0, and every line runs off the right edge.
After — 1440x900: full title, padded content column clear of the sidebar, and the "ON THIS PAGE" TOC rendered on the right, matching the control. 375x667 and 430x932: proper gutters, title and prose wrap, nothing clipped.
/video/).docs-contentfoundResidual horizontal overflow from long
<pre>lines at mobile widths is pre-existing and site-wide (grok-video527px,veo-video905px,fal-ai726px against a 375px viewport), unrelated to this class, and left alone.2. P2 — a malformed poll status persists an unusable fixture
src/byteplus-video.tscoerced the upstream status withString(upstreamBody.status ?? ""), so an absent status became""and a numeric123became"123". Terminal is derived as the complement of the non-terminal pair, so both coerced values read as terminal. Record mode then persisted an envelope thatserializeBytePlusVideoTaskrejects and swapped the job to replay — so every later poll 502s on that same envelope and a corrected upstream response is never fetched for that job, with the unusable fixture left on disk.The status now has to clear the same predicate replay applies — a non-empty string — before it can be terminal. Otherwise it is relayed verbatim and the job stays upstream-backed.
Scope, stated honestly: this is malformed-upstream robustness only. There is no evidence Ark emits such a body. 4xx/5xx, non-JSON and non-object bodies are out of scope and are already rejected upstream of this check.
The reviewer's own repro, before and after
Run with the repo's
tsxagainst a real aimock server, a real HTTP upstream, the real recorder and real filesystem persistence.Before:
After:
upstreamPollsgoing 1 -> 2 is the job staying upstream-backed. The valid control is unchanged.Regression test, observed red before the fix
Three tests added to
src/__tests__/byteplus-video-record.test.ts, run against the unmodified handler first:After the fix, on the same tests:
3. P3 — two inaccurate descriptions
Neither is a runtime change.
The docs said aimock "warns once per job" on an expired URL. The implementation latches per shared fixture envelope object, and the existing test named "the staleness warn latches per FIXTURE" submits four jobs and asserts exactly one warning — the test contradicts the doc. Corrected to "once per fixture envelope", noting a new envelope object can warn again.
The
buildBytePlusMatchTextdocblock promised "ALWAYS a newline and[media: …]", but the code isreturn text ? \${text}\n${suffix}` : suffix` — a text-free key is the bare suffix with no newline. Corrected to say the separator is present only when there is text.Gates
Raw exit codes, all from the worktree root:
prettier --check .npx eslint .pnpm typechecknpx vitest run