app-server: targeted notification fan-out clones the final subscriber payload
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start at send_server_notification_to_connections in codex-rs/app-server/src/outgoing_message.rs:585-620, then read OutgoingMessage in codex-rs/app-server-transport/src/outgoing_message.rs:27-36. Trace the targeted ToConnection send loop and verify that iteration order and delivery are preserved while the final selected connection reuses the owned message instead of receiving another clone.
Written by the indexing model from the issue text.
Description
What variant of Codex are you using?
App Server
What feature would you like to see?
I found a potential performance concern in current source rather than a confirmed user-visible bug. I would like targeted server-notification fan-out to reuse its owned OutgoingMessage for the final selected connection rather than cloning it for every selected connection.
Additional information
Evidence
send_server_notification_to_connectionsincodex-rs/app-server/src/outgoing_message.rs:585-620constructs one ownedOutgoingMessage. For a nonempty targeted connection list, the loop sendsoutgoing_message.clone()in everyOutgoingEnvelope::ToConnection; the original is not used after the loop and is dropped.OutgoingMessageincodex-rs/app-server-transport/src/outgoing_message.rs:27-36derivesCloneand contains the app-server notification envelope, so this clones the whole owned outgoing notification message.- Moving the original into the final selected
ToConnectionwould keep the existing iteration/send order and reduce the clone count from the number of selected connections to at mostsubscriber_count - 1, including zero clones when exactly one connection is selected.
Impact
Not measured. The avoidable clone can copy an entire targeted notification payload, including in the single-subscriber case. The potential allocation and copying cost scales with notification payload size and targeted-notification rate; allocation volume, throughput, and latency have not been measured.
Question
Would it make sense to clone the message for every selected connection except the final one, then move the original OutgoingMessage into that final OutgoingEnvelope::ToConnection?
I checked all relevant issues, comments, pull requests, discussions, and release notes; this report is not a duplicate.
I am reporting this finding only and am not proposing a pull request unless a maintainer invites one.
Disclosure
Investigated thoroughly with GPT-5.6 Sol (runtime-default reasoning effort), using Oh My Pi as the agent framework.
This report is not generic or unreviewed AI-generated output. Its claims were checked against the cited evidence, and it includes the relevant detail intended to help maintainers resolve the issue.
If reports like this are not useful to the project, please let me know and I will refrain from submitting similar ones. My intent is to help without wasting maintainer time or energy or discouraging their work.
Thank you for your work.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·