Skip to content

🤖 fix: make hidden-message indicators follow omission seams#2498

Merged
ammario merged 1 commit intomainfrom
chat-transcript-akh6
Feb 18, 2026
Merged

🤖 fix: make hidden-message indicators follow omission seams#2498
ammario merged 1 commit intomainfrom
chat-transcript-akh6

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Refactors transcript truncation omission handling into an explicit planner that emits history-hidden marker rows at omission seams, removes inline user-gap reminder rendering, and hardens deferred snapshot bypass logic so stale deferred ordering cannot temporarily misplace omission indicators.

Background

The previous omission path mixed a single global marker with per-user hidden-gap reminders, which encoded placement policy in implicit loop state (insertionIndex, pendingOmittedCount, consumedFirstOmittedRun). That made omission placement harder to reason about and produced edge cases where indicators felt disconnected from omitted runs.

Implementation

  • Added buildTranscriptTruncationPlan in src/browser/utils/messages/transcriptTruncationPlan.ts:
    • collects omission runs in old history,
    • emits explicit history-hidden rows per run at seam positions,
    • caps marker row count (MAX_HISTORY_HIDDEN_SEGMENTS) by merging older runs to protect DOM size.
  • Switched StreamingMessageAggregator truncation path to call the planner.
  • Removed hiddenCountBeforeUser from DisplayedMessage user type and removed inline reminder UI in UserMessage.
  • Updated deferred bypass logic (shouldBypassDeferredMessages) to bypass when snapshots are same length but diverge in row identity/order.
  • Added/updated tests:
    • new planner unit tests (transcriptTruncationPlan.test.ts),
    • updated aggregator truncation expectations for multi-segment markers,
    • updated deferred-bypass tests,
    • updated UI truncation test expectations to aggregate across marker rows.

Validation

  • make static-check
  • bun test src/browser/utils/messages/transcriptTruncationPlan.test.ts src/browser/utils/messages/StreamingMessageAggregator.test.ts src/browser/utils/messages/messageUtils.test.ts
  • Attempted bun test ./tests/ui/chat/truncation.test.ts -t "shows a generic hidden indicator and preserves assistant meta rows" (environmental failure in this workspace: Cannot find module '@/version' from telemetry service import path)

Risks

  • Behavior change: omission UI now surfaces explicit seam markers (capped) instead of per-user reminder text.
  • Risk is primarily in transcript rendering expectations and any downstream assumptions about marker cardinality.
  • Mitigated with planner-focused and aggregator/UI expectation updates.

Generated with mux • Model: openai:gpt-5.3-codex • Thinking: xhigh • Cost: $0.00

Refactor truncation rendering to use a pure omission-segment planner, remove per-user hidden gap reminders, and harden deferred snapshot stale detection by row identity/order.

Also updates truncation and message-utils tests for capped multi-segment history-hidden behavior and adds dedicated planner coverage.

---

_Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.00`_

<!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.00 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammario
Copy link
Member

ammario commented Feb 18, 2026

Manually verified that a long chat appears to render more correctly after this change.

@ammario ammario merged commit 083132e into main Feb 18, 2026
23 checks passed
@ammario ammario deleted the chat-transcript-akh6 branch February 18, 2026 20:20
github-actions bot pushed a commit that referenced this pull request Feb 19, 2026
The recent truncation refactoring (#2498) removed the truncation
reminder JSX but left two near-identical <MessageWindow> return
blocks (one for terminal output, one for user content) sharing the
same 5 props. Merge into a single return with conditional children.
github-actions bot pushed a commit that referenced this pull request Feb 19, 2026
The recent truncation refactoring (#2498) removed the truncation
reminder JSX but left two near-identical <MessageWindow> return
blocks (one for terminal output, one for user content) sharing the
same 5 props. Merge into a single return with conditional children.
github-actions bot pushed a commit that referenced this pull request Feb 19, 2026
The recent truncation refactoring (#2498) removed the truncation
reminder JSX but left two near-identical <MessageWindow> return
blocks (one for terminal output, one for user content) sharing the
same 5 props. Merge into a single return with conditional children.
github-actions bot pushed a commit that referenced this pull request Feb 19, 2026
The recent truncation refactoring (#2498) removed the truncation
reminder JSX but left two near-identical <MessageWindow> return
blocks (one for terminal output, one for user content) sharing the
same 5 props. Merge into a single return with conditional children.
github-actions bot pushed a commit that referenced this pull request Feb 20, 2026
The recent truncation refactoring (#2498) removed the truncation
reminder JSX but left two near-identical <MessageWindow> return
blocks (one for terminal output, one for user content) sharing the
same 5 props. Merge into a single return with conditional children.
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.

2 participants

Comments