Skip to content

Support streaming agent methods in generated guest bridges - #3838

Merged
vigoo merged 17 commits into
mainfrom
danielvigovszky/gol-511-generated-guest-bridges-support-streaming-agent-methods
Sep 11, 2026
Merged

vigoo merged 17 commits into
mainfrom
danielvigovszky/gol-511-generated-guest-bridges-support-streaming-agent-methods

Conversation

@vigoo

@vigoo vigoo commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Implement generated guest bridges for stream-bearing agent methods in Rust, TypeScript, Scala, and MoonBit. Components can use generated clients to invoke streaming methods through awaited Wasm-RPC without handwritten transport code.

  • Generate native AgentStream signatures, recursive stream-aware codecs, and schema-specific producer factories/adapters. Support nested streams, dynamically shaped values, and multiple sibling streams without fixed positional slots.
  • Preserve affine endpoint ownership and direct unread forwarding, with cleanup for partial conversion failures, aborted calls, and failed invocation starts. Omit triggered and scheduled variants for stream-bearing methods while preserving non-streaming and external bridge behavior.
  • Fix runtime defects exposed by cross-component tests: attachment slots colliding across consumers, loopback handles incorrectly entering foreign attachment control, local nested streams stalling on an attachment they cannot acquire, queued child drains being lost after parent completion, and unread resource drops failing to notify producers. Root production remains attachment-gated; nested production is admitted after its introducing parent item is committed.
  • Add shared generator fixtures, generated-client compilation and codec tests, and language-specific cross-component lifecycle E2Es. Wire the suites into the guest-bridge CI shard, document the contract, and provision the required guest toolchains in orb setup.

Resolves GOL-511

Validation

  • Rust formatting checks and git diff --check passed.
  • cargo clippy -p golem-cli -p golem-worker-executor --all-targets --no-deps -- -D warnings passed.
  • CLI generator unit tests: 57 passed.
  • Durable session/stream runtime unit tests: 84 passed.
  • Combined Rust, TypeScript, and MoonBit generated-client matrix: 4 passed, including executed schema-specific codec checks; Scala generated-client compilation also passed.
  • Cross-component E2Es passed in all four languages, including input/output streaming, direct forwarding and loopback, recursive/dynamic siblings, stream-of-stream values, producer failures, cancellation/readable drop, and backpressure coverage. All 5 TypeScript E2Es passed together against the updated runtime.
  • SDK validation included Rust 131 passed / 4 ignored, TypeScript 738 passed / 20 skipped, MoonBit 54 passed, and Scala core 608 passed plus targeted native stream tests. TypeScript and Scala guest runtime artifacts were rebuilt for runtime testing.
  • Focused Oracle reviews informed codec ownership, abort cleanup, and runtime admission/attachment decisions. Bounded bug reviews finished with no actionable findings.

Full repository CI and multi-executor deployment testing were not run locally.

vigoo and others added 12 commits September 6, 2026 15:03
Emit per-occurrence native stream codecs and preserve awaited cancellation.
Scope typed encoding and result decoding ownership, including nested item
handoff and failure cleanup. Add SDK, generated compile, and cross-component
coverage; the nested forwarding E2E retains its transport timeout assertion.

Amp-Thread-ID: https://ampcode.com/threads/T-01a07738-29c4-7319-bcbd-8433f4b9bcad
Co-authored-by: Amp <amp@ampcode.com>
@vigoo
vigoo requested a review from a team September 7, 2026 07:23
@netlify

netlify Bot commented Sep 7, 2026

Copy link
Copy Markdown

Deploy Preview for golemcloud canceled.

Name Link
🔨 Latest commit e812db8
🔍 Latest deploy log https://app.netlify.com/projects/golemcloud/deploys/6aa3fcfa7c15900008605bed

Comment thread golem-worker-executor/src/worker/mod.rs
@vigoo
vigoo merged commit 053d63a into main Sep 11, 2026
66 of 67 checks passed
@vigoo
vigoo deleted the danielvigovszky/gol-511-generated-guest-bridges-support-streaming-agent-methods branch September 11, 2026 13:29
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants