Skip to content

fix: show a message with line breaks once in the conversation - #127

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-12056-show-a-message-with-line-breaks-once-instead-of-twice-in-the
Nov 4, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-12056-show-a-message-with-line-breaks-once-instead-of-twice-in-the

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The hub's conversation mirror reads a person's text back as mail delivers it, through one shared deliveredText rule in @corbits-builder/schemas/conversation: LF line breaks (CRLF and lone CR become LF), no spaces or tabs at the end of a line, trimmed. The rule scans each line from the end, so a long run of blanks costs linear time.
  • With LF text, a specialist-ended notice shows without its coordinator-only part and a resumed message without its held context.
  • The page recognises the conversation's copy of each message it sent, including one with files and the opening idea, by that text, clipped to a turn's length, on a person turn later than the coordinator's latest turn it held when it sent. A repeated message shows as new, with its own files.

Verification

  • bun run lint, format:check, typecheck, test (243 pass), pins:verify and vendor:verify pass.
  • Mirror tests read a committed run repo through the hub's reader: a multi-line message, a specialist-ended notice and a resumed message read back as sent; they fail without the mirror change.
  • An integration test mails typed text through Interchange's mail encoding, with and without a file, and gets back deliveredText of it; it fails if the rule strips too much or too little.
  • Page tests: a sent message shows once and keeps its files, a repeated message shows as new with its own files, a message over the turn limit matches its clipped copy, and a participant turn with the same words does not take it.
  • deliveredText of a line with 200,000 blanks returns in linear time; the previous regex took over 30 seconds.
  • On a self-hosted run, a comment on a document passage shows once in the conversation.

Closes CL-12056

@linear-code

linear-code Bot commented Nov 4, 2026

Copy link
Copy Markdown

CL-12056

@TheGreatAxios
TheGreatAxios force-pushed the cl-12056-show-a-message-with-line-breaks-once-instead-of-twice-in-the branch 2 times, most recently from ed9c94e to 1f286fe Compare November 4, 2026 05:00
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review November 4, 2026 05:00
corbits-triage[bot]
corbits-triage Bot previously approved these changes Nov 4, 2026
Comment thread packages/schemas/src/conversation.ts Resolved
@TheGreatAxios
TheGreatAxios force-pushed the cl-12056-show-a-message-with-line-breaks-once-instead-of-twice-in-the branch from bb1aa18 to ab33bbe Compare November 4, 2026 06:27

@corbits-triage corbits-triage Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage requests changes:

  • Merge conflicts: merge conflicts with base

@TheGreatAxios
TheGreatAxios force-pushed the cl-12056-show-a-message-with-line-breaks-once-instead-of-twice-in-the branch from ab33bbe to cfd937c Compare November 4, 2026 06:50

@corbits-triage corbits-triage Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage requests changes:

  • Merge conflicts: merge conflicts with base

@TheGreatAxios
TheGreatAxios force-pushed the cl-12056-show-a-message-with-line-breaks-once-instead-of-twice-in-the branch from cfd937c to 3ad6dfb Compare November 4, 2026 07:04

@corbits-triage corbits-triage Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage requests changes:

  • Merge conflicts: merge conflicts with base

@TheGreatAxios
TheGreatAxios force-pushed the cl-12056-show-a-message-with-line-breaks-once-instead-of-twice-in-the branch from 3ad6dfb to 3633d44 Compare November 4, 2026 07:14
@corbits-triage

corbits-triage Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

@corbits-triage
corbits-triage Bot dismissed stale reviews from themself November 4, 2026 07:35

Nothing triage asked to change still fails, so this request no longer stands.

Comment thread apps/hub/src/mail/conversation-turns.ts Resolved
Comment thread apps/web/src/pages/workspace/index.tsx Resolved
Comment thread packages/schemas/src/conversation.ts Resolved
corbits-triage[bot]
corbits-triage Bot previously approved these changes Nov 4, 2026
Comment thread apps/hub/src/config/resume.ts Resolved
Mail delivery stores a message's line breaks as CRLF, and the
conversation mirror returned them unchanged. The project page matches
the message it sent against the mirror's copy by exact text, so a
message with line breaks never matched and showed twice, and the extra
copy kept "Thinking…" on. The mirror reads a person's text back as mail
delivers it, by a shared rule: LF line breaks, no spaces or tabs at the
end of a line. The specialist-ended and resume-context markers are
written with LF, so the mirror now finds them in delivered text. The
turn length limit and its clip move to the shared schema, so the page
can clip a sent message the same way.
Mail delivery drops spaces and tabs at the end of each line, so a
message with them never matched the conversation's copy and showed
twice. The page compares each message it sent, including one with files
and the opening idea, with the conversation by the text mail delivers,
clipped to a turn's length. Only a coordinator turn later than the
latest one the page held when it sent the message can be its copy, so
a repeated message shows as new and keeps its own files.
@TheGreatAxios
TheGreatAxios force-pushed the cl-12056-show-a-message-with-line-breaks-once-instead-of-twice-in-the branch from 31d5cd4 to b81706b Compare November 4, 2026 08:22
@TheGreatAxios
TheGreatAxios added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit fb16be4 Nov 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant