Repository navigation
Conversation
Greptile SummaryThis PR restores the managed-media transcript persistence path for webchat/control-UI assistant replies, re-landing changes from the auto-closed #69500. It introduces a new The auth model (gateway auth → Confidence Score: 5/5Safe to merge; both findings are minor style/defence-in-depth observations with no current exploitable path. No P0 or P1 issues found. The security model is layered correctly (auth → scope → session ownership → transcript presence), the retry logic bridges the transient-to-history window, and the LRU cache invalidation is correct. Both inline comments are P2 (dead code with wrong semantics, and a minor defence-in-depth suggestion). No files require special attention beyond the two P2 observations noted inline. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/gateway/managed-image-attachments.ts
Line: 223-229
Comment:
**Incorrect `contentType` in no-resize branch**
`resizeManagedImageBufferToLimits` returns `contentType: "image/jpeg"` in its early-return branch even when no resize is needed — meaning a PNG buffer would be tagged as JPEG. While this code path is unreachable today (the function is only invoked when dimensions exceed limits, which always produces a non-null target), it creates a silent correctness hazard if the function gains new callers.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/gateway/managed-image-attachments.ts
Line: 991-996
Comment:
**`attachmentId` not validated to UUID format before file-path use**
`attachmentId` from the URL is extracted by `[^/]+` and passed directly to `resolveOutgoingRecordPath`, which constructs `path.join(recordsDir, \`${attachmentId}.json\`)`. A value like `..` would resolve to `outgoing/.json` (one level up from `records/`), still inside `stateDir` and always yielding a null record → 404, so there is no exploitable traversal today. However, adding an explicit UUID format guard is a clean defence-in-depth improvement that matches how attachment IDs are actually generated (`randomUUID()`).
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(gateway,ui): restore managed media t..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd80568fa6
ℹ️ 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".
bd80568 to
184996d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 184996dd45
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f1501668f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac5fdf2431
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c2adaa793
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86d3249a42
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6425e8080a
ℹ️ 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".
|
Related work from PRtags group Title: Open PR duplicate: managed media transcript persistence
|
|
Closing this as superseded by #70719. Codex deep-review evidence:
Thanks for recreating the clean branch and iterating through the review notes. The canonical fix is #70719, so I’m closing this duplicate rather than asking for another rebase. |
Summary
Recreates the managed-media persistence fix from a clean branch after #69500 was auto-closed as dirty.
This restores the webchat/control UI path so assistant-managed media replies, especially image replies, are durably persisted and re-render correctly after reload/history fetch.
What changed
Problem
Managed media could render live, then disappear or come back inconsistently after reload because the reply/transcript/UI path was not durably carrying the needed managed-media state.
Expected
Assistant media replies render live and persist into transcript/history.
Actual
Some replies rendered live but were not durably persisted, causing missing or inconsistent history on reload.
Evidence
pnpm check:changed --stagedHuman Verification (required)
Review Conversations
Compatibility / Migration
Risks and Mitigations