refactor(server): share attachment message intake - #10580
Merged
juliusmarminge merged 3 commits intoSep 7, 2026
Merged
Conversation
juliusmarminge
force-pushed
the
agents/mcp-shared/attachment-intake
branch
from
September 7, 2026 20:40
d4fa8f4 to
43e6ee2
Compare
This was referenced Sep 7, 2026
Contributor
Thread transfer impact
This comment will update automatically after the next completed run. |
Contributor
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes production WebSocket dispatch and launch behavior by centralizing attachment intake, altering cleanup after uncertain acceptance, and preserving attachments for replay. The added tests cover the primary durability and retry scenarios, but the new error-sensitive runtime logic merits human review. You can add or adjust custom eligibility rules. Learn more. |
juliusmarminge
added a commit
that referenced
this pull request
Sep 8, 2026
juliusmarminge
added a commit
that referenced
this pull request
Sep 8, 2026
juliusmarminge
added a commit
that referenced
this pull request
Sep 8, 2026
juliusmarminge
added a commit
that referenced
this pull request
Sep 9, 2026
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.
Part 3/16 of the shared-core and MCP stack. Based on #10578. Next: #10554.
RPC and MCP separately sequenced pending attachment claims and message execution. This extracts ThreadMessageIntake operations around the existing claim, dispatch/send and ThreadLaunch services, then makes RPC use them. The MCP consumers follow in their own layers.
A launch or dispatch error can follow a durable message commit. Intake releases copies proven unused by the returned durable message/events, including accepted replays, and by typed pre-acceptance failures. It retains copies when acceptance is uncertain; a typed claim failure still cleans its partial batch before dispatch. This removes the RPC blanket error cleanup that could delete accepted message files. It may retain unused copies on uncertain failures. There is no new receipt store, retry journal, lock, provider logic, or service identity. Startup queuing, provenance, analytics and wire mapping stay at the RPC boundary.
Validation: AttachmentClaims, ThreadLaunch and ThreadManagement suites: 38 tests passed; server typecheck passed. One shared real V2 test accepts a launch, loses its result, and proves persisted attachment bytes survive. It also proves launch/command/send replays leave exactly the three accepted files, and nonexistent-project/thread failures add no orphaned copies. Existing partial-claim cleanup coverage remains.
Layer size: 4 files, +379/-150. No MCP tools are introduced in this prerequisite.
Prepared with Codex in the OpenAI agent runtime.
Note
Share attachment intake logic across
dispatchCommand,sendToThread, andlaunchThreadhandlersdispatchWasNotAcceptedclassifier to distinguish definite pre-acceptance failures (projection errors, provider adapter errors, rejected commands, ID conflicts) from uncertain failures.releaseUnusedClaimsremoves only claimed paths absent from the accepted result, preserving referenced copies.AttachmentClaimError,ThreadLaunchError, andServerRuntimeStartupError.dispatchWasNotAcceptedclassifier marks them uncertain; reviewers should verify that unmatched thread-management errors in the classifier do not cause attachment leaks for scenarios previously cleaned up.Macroscope summarized 4cfe358.