Skip to content

Experimental Go SDK - #3719

Draft
noise64 wants to merge 156 commits into
mainfrom
go-sdk
Draft

Experimental Go SDK#3719
noise64 wants to merge 156 commits into
mainfrom
go-sdk

Conversation

@noise64

@noise64 noise64 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

No description provided.

noise64 added 24 commits July 27, 2026 11:03
@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for golemcloud canceled.

Name Link
🔨 Latest commit 4bc13f9
🔍 Latest deploy log https://app.netlify.com/projects/golemcloud/deploys/6a8ff54209f0df0008c39398

@noise64 noise64 changed the title Experinmental Go SDK Experimental Go SDK Jul 27, 2026
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

📖 Docs preview: https://docs-78f47pirq-golem-cloud.vercel.app

Built from commit fdc081f6a799ea8aa38036039a9fe2c76b2fe559 by docs.yaml.

noise64 and others added 9 commits August 12, 2026 17:39
instead of hardcoding go as bridge-less, the consistency tests now read
BridgeSdkTargetKind::supports; the matrix-pin test keeps an explicit
bridge-language set as its spec anchor.
group1 grew to 15 suites after main added tool_discovery, tipping the
8-vcpu job past its budget and timing out the in_function_retry tests.
moving our agent_sdk_go suite to the lighter group2 restores group1 to
main's green composition.
moving the suite to group2 did not fix the in_function_retry timeouts in
group1 (they fail at main's exact 14-suite composition too), so this
restores the original grouping; the timeouts are a separate p3 http-retry
issue under investigation.
local runs show the in_function_retry p3 suite passes (40/40, ~45s); its
ci timeouts are cumulative-load starvation in the oversized group1 job on
the 8-vcpu runner. keeping our suite off group1 returns it to main's
14-suite composition; the residual group1 overload is a pre-existing
main-side issue.
- Replace the ambiguous markerless-End replay path with explicit
  ReplayDeliveryDisposition (Immediate / AtMarker / AtReplayTail):
  a completed End without a delivery marker is only delivered after
  the recorded replay tail naturally exhausts, fixing replay of
  oplogs cut between End and CompletionDelivered
- Enforce and report the terminal-observer supersession invariant
- Default Oplog::add to enqueue_add, removing duplicated
  implementations from ephemeral/primary/multilayer/rate-limited/
  plugin oplogs
- Align with the simplified wasmtime terminal-observer API
  (TerminalConsumption::NotDelivered, FnOnce observers, centralized
  consume_terminal)
- Regenerate stale CompletionDelivered oplog bindings (TS, Scala,
  MoonBit)
- Pin wasmtime to golem-wasmtime-v46.0.1-p3, which now contains the
  merged fix

Amp-Thread-ID: https://ampcode.com/threads/T-01a01465-c723-73ce-9653-2a53cd32bc46
Co-authored-by: Amp <amp@ampcode.com>
resolve the crash-window fix collision by taking main's final version
(#3749) over our superseded first-version (d0badf1), per vigoo.

adapt the go sdk to main's merged changes:
- #3740 removed persistence mode: drop PersistenceLevel/WithPersistenceLevel
  from durability.go, bump golem:durability wit import to 1.6.0, regenerate
  bindings, update the atomic-block skill + doc
- #3712 agent permissions: pass None permission scope card on rpc calls
  (noScopeCard), unwrap the now-Result-returning config/webhook/schedule
  host functions fail-loud

permissioncard surface in the go sdk is a deferred follow-up.
@blacksmith-sh

This comment has been minimized.

noise64 added 15 commits August 24, 2026 23:53
adds a clock test agent (record-time/first-time) and an executor replay
test proving a wall-clock reading recorded in a live invocation is
reproduced from the oplog on replay after an executor restart, rather
than re-read as the current time — locking in the p3 clock-durability
fix for the go sdk.
wraps golem:durability@1.6.0 (main #3740): DurableOp[In,Out] records a
side effect once and replays its result from the oplog thereafter, over
DurableSpec + a DurableFunctionType enum (read/write local/remote +
batched/transaction constructors). fallible is implicit — Out may be a
golem.Result, encoded as a wit result by the general codec; a panic is a
retriable defect that drops the unfinished invocation.

native test for the type mapping; e2e CustomDurAgent + executor test
proving record-once/replay across a restart.
adds a 'Custom Durability for Libraries' section (mirrors the rust/ts
skills) covering golem.DurableOp, the DurableFunctionType policies, and
the Result-records / panic-retries semantics; regenerates the how-to doc.
- atomic-block skill now described as 'custom durability (DurableOp)'
  rather than the removed persistence-level knob (#3740)
- drop golem:rdbms/ignite2 from the retried-storage list (no go wrapper;
  out of scope)
adds KvAgent/BlobAgent/PromiseAgent test agents and four executor suites
exercising the sdk wrappers against the real host:
- keyvalue round-trip + a crash/replay assertion
- blobstore round-trip with size and listing
- promise await genuinely suspends the worker, then resumes on external
  completion (agent returns the oplog index; go's PromiseID field order
  differs from rust's, so positional extraction would be brittle)
- revert rolls a go agent's state back via recorded invocations
adds WsAgent (connect/send/receive/close) and SagaAgent plus their
executor suites:
- websocket echo against a tungstenite server, mirroring the ts test
- saga commit records only forward steps; a failing step rolls back and
  runs the already-succeeded step's compensation, asserted on the
  recorded step order

the saga agent records steps in state rather than over http: an outbound
http call inside a transaction currently traps with "cannot end atomic
region: non-re-executable durable calls initiated in it are still in
flight", which is tracked separately.
SnapAgent keeps its counter in an unexported field, so surviving a
snapshot-based recovery would prove the sdk calls the type's Save/Load.
the test is ignored: neither snapshot declaration works today —
SnapshotEveryN never causes the guest to be asked for a snapshot, and
SnapshotDefault traps on agent creation, while the rust control test
passes under the same executor policy.
the ignored snapshot test now records what was actually verified: enabling
snapshotting on a go agent fails at worker creation with a wasm trap (no
guest stderr) and no snapshot oplog entries, while other go agents in the
same component work and the rust control passes under the same policy.

ruled out: the Snapshotter path (a plain exported-field state fails
identically), the policy->metadata mapping, saveState/loadState, and the
component's save/load-snapshot exports. also corrects an earlier note that
claimed the guest is never asked to snapshot — that was inferred from a log
line the executor does not emit.
golem.Atomically with an outbound http.Get traps with "cannot end atomic
region: non-re-executable durable calls initiated in it are still in
flight" — a 3.5s repro that isolates the saga failure to atomic regions
rather than the transaction machinery.

the test records the executor mechanism (atomic regions hold a weak lease
per durable call; a surviving non-repairable lease blocks the close) and
the three fixes that did not work, so the next attempt does not repeat
them.
brings #3765 (wasmtime 9f2c0b4a -> 252ab61f) and #3767 (extract durable
call session coordination), which touch the monotonic-clock and
completion-delivery machinery behind our three parked tests. clean merge,
no conflicts.

verified after rebuild: the 8 passing go tests still pass, but all three
parked failures reproduce on the newest executor + fork — so they are not
stale-merge artifacts. the snapshot failure's symptom moved from the
monotonic_clock oplog mismatch to a hang.
it hangs while replaying the recorded call after a restart (3/3 locally
and in ci), including on the newest tree and with pr #3771 applied. the
doc comment records the observations only; the suite is green with three
ignored tests so the go sdk pr is not blocked on them.
GOL-485 covers the two replay-divergence failures (outgoing-http replay
hang, snapshotting breaking worker creation); GOL-486 covers outbound
http inside an atomic region.
a probe test shows a cross-agent RPC inside golem.Atomically settles and
the region closes normally, so GOL-486 is specific to outbound http. the
atomic-block skill no longer lists http calls as something to group, and
both it and the transactions skill carry a short caveat with the
workaround; docs regenerated.

keeps the probe as passing coverage and renames atomic_http.rs ->
atomic_region.rs, which is what the file now covers.
adds a SchedulerAgent (Method.Schedule + ScheduledInvocation.Cancel) and a
retry-callback method on HttpAgent, with executor suites:
- a scheduled cross-agent increment runs on its own; a cancelled one never
  does (polling the target counter for the effect)
- a retry.StatusCode policy makes the host re-issue a failing request
  transparently, and the endpoint is hit exactly once per attempt

this closes the batch-2 remainder; rdbms (docker) is the last wrapper
without executor coverage.
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.

2 participants