app-server: targeted notification fan-out clones the final subscriber payload

Open 💬 0 comments Opened Aug 3, 2026 by MikeeI

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

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.

View original on GitHub ↗