You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b39ee33
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(ui): remove unreachable assistant message expanded flag
Loaded full assistant messages always render in full, so the loaded
state's expanded boolean and its toggle branch could never be reached
by the automatic loader or the exhausted-retry action. Drop the dead
field and branch, and shrink the browser E2E fixture from an
8,000-plus character architectural essay describing the removed field
to a compact deterministic Markdown sample that still exceeds the
transport preview limit.
Fixes#124235
// rendering, while the repeated line only pads length.
26
+
constFULL_ASSISTANT_CONTENT_FILLER_LINE=
27
+
"Repeat neutral filler text to exceed the transport preview limit while staying deterministic and readable.\n";
23
28
24
-
I finished the Control UI transcript refactor. Ordinary messages render exactly as before, but a long assistant response no longer leaves the operator behind a disclosure control when the complete Markdown is available.
The transcript list already knew the session key and stable message id, while each message group separately derived enough state to render Markdown, copy text, and build reply context. When history contained a transport-limited preview, those consumers could disagree: the bubble showed the preview, Copy used cached text, and Reply rebuilt text from the original transcript entry.
33
+
- service: payment-gateway
34
+
- environment: production
35
+
- status: completed
29
36
30
-
The underlying problem was ownership. Full-message loading already belonged to the thread, but visibility was controlled farther down the render tree. That meant the UI could possess the complete response and still choose to show only the preview until someone clicked Show more.
37
+
## Rollout steps
31
38
32
-
## Files reviewed
33
-
34
-
### ui/src/pages/chat/chat-thread.ts
35
-
36
-
The page owns the session-scoped map of assistant message expansions. Each entry records a revision and a loading, loaded, or failed result. The revision participates in row memoization, so completing a request invalidates the affected row without rebuilding the entire transcript.
37
-
38
-
The cache key combines the active session and message id. Switching sessions therefore cannot leak loaded text into another conversation, even when deterministic fixtures reuse a local id.
This state and the existing chat.message.get request remain unchanged. The UI adjustment only removes the separate assistant disclosure decision after the loaded Markdown is present.
The group is the shared boundary for bubble content and message actions. It already checks the gateway suffix and transcriptMeta.truncated, looks up the stable message id, and receives the existing full-message callback from the thread.
52
-
53
-
The group now starts that existing callback when it first sees an eligible entry instead of waiting for a button click. It does not introduce another cache, request type, retry timer, or transport flag. A loading or failed entry is left alone, which prevents render-driven request loops.
39
+
1. Build the release artifact and run smoke tests.
40
+
2. Deploy to the canary pool and watch the error budget.
export function verifyRollout(serviceName: string): Promise<boolean> {
45
+
return healthCheck(serviceName);
64
46
}
65
47
~~~
66
48
67
-
Once the existing loader resolves, the same selected Markdown flows to the bubble, inline Copy action, Reply action, and context menu. No consumer has to infer whether a loaded response should still look collapsed.
Assistant Markdown now renders directly. If the existing expansion record contains loaded text, that text is selected regardless of the old expanded boolean. Otherwise the transcript text is shown exactly as received.
51
+
${FULL_ASSISTANT_CONTENT_FILLER_LINE.repeat(75)}
52
+
## Final verification
72
53
73
-
Loaded text uses document rendering mode so the chat renderer does not apply its regular large-message preview limit to a response that was explicitly recovered in full. User-authored messages keep their separate local disclosure behavior; this change only removes the assistant control.
There is no assistant footer, loading label, Show more button, Show less button, or inline failure banner. During the existing request, the transport text remains readable. When complete text arrives, the same bubble grows naturally to fit it.
84
-
85
-
## Request lifecycle
86
-
87
-
1. History supplies the transport representation of the assistant message.
88
-
2. The existing truncation check determines whether a stored full copy can be requested.
89
-
3. The group invokes the already-shipped full-message callback once.
90
-
4. The thread sends chat.message.get with the stable session and message identifiers.
91
-
5. A successful result replaces the visible Markdown in the existing bubble.
92
-
6. Copy and Reply immediately use the same complete Markdown.
93
-
94
-
The request shape remains the one already supported by the gateway:
95
-
96
-
~~~json
97
-
{
98
-
"sessionKey": "main",
99
-
"messageId": "assistant-refactor-report",
100
-
"maxChars": 500000
101
-
}
102
-
~~~
103
-
104
-
Those names are deterministic fixture values. This scenario contains no production session identifiers, account data, credentials, channel addresses, provider keys, or access tokens.
105
-
106
-
## Failure behavior
107
-
108
-
If no complete stored message is available, the UI keeps the transcript text. It does not replace useful content with an error card or leave a dead control on screen. The existing failed state prevents the render pass from immediately issuing the same request again.
109
-
110
-
This matters during reconnects and partial history imports: the operator still sees the information that actually reached the browser. The UI does not invent missing prose, infer a synthetic ending, or claim that a transport-limited message is complete.
111
-
112
-
## Observable behavior covered
113
-
114
-
The focused component tests protect the user-facing boundary rather than the internal call order:
115
-
116
-
- eligible assistant text starts the existing full-message load without a click;
117
-
- loaded Markdown is visible even if an older cached expanded flag is false;
118
-
- the assistant bubble contains no Show more or Show less control;
119
-
- Copy and Reply use the complete loaded response;
120
-
- loading and failure continue to display the transcript text;
121
-
- mirrored tool replies and messages without a loader remain unchanged;
122
-
- user-message disclosure behavior stays separate and intact.
123
-
124
-
The thread test verifies that one render starts one request, that the complete response replaces the preview, and that later renders do not fetch it again. A second case rejects the request and confirms that the transport text stays readable with no disclosure or error UI.
125
-
126
-
## Browser proof
127
-
128
-
The browser scenario boots the real Control UI against a mocked Gateway WebSocket. History contains the first 8,000 characters of this report plus the existing truncation state, while chat.message.get returns this complete Markdown document.
129
-
130
-
The test waits for the final heading, checks the exact request parameters, confirms that no disclosure buttons exist, and exercises both inline and context-menu actions. Screenshots use a normal 1440×900 viewport in dark and light themes rather than zooming out to make the response look artificially short.
131
-
132
-
The before view ends in the middle of the refactor explanation because that is where the transport preview stops. The after view reaches the remaining failure notes, test coverage, scope checks, and final result in the same message bubble.
133
-
134
-
## Scope checks
135
-
136
-
No gateway handler, protocol type, persistence model, or transport limit changed. The full-message request, expansion cache, identifiers, and response extraction all predate this change. The production diff removes presentation branches instead of adding a second way to retrieve content.
137
-
138
-
The change also leaves user-authored long messages alone. Their local disclosure is a presentation choice for text the user submitted, while this assistant path is about showing the complete response once the existing loader has made it available.
139
-
140
-
## Manual review notes
141
-
142
-
I reviewed the transition at a normal desktop viewport and followed the text rather than relying only on request assertions. The preview remains selectable while loading, the existing headings and code blocks stay mounted, and the message grows in place when the remaining Markdown arrives.
143
-
144
-
In both themes, code blocks retain their contrast, long paths wrap without covering the message actions, and the final section remains reachable with ordinary scrolling. No spinner or temporary card shifts the reading position between the preview and the full response.
145
-
146
-
I also rejected the mocked full-message request and confirmed that the last received sentence stayed visible. A later host render did not create a tight retry loop, duplicate the message group, or expose an inactive assistant disclosure control.
147
-
148
-
## Verification result
149
-
150
-
The focused component suite and real-browser mocked-gateway scenario pass with the same structured response. The complete answer is always visible when available, message actions agree with the bubble, both themes remain readable, and the assistant UI exposes no manual expansion control.`;
54
+
All health checks passed and the rollout is complete.`;
0 commit comments