@devries-cameron20 / t3code Mirror · read-only / commits / 154c5014a7
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 14:45 UTC

fix(web): long preview annotation comments are no longer dropped from the message (#29834)

Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Julius Marminge <julius0216@outlook.com>

Alex Southwell committed Nov 15, 2026 at 02:51 UTC 154c5014a75f3f60bca6a6287434b46265c834c3
3 files changed +12 -2
apps/web/src/lib/composerContextRecords.test.ts
+6
@@ -267,6 +267,12 @@ describe("composerContextRecords", () => {
267 expect(restored.elements[0]?.id).toBe("el_1");
268 });
269
270 + it("clamps an oversized annotation comment so the record still decodes", () => {
271 + const record = previewAnnotationContextRecord({ ...annotation, comment: "c".repeat(8_001) });
272 + expect(record.comment.endsWith("… truncated …")).toBe(true);
273 + expect(decodeMessageContext({ version: 1, records: [record] }).records).toEqual([record]);
274 + });
275 +
276 it("removes an expired terminal chip by its kind-scoped id, not the producer id", () => {
277 const context = {
278 id: "term-1",
apps/web/src/lib/composerContextRecords.ts
+5 -1
@@ -3,6 +3,7 @@ import {
3 sourceControlClients,
4 } from "@t3tools/client-runtime/source-control-clients";
5 import {
6 + COMPOSER_CONTEXT_PREVIEW_COMMENT_MAX_CHARS,
7 COMPOSER_CONTEXT_REVIEW_DIFF_MAX_CHARS,
8 COMPOSER_CONTEXT_REVIEW_TEXT_MAX_CHARS,
9 COMPOSER_CONTEXT_TERMINAL_TEXT_MAX_CHARS,
@@ -301,7 +302,10 @@ export function previewAnnotationContextRecord(
302 annotationId: annotation.id,
303 pageUrl: annotation.pageUrl,
304 pageTitle: annotation.pageTitle,
304 - comment: annotation.comment.trim(),
305 + comment: clampContextText(
306 + annotation.comment.trim(),
307 + COMPOSER_CONTEXT_PREVIEW_COMMENT_MAX_CHARS,
308 + ),
309 targetSummary: previewAnnotationTargetSummary(annotation),
310 styleChanges: annotation.styleChanges.map(
311 (change) => `${change.property}: ${change.previousValue || "(unset)"} → ${change.value}`,
packages/contracts/src/composerContext.ts
+1 -1
@@ -42,7 +42,7 @@ const COMPOSER_CONTEXT_ELEMENT_HTML_MAX_CHARS = 8_000;
42 const COMPOSER_CONTEXT_ELEMENT_STYLES_MAX_CHARS = 8_000;
43 export const COMPOSER_CONTEXT_REVIEW_TEXT_MAX_CHARS = 16_000;
44 export const COMPOSER_CONTEXT_REVIEW_DIFF_MAX_CHARS = 32_000;
45 -const COMPOSER_CONTEXT_PREVIEW_COMMENT_MAX_CHARS = 8_000;
45 +export const COMPOSER_CONTEXT_PREVIEW_COMMENT_MAX_CHARS = 8_000;
46
47 export const ComposerContextId = TrimmedNonEmptyString.check(
48 Schema.isMaxLength(CONTEXT_ID_MAX_CHARS),