Skip to content

fix(rust): align runtime with spec + add Rust docs#342

Merged
sethjuarez merged 2 commits into
mainfrom
sethjuarez/prepare-rust-cargo-publish
Apr 13, 2026
Merged

fix(rust): align runtime with spec + add Rust docs#342
sethjuarez merged 2 commits into
mainfrom
sethjuarez/prepare-rust-cargo-publish

Conversation

@sethjuarez

@sethjuarez sethjuarez commented Apr 11, 2026

Copy link
Copy Markdown
Member

Summary

Two changes in this PR:

1. Fix Rust spec compliance (8 violations)

Audited the Rust runtime against \spec/spec.md\ and fixed 8 spec violations:

Spec Section Fix
§7.1.2 Audio MIME fallback strips prefix instead of defaulting to wav
§8.1 Anthropic structured output falls back to raw string on parse failure
§10.3 Streaming refusal emits \StreamChunk::Error\ and stops stream
§13.1 Added \StreamChunk::Thinking\ variant + Anthropic thinking events
§13.1 Status event emission for steering injection
§13.1 \messages_updated\ emitted after context trim and steering drain
§13.1 Event callbacks wrapped in \catch_unwind\ for panic safety
§13.5 Steering made thread-safe with \Arc<Mutex>\

All 484 Rust tests pass, clippy and fmt clean.

2. Add Rust to documentation site

Adds Rust as a 4th language tab across the entire docs:

  • *\implementation/rust.mdx* — dedicated Rust runtime page
  • *\docs-examples/rust/* — compilable example files
  • 126 Rust <TabItem>\ blocks across 35 pages
  • Tab order: Python → TypeScript → C# → Rust
  • Gaps honestly documented (embeddings, images, responses API, MCP/OpenAPI tools)


pm run build\ passes — 120 pages, all links valid.

sethjuarez and others added 2 commits April 10, 2026 20:51
Fixes 8 spec violations found during audit against spec/spec.md:

- §7.1.2: Audio MIME fallback strips prefix instead of defaulting to wav
- §8.1: Anthropic processor falls back to raw string on JSON parse failure
- §10.3: Streaming refusal raises error via StreamChunk::Error, stops stream
- §13.1: Add StreamChunk::Thinking variant, emit Thinking events from Anthropic
- §13.1: Add Status event emission for steering injection
- §13.1: Emit messages_updated after context trim and steering drain
- §13.1: Wrap event callbacks in catch_unwind for panic safety
- §13.5: Make Steering thread-safe with Arc<Mutex<VecDeque>>

All 484 tests pass, clippy and fmt clean.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add Rust as a 4th language tab across the entire documentation site:

- Create implementation/rust.mdx with installation, API overview,
  crate structure, async patterns, and current limitations
- Create docs-examples/rust/ with compilable example files
- Add Rust TabItem to 126 code blocks across 35 documentation pages
- Update implementation/index.mdx with Rust in the runtimes table
- Update welcome.mdx and getting-started pages to mention Rust
- Honestly document implementation gaps (embeddings, images,
  responses API, MCP/OpenAPI tools not yet supported)

Tab order: Python → TypeScript → C# → Rust

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sethjuarez sethjuarez changed the title fix(rust): align runtime with prompty spec fix(rust): align runtime with spec + add Rust docs Apr 11, 2026
@sethjuarez
sethjuarez merged commit 5314a99 into main Apr 13, 2026
13 checks passed
@sethjuarez
sethjuarez deleted the sethjuarez/prepare-rust-cargo-publish branch June 9, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant