Skip to content

fix(tui): normalize cross-swarm DM presentation - #1912

Open
anateus wants to merge 3 commits into
1jehuang:masterfrom
anateus:fix/cross-swarm-dm-normalization
Open

anateus wants to merge 3 commits into
1jehuang:masterfrom
anateus:fix/cross-swarm-dm-normalization

Conversation

@anateus

@anateus anateus commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #1911: cross-swarm DMs appeared once as a notification and again when the queued message was injected, with the second row using 💫 instead of the sender's emoji.

Both presentation paths now use the same parser for the quoted cross-swarm wrapper. The canonical title retains the swarm label, so identical sender names and bodies from different swarms remain distinct. Only the emoji lookup removes that suffix. Parsing also handles colons inside labels without consuming delimiter-like text from the body.

The regressions use synthetic notification/injection events and cover long bodies with a supplied summary, injected-only and restored messages, distinct senders and swarms, and the existing whitespace-name rejection. Message delivery, provider transport, and the recent-card deduplication policy are unchanged. This does not add delivery IDs or an exactly-once protocol.

Verification

  • Regression reproduced before the fix: two rows where one was expected.
  • cargo test -p jcode-tui --lib cross_swarm_dm --offline --locked -- --test-threads=1: 2 passed.
  • cargo test -p jcode-tui --lib tui::app::remote --offline --locked -- --test-threads=1: 110 passed.
  • cargo fmt --all -- --check and git diff --check: passed.
  • Full TUI library suite with the existing CI skips: 2,819 passed, 1 failed, 20 ignored, 1 filtered. Tests ran with a fresh JCODE_HOME, a short scratch TMPDIR, and COLORTERM=truecolor.

The remaining failure is idle_hibernation_frozen_frames_do_not_repopulate_prepared_caches, at screen.contains("private mem"). I reproduced the same assertion with both production files restored byte-for-byte to base commit c607a88a9, selecting only that test. The added cross-swarm tests remained present but weren't selected for the comparison.

Full-suite command:

COLORTERM=truecolor cargo test -p jcode-tui --lib --offline --locked -- \
  --test-threads=1 \
  --skip test_prompt_entry_shimmer_color_moves_across_positions \
  --skip right_fact_stack_uses_neutral_gray_except_for_context_usage

The full suite is not green locally. Before merging, the idle-cache failure needs to be resolved or confirmed against the base in CI. No unrelated production behavior is changed to bypass it.

Closes #1911.

Normalize cross-swarm notification and injected-message titles and bodies through one parser. Keep the swarm label in the canonical title for deduplication, but use only the sender name for its emoji.

Add event-handler and history-rendering regressions for duplicate suppression, quoted labels, delimiter-containing bodies, and distinct swarm identities.

Fixes 1jehuang#1911
@anateus
anateus force-pushed the fix/cross-swarm-dm-normalization branch from 52827eb to 3c69798 Compare October 22, 2026 01:46
xenking added a commit to xenking/jcode that referenced this pull request Nov 22, 2026
Pair the receipt and model delivery so the transcript keeps the sender’s summary and icon. Keep identical messages from different swarms separate.

Ports 1jehuang#1912

Co-authored-by: Michael Katsevman <[email protected]>
xenking added a commit to xenking/jcode that referenced this pull request Nov 22, 2026
Upstream-PR: 1jehuang#1357
Upstream-PR-Commit: 1jehuang#1357 0da5e81
Upstream-PR: 1jehuang#1362
Upstream-PR-Commit: 1jehuang#1362 5962058
Upstream-PR: 1jehuang#1486
Upstream-PR-Commit: 1jehuang#1486 fadc624
Upstream-PR: 1jehuang#1733
Upstream-PR-Commit: 1jehuang#1733 01f3415
Upstream-PR: 1jehuang#1750
Upstream-PR-Commit: 1jehuang#1750 1ac0c82
Upstream-PR: 1jehuang#1822
Upstream-PR-Commit: 1jehuang#1822 73f85fc
Upstream-PR: 1jehuang#1912
Upstream-PR-Commit: 1jehuang#1912 36d7682
Upstream-PR: 1jehuang#1978
Upstream-PR-Commit: 1jehuang#1978 0f55643
Upstream-PR: 1jehuang#2007
Upstream-PR-Commit: 1jehuang#2007 638f87c
Upstream-PR: 1jehuang#2213
Upstream-PR-Commit: 1jehuang#2213 c5e1487
Upstream-PR: 1jehuang#2234
Upstream-PR-Commit: 1jehuang#2234 0d4d5d4
Upstream-PR: 1jehuang#2266
Upstream-PR-Commit: 1jehuang#2266 217ddc2
Upstream-PR: 1jehuang#2267
Upstream-PR-Commit: 1jehuang#2267 e98c40b

This branch has not been deployed

No deployments
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.

Cross-swarm DMs render twice and lose the sender emoji

1 participant