Repository navigation
Console 0.5.13 candidate: keep a build draft's intent within Platform's limit (APT-1263) - #42
Merged
Merged
Conversation
…t is not an AI failure (APT-1263) - Compose the intent from the persisted opening, the newest reply and as many earlier replies as fit in 4,000 UTF-8 bytes (and characters), with a counted omission marker; the full message still goes to the turn. - Resume and plan refresh compare the bounded, deterministic intent; creation is bounded too. - A 400 invalid_argument on 'intent' is a platform rejection with its reference, not 「AI が内容を整理できませんでした」.
Contributor
Author
|
Merged at reviewed head d7f8dd2 (CI 6/6 green; independent review probe-opus: merge OK with follow-ups → APT-1266; PO lead read the production diff: no blocking finding). Release decision: 森さん (2026-11-18, 「速攻で直してリリースして」). Tagging v0.5.13. |
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.
What (Console 0.5.13 candidate, APT-1263 urgent)
A build draft could no longer send any message once its intent grew past Platform's limit. This keeps every intent the Console writes within 4,000 UTF-8 bytes (and 4,000 characters), and stops showing that rejection as an AI failure.
web/src/model/build/questions.ts,features/build/use-build-session.ts,features/build/entry.ts): the intent keeps the opening request, the newest reply and as many preceding replies as fit (chronological, with a counted omission marker). If the opening and the newest reply cannot both fit, both keep Unicode-safe excerpts; a shortened opening carries a fingerprint so resume cannot confuse two requests that share a prefix. The full new message still goes to the conversation turn. Turn and plan paths compose from the persisted draft intent, so fresh and resumed tabs write the same value.model/build/resume.ts,model/build/stage.ts): resume matches the original opening (ignoring reply and publication blocks); plan refresh compares the intent the generation recorded.model/build/failure.ts): a 400invalid_argumentnaming'intent'in the turn or plan context is a platform rejection (with its reference), not 「AI が内容を整理できませんでした」.Why
Platform checks
len(intent) > 4000in UTF-8 bytes (Japanese: ~1,333 characters). The Console appended every reply to the intent before each turn. On Craftsman a user's draft (draft-50c091d7…) reached 3,954 bytes / 1,542 characters after 14 replies; from 01:30:12Z every PATCH returned 400 and the screen blamed the AI. Platform is being fixed separately (characters, 20,000; platform #7061) but reaches Craftsman only with an rc, so the Console must fit the byte limit on its own.Tests
use-build-session.test.tsx: 「a fresh tab can send a kickoff and plan from a %i-byte draft with 14 replies」 for 3,954 (the real case, exactly 1,542 characters), 4,000 and 4,050 bytes — the harness rejects oversized PATCHes; sending 「この内容で提案して」 creates one turn and one generation. A real PATCH rejection leaves the reply queued and starts no AI turn.spec.test.ts,resume.test.ts,failure.test.ts,console-entry.test.ts: byte boundaries with multi-byte text, newest-message retention, deterministic recomposition, resume identity, rejection classification, both creation paths.Local verification
bun run typecheck,bun run typecheck:e2e,bun test src(2122 pass / 0 fail),bun run check:response-boundaries(0 violations),bun run check:console-schema— all exit 0. Mock e2e stories for the build flow (app-build-ai,app-build-console-conversation,build-failure-cause,build-run-failure,app-create-template,app-build-malformed-response): 23 passed.Writer: GPT-6.2 Astra (deep-worker). Independent review: see below.