Skip to content

fix(#5550): keep Transparent Stream final replies visible after settle - #5558

Closed
rodboev wants to merge 2 commits into
nesquena:masterfrom
rodboev:pr/5550-transparent-settle
Closed

rodboev wants to merge 2 commits into
nesquena:masterfrom
rodboev:pr/5550-transparent-settle

Conversation

@rodboev

@rodboev rodboev commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Thinking Path

  • Transparent Stream already renders the final reply while streaming and after a refresh, so the broken point is the STREAM_DONE handoff rather than transcript storage.
  • The settle path was completing the anchor scene with Compact Worklog ownership even when Transparent Stream was active.
  • The fix keeps the active activity mode attached to the settled scene and leaves the final answer owned by the assistant segment, while thinking and tool activity stay in the trace.

What Changed

  • static/messages.js: preserve the active activity display mode when projecting and completing the live anchor scene at settle time, and normalize settled row hints for that mode.
  • tests/test_live_to_final_anchor_visible_order.py: add focused regression coverage for Transparent Stream settle, plus Compact Worklog and all-prose guard preservation checks.

Why It Matters

Transparent Stream no longer hides the completed assistant reply behind a collapsed "Processed ..." row right after generation finishes. The change is scoped to the live-to-final boundary, so existing transcript hydration and Compact Worklog behavior stay intact.

Verification

  • python -m pytest tests/test_live_to_final_anchor_visible_order.py -v --timeout=60 (63 passed)
  • npx eslint --no-config-lookup -c eslint.runtime-guard.config.mjs "static/**/*.js"

Full-suite CI context, not a required local check unless requested: python -m pytest tests/ -v --timeout=60.

Upstream

Closes #5550.

Model Used

GPT 5.5 via Codex CLI

@greptile-apps

greptile-apps Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the Transparent Stream mode losing the completed assistant reply at settle time — the reply was being hidden behind a collapsed "Processed …" row because the live-to-final anchor scene handoff was always forcing mode: 'compact_worklog' regardless of the active display mode.

  • static/messages.js: Adds _anchorSceneActiveMode() (priority-ordered probe of window.chatActivityMode(), window._chatActivityDisplayMode, window._transparentStream) and _anchorSceneRowDisplayHintForMode(), then uses both to pass the correct mode through _renderAnchorLiveScene, _projectLiveAnchorActivityScene, and _completeSettledAnchorSceneForTurn instead of the previously hardcoded 'compact_worklog'.
  • tests/test_live_to_final_anchor_visible_order.py: Extracts the repeated extractFunc JS helper into a module-level constant, replaces the mode-scoping test with accurate post-fix assertions, and adds focused regression coverage for Transparent Stream settlement, compact-worklog preservation, and prose/terminal-only guard cases.

Confidence Score: 5/5

Safe to merge — the change is narrowly scoped to the live-to-final scene handoff, guards are thorough, and the new test suite directly reproduces the failure scenario.

Both changed functions add well-guarded helpers with try/catch around the primary accessor and safe fallback chains. The settlement logic preserves the projected scene's mode when it is already transparent_stream, and calls _anchorSceneActiveMode() otherwise. No unguarded global reads, no structural changes outside the live-to-final boundary.

No files require special attention.

Important Files Changed

Filename Overview
static/messages.js Adds two focused helpers (_anchorSceneActiveMode, _anchorSceneRowDisplayHintForMode) and threads them through three call sites; logic is well-guarded with try/catch and null checks, and the fallback chain terminates safely at 'compact_worklog'.
tests/test_live_to_final_anchor_visible_order.py DRY refactor of extractFunc JS snippet (previously duplicated; now a module-level constant) plus new regression tests for Transparent Stream settlement, fallback priority, and compact-worklog preservation — all logically coherent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[STREAM_DONE received] --> B[_projectLiveAnchorActivityScene]
    B --> C{_anchorSceneActiveMode}
    C --> D[window.chatActivityMode - try/catch]
    D -->|returns valid mode| E[use mode]
    D -->|throws| F[window._chatActivityDisplayMode]
    F -->|valid| E
    F -->|invalid/absent| G[window._transparentStream flag]
    G -->|true| H[transparent_stream]
    G -->|false/absent| I[compact_worklog fallback]
    E --> J[projectedScene with mode=activeMode]
    H --> J
    I --> J
    J --> K[_completeSettledAnchorSceneForTurn]
    K --> L{base.mode === transparent_stream?}
    L -->|yes| M[sceneMode = transparent_stream]
    L -->|no| N[sceneMode = _anchorSceneActiveMode]
    M --> O[_anchorSceneRowDisplayHintForMode per row]
    N --> O
    O --> P{sceneMode?}
    P -->|transparent_stream| Q[hints.transparent_stream OR chronological_activity]
    P -->|compact_worklog| R[hints.compact_worklog OR row.display_hint OR activity_row]
    Q --> S[settled scene with correct mode + display hints]
    R --> S
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[STREAM_DONE received] --> B[_projectLiveAnchorActivityScene]
    B --> C{_anchorSceneActiveMode}
    C --> D[window.chatActivityMode - try/catch]
    D -->|returns valid mode| E[use mode]
    D -->|throws| F[window._chatActivityDisplayMode]
    F -->|valid| E
    F -->|invalid/absent| G[window._transparentStream flag]
    G -->|true| H[transparent_stream]
    G -->|false/absent| I[compact_worklog fallback]
    E --> J[projectedScene with mode=activeMode]
    H --> J
    I --> J
    J --> K[_completeSettledAnchorSceneForTurn]
    K --> L{base.mode === transparent_stream?}
    L -->|yes| M[sceneMode = transparent_stream]
    L -->|no| N[sceneMode = _anchorSceneActiveMode]
    M --> O[_anchorSceneRowDisplayHintForMode per row]
    N --> O
    O --> P{sceneMode?}
    P -->|transparent_stream| Q[hints.transparent_stream OR chronological_activity]
    P -->|compact_worklog| R[hints.compact_worklog OR row.display_hint OR activity_row]
    Q --> S[settled scene with correct mode + display hints]
    R --> S
Loading

Reviews (2): Last reviewed commit: "test(anchor): consolidate function extra..." | Re-trigger Greptile

Comment thread tests/test_live_to_final_anchor_visible_order.py Outdated
@nesquena-hermes nesquena-hermes added the size:L Large PR (>10 files or >250 LOC) label Jul 4, 2026
@nesquena-hermes

Copy link
Copy Markdown
Collaborator

🔬 Gate certification — GREEN ✅ (Transparent Stream final replies stay visible after settle)

Certified head: sha:585f1f59 (clean rebase, branch gate-rebase/5558-transparent-final-visible) · PR: #5558 · rodboev, fix(#5550): keep Transparent Stream final replies visible after settle
Verdict: Full gate GREEN. Fixes final replies disappearing after the transparent stream settles, via mode-aware display-hint resolution so the final-answer row keeps a visible hint through the settle transition. Coexists with the shipped transparent-stream work (#5400/#5454/#5506). Codex SAFE, suite fully green. The SUSPICIOUS threat-scan was the benign eval(extractFunc()) test-harness FP (test file only).

What I ran (rebased worktree /tmp/wt-rebase-5558)

Gate Result
Rebase onto current master ✅ git apply clean; diff = messages.js + tests only
Threat-scan SUSPICIOUS ✅ benign FP confirmed — eval(extractFunc('_anchorScene…')) is the standard Node-harness idiom in the TEST file; no shipped-code eval
Codex (reproduce) SAFE TO SHIP — 0 findings
Full pytest suite ✅ 12001 passed, 0 failed
anchor-visible-order tests ✅ 63 passed

Findings

✅ Mode-aware visibility fix: _anchorSceneActiveMode() reads window._chatActivityDisplayMode; _anchorSceneRowDisplayHintForMode(row, sceneMode) resolves the right display_hint per scene mode (compact_worklog → hints.compact_worklog || row.display_hint || 'activity_row'; transparent_stream/default → row.display_hint || 'activity_row'), so the final-answer row keeps a visible display_hint through the settle transition (#5550). Codex confirmed the final reply stays visible after settle across all activity display modes, the fallback chain can't pick a hidden hint for a final answer, live→final anchor order is intact, and no regression to compact-worklog/activity-row rendering. Coexists with shipped #5400/#5454/#5506 (0 transparent-event-enter refs — no flicker/entrance-replay). 63 targeted + full suite green (0 failures).

Recommendation to the next agent

Ready to merge — use branch gate-rebase/5558-transparent-final-visible (sha:585f1f59), NOT the PR's stale head d270f077. A real transparent-stream reliability fix (final replies no longer vanish after settle), Codex SAFE + 63 targeted tests + full suite green (0 failures), coexists with the shipped transparent-stream family. Light-visible (makes an existing behavior correct — final reply stays); a quick glance at a settled transparent-stream reply confirms, but the fix is verified + test-covered. concept 4/5 (real #5550 fix). Author @rodboev (T1). crit=3.


Gate-certifier layer (warm-up → gate → release). I do not merge/tag/deploy. Rebased onto current master; verified mode-aware display-hint keeps final-answer row visible through settle (no hidden-hint pick), coexists w/ #5400/#5454/#5506 (0 entrance-keyframe refs), threat-scan SUSPICIOUS = benign eval(extractFunc) test-harness FP (test-only, no shipped eval), Codex SAFE + 63 targeted + full suite green (0 failed). Cert valid for sha:585f1f59.

@nesquena-hermes nesquena-hermes added the gate-pass Full gate passed (Codex+Opus+suite+browser); queued Tier 1 for release agent label Jul 4, 2026
nesquena-hermes added a commit that referenced this pull request Jul 4, 2026
release #5558: keep Transparent Stream final replies visible after settle
@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Shipped in v0.51.865 — thanks @rodboev! 🎉

Your fix for the Transparent Stream settle-fold regression (#5550) is live. In Transparent Stream mode, a turn's final reply no longer folds into the collapsed worklog the instant it settles — it stays a visible chronological answer.

Root cause was the live-anchor scene renderer hardcoding compact_worklog when projecting the settling turn, so the final answer picked up compact-worklog display hints and got grouped away. It now reads the actual active display mode and applies per-mode hints.

Gate (all green):

  • Codex (regression): SAFE TO SHIP, no findings.
  • Fable (UX): SHIP-UX with regression proof — Compact Worklog projection is bit-identical (_anchorSceneActiveMode() resolves to the same value the old hardcode used), and the Transparent Stream fix lands without flicker (live + settle read the same globals in one synchronous pass, so no mid-settle disagreement, no row jumping groups).
  • Full suite: 12013 passed; test_live_to_final_anchor_visible_order.py 63/63; live-browser structural check confirmed the settled answer renders visible (not folded).

Merged via release PR #5590 with your authorship preserved (Co-authored-by). Appreciate the clean root-cause fix on the crown-jewel streaming path.

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

Labels

gate-pass Full gate passed (Codex+Opus+suite+browser); queued Tier 1 for release agent size:L Large PR (>10 files or >250 LOC)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(transparent-stream): final reply folds into the collapsed worklog section after the turn settles

2 participants