Repository navigation
file transfer (dotnet): parse images/files, wire directive sink to Rust parity - #348
Merged
Merged
Conversation
…st parity Bring the C# smooth-operator server to Rust parity on the PR #342 file-transfer contract. send_message was text-only; it now handles images[], files[], and the send_file directive. - Regenerate Types.cs from the updated spec (adds SendMessageRequest.Files, Skill). - images[]: parsed fail-soft, attached as OpenAI image_url content parts. The engine builds the live user turn from a string, so images ride an image-only ChatMessage seated on the thread just before the text turn (no empty/duplicate message). data: -> DataContent, http(s) -> UriContent; detail on AdditionalProperties. Malformed/unsupported entries dropped. - files[]: parsed fail-soft, surfaced on a new per-turn TurnContext (AsyncLocal) so host tools can read them; never sent to the model. - Directive sink: a host tool writes onto TurnContext.Current.Directive; drained after the turn onto eventual_response.directive (last-write-wins, omitted when none for back-compat). - Tests: FileTransferTests covers images-attach, malformed fail-soft, files-on- context, tool->directive->eventual_response, and directive omission. Source-only; the engine stays the published NuGet (no publish). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: b5438a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
brentrager
added a commit
that referenced
this pull request
Aug 14, 2026
+ #352 (#354) SmooAI.SmoothOperator.Server is stamped from the lockstep anchor (@smooai/smooth-operator, typescript/package.json) by sync-versions.mjs. #348's changeset named only @smooai/smooth-operator-server — which is the TYPESCRIPT server npm package — so release #349 bumped that to 1.8.0 and left the anchor at 1.39.0. The .NET NuGet was therefore never republished, and 1.39.0 consumers see no TurnContext, no directive sink and no images[]/files[] ingest despite main carrying all of it since 2026-08-11. #352 (skill resolution) inherited the same mistake by copying #348's changeset header. The sibling TS PR #346 named BOTH packages, which is why the TS lane shipped and the .NET lane silently did not. Reported by a downstream consumer who checked the published package rather than main — the report was right about the artifact and wrong about the code. Claude-Session: https://claude.ai/code/session_012iM1Q8JC1H83H2FXQVQNs9 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 14, 2026
Merged
brentrager
added a commit
that referenced
this pull request
Aug 14, 2026
…ree without naming the anchor (#356) Every artifact ships at one shared version held in @smooai/smooth-operator (typescript/package.json). Changesets versions only npm packages, so sync-versions.mjs stamps that number onto every other published manifest. A changeset that does not name the anchor therefore republishes nothing outside npm — silently, with a green release. That is how #348 (.NET file transfer) and #352 (.NET skill resolution) both landed on main and sat unpublished: their changesets named @smooai/smooth-operator-server, which is the TYPESCRIPT server package sitting one word away from the anchor. A downstream consumer found it two days later by reading the NuGet and filed a request to build what we had already shipped. Rule: touching a stamped tree WITH a changeset requires one changeset naming the anchor. Conditioned on having a changeset at all, so docs/test-only PRs stay quiet — a guard that cries wolf gets ignored, and then it protects nothing. sync-versions.mjs is now importable (stamping runs only when invoked directly) so the guard derives the stamped trees from the very list that does the stamping. A new target cannot be added without the guard learning about it. Verified by replay against real history: the guard FIRES on #348's actual commit and PASSES #346's (the TS sibling that correctly named both packages). Claude-Session: https://claude.ai/code/session_012iM1Q8JC1H83H2FXQVQNs9 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
brentrager
added a commit
that referenced
this pull request
Aug 14, 2026
…side, Rust #338 parity (#357) Second language in the fan-out after .NET (#352). The TS server had the field on the wire and ignored it, exactly as its own changelog admitted. - skills.ts: isValidSkillName / stripFrontmatter / skillSection / resolveSection - SkillResolver seam via serve({ skillResolver }); DirSkillResolver over SMOOTH_SKILLS_DIR with explicit-wins-then-env, mirroring Rust's install_skill_resolver_from_env - Fail-CLOSED, and resolved BEFORE the 202 ack so a client never gets "accepted" for a turn that will never run - Body appended LAST to the system prompt; the persisted user message stays exactly what the user typed Name validation makes traversal unrepresentable rather than filtered. Changeset names BOTH the TS package and the lockstep anchor, per #346 — the omission of the anchor is what stranded the .NET work in #348/#352. Tests: five Rust skills.rs tests ported under their Rust names + over-the-socket fail-closed / placement / blank-as-absent. 254 green (245 baseline + 9). Claude-Session: https://claude.ai/code/session_012iM1Q8JC1H83H2FXQVQNs9 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Problem
The .NET (C#) smooth-operator server handled
send_messageas text only — no multimodal images, no file attachments, and no host-directive channel. The file-transfer contract merged tomainin #342 (send_message.files[]+ thesend_filedirective convention oneventual_response.directive); Rust already implements it. This brings the .NET server to parity.Solution
Types.csfrom the updated spec viatools/Generator(addsSendMessageRequest.Files, and picks upSkill). Generated output, not hand-edited.images[]— parsed fail-soft inFrameDispatcher, attached as OpenAIimage_urlcontent parts. The engine (a fixed published NuGet) builds the live user turn from astring, so it can carry no content parts; instead the images ride an image-onlyChatMessageseated on the thread immediately before the text turn — the model sees them adjacent to the question, with no empty or duplicated message.data:→DataContent,http(s)→UriContent; the optional visiondetailhint rides onAdditionalProperties. Malformed/unsupported entries are dropped.files[]— parsed fail-soft and surfaced on a new per-turnTurnContext(files list + directive sink), published as anAsyncLocalaround the run so a host tool the engine invokes can read them. Never sent to the model.send_filedirective — a host tool writes an opaque directive ontoTurnContext.Current.Directive; the runner drains it after the turn ontoeventual_response.directive(last-write-wins, omitted when none for back-compat).ProtocolEvents.EventualResponsegrew an optionaldirectiveparam.Backward compatible: absent
images/filesand no host directive is byte-for-byte the previous text-only behavior.Verification
dotnet build+dotnet teston the full solution in Release: all green (302 server tests incl. 8 new, plus integration/host/client/postgres projects).FileTransferTests(8): images attach as content parts (UriContent+DataContent,detailonAdditionalProperties, live text turn preserved, no empty message), malformed images fail-soft, files surfaced onTurnContextand kept off the model, tool→directive→eventual_response.directive(spec-validated), and directive omission for back-compat.Notes
SmooAI.SmoothOperator.CoreNuGet; this PR does not publish anything.minoron@smooai/smooth-operator-server).🤖 Generated with Claude Code