golemcloud/golem/golem-streaming-agent-rust
- community
Checking that the SKILL.md file is still in the repository.
Declares, implements, and calls streaming Rust agent methods. Use for AgentStream input, output, nested streams, back-pressure, cancellation, generated RPC clients, bridge SDKs, or CLI streaming.
Install
npx vskill@latest install golemcloud/golem/golem-streaming-agent-rustSKILL.md
Streaming Agent Methods in Rust
Use golem_rust::agentic::AgentStream<T> in an agent method signature. A stream is a recursive schema value: it may be a direct parameter or result, or appear inside a record, tuple, option, result, variant, list, or another stream. Do not assign streams static or preorder slot numbers; the runtime carries each endpoint with the value that contains it.
Consume, Produce, and Forward
Read one item at a time with next().await. Ok(None) is normal close; Err is a decoding, transport, producer, or invocation failure, not EOF.
write_one and each element of write_all wait for downstream acceptance, so a producer cannot run arbitrarily ahead. Acceptance is back-pressure, not proof that user code processed the item. Dropping the writer closes normally. Dropping the reader cancels that stream cooperatively; a later write reports that the reader was dropped.
Return an unread input stream directly to forward its endpoint without collecting or copying it:
Streams are affine. Passing one into RPC, returning it, or forwarding it transfers ownership. Do not read, send, or clone aliases afterward. A partially consumed stream can be forwarded; the receiver reads its unread remainder. AgentStream::collect is convenient only for bounded streams; preserve streaming for large or unbounded data.
Ordering and Errors
- Items within one stream stay ordered.
- Independent sibling streams have no relative ordering guarantee. Drain them concurrently when
either producer could block on back-pressure.
- Bare agent streams have normal close but no recoverable terminal error payload. Use
AgentStream<Result<T, E>> for recoverable per-item or stream-local application errors.
- A producer panic, decode failure, transport failure, or fatal agent invocation failure fails the
active operation; it must not be treated as normal EOF.
- Dropping a stream is explicit consumer cancellation. It is distinct from an external transport
disconnect, which may only detach an observer while the durable invocation continues.
Calling Through Agent RPC
Definition clients and clients generated by golem build accept and return AgentStream values, including nested and sibling streams:
Generated guest clients provide schema-specific stream factories when a Rust type alone cannot identify the exact schema occurrence. Use those generated factories rather than constructing an ambiguous stream manually. Use awaited calls for stream-bearing methods. Definition-derived clients still expose trigger and scheduling helpers, but invoking them with streams is rejected at runtime (fallible paths return errors). CLI-generated guest clients omit these helpers for streaming methods. Stream-bearing constructors are rejected because client construction is synchronous.
For a native external application, declare bridge.rust.external in golem.yaml as described by the golem-call-from-external-rust guide. The generated client uses its exported affine AgentStream: create inputs with AgentStream::input, consume outputs with StreamExt, and call cancel() or drop an output when stopping early. A stream or call error reports producer, cancellation, transport, or invocation failure separately from clean end-of-stream.
CLI and MCP
The golem-invoke-agent-rust guide covers CLI invocation. - binds stdin to exactly one direct stream parameter; --stdin-format value|raw and --stdout-format value|raw control framing. Nested or multiple input streams require an SDK client. Structured output is a sequence of lifecycle documents, not one JSON object. Ctrl-C or disconnect detaches without cancelling the durable invocation; use --save-session and --resume-session to reconnect.
MCP uses Streamable HTTP as its transport, but it does not expose agent methods whose schemas contain agent streams. Keep an MCP-facing method stream-free or add a bounded adapter method.
Start and Verify
Start from the runnable Rust template, then build and invoke it:
For complete input, output, mixed, nested, sibling, forwarding, cancellation, and failure examples, see the repository's cross-language streaming RPC fixture.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinggolem-skills/skills/rust/golem-streaming-agent-rust/SKILL.md
Popularity
- Repository stars
- 1,513
- Repository forks
- 210
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/golemcloud/golem/golem-streaming-agent-rust)