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

Open Beginner friendly
#36,655 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
rust
Domain
api, backend

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

app-server enhancement performance
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.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.