feat: render structured Codex session detail messages#197
Merged
vakovalskii merged 2 commits intovakovalskii:mainfrom Apr 21, 2026
Merged
feat: render structured Codex session detail messages#197vakovalskii merged 2 commits intovakovalskii:mainfrom
vakovalskii merged 2 commits intovakovalskii:mainfrom
Conversation
vakovalskii
approved these changes
Apr 21, 2026
Owner
vakovalskii
left a comment
There was a problem hiding this comment.
LGTM — additive parser with strict validation (returns null on any anomaly), XSS-safe rendering, plain-text fallback preserved. Scope limited to detail view as documented. Clean.
NovakPAai
reviewed
Apr 21, 2026
Collaborator
NovakPAai
left a comment
There was a problem hiding this comment.
Code Review
Clean, well-structured implementation. The XML-tag based structured message parsing is solid:
- ✅ Regex-based wrapper detection with proper escaping
- ✅ Field descriptors with
max_lengthtruncation prevent unbounded output - ✅ CSS classes follow existing naming convention
- ✅ Graceful fallback to plain text rendering when parsing fails
One minor note: truncateStructuredField treats maxLength === 0 as "no limit" — this is a reasonable convention but worth documenting in a comment, since 0 usually implies "empty" to readers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves Codex session details by detecting known structured user messages and rendering them in a readable layout instead of showing raw XML-like wrappers.
It currently supports:
user_shell_commandmessages with separate command and result sectionsuser_actionmessages with context, action, and results sectionsWhat Changed
structuredpayload alongside the raw message contentresult/resultsblocks are capped without breaking structured parsingNotes
Screenshots
User Shell Command
User Action