Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e32adce2c2
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function appendParsedMessageBlock(state: MessageBlockParserState, block: MessageBlock): MessageBlockParserState { | ||
| return { | ||
| ...state, | ||
| blocks: [...state.blocks, block], | ||
| }; |
There was a problem hiding this comment.
Avoid quadratic array copies in message block parser
This helper now clones the full blocks array every time a line is parsed, which makes parseMessageBlocks O(n²) in the number of lines. In contexts this panel already handles (long assistant outputs, large diffs, or pasted logs), repeated spreads can noticeably increase CPU and memory and reintroduce UI stalls during rendering. The previous implementation used in-place pushes and stayed linear, so this is a regression introduced by the refactor.
Useful? React with 👍 / 👎.
Summary
Testing