Skip to content

Console 0.5.13 candidate: keep a build draft's intent within Platform's limit (APT-1263) - #42

Merged
reoring merged 1 commit into
mainfrom
fix/apt-intent-limit
Nov 18, 2026
Merged

reoring merged 1 commit into
mainfrom
fix/apt-intent-limit

Conversation

@reoring

@reoring reoring commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

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.

  • Bounded intent (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.
  • Resume / planning (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.
  • Classification (model/build/failure.ts): a 400 invalid_argument naming 'intent' in the turn or plan context is a platform rejection (with its reference), not 「AI が内容を整理できませんでした」.

Why

Platform checks len(intent) > 4000 in 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.

…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 が内容を整理できませんでした」.
@reoring reoring added the needs-human-review Waits for a person's review before merge label Nov 18, 2026
@reoring
reoring merged commit 06baa21 into main Nov 18, 2026
6 checks passed
@reoring reoring removed the needs-human-review Waits for a person's review before merge label Nov 18, 2026
@reoring

reoring commented Nov 18, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant