Conversation
✅ Deploy Preview for golemcloud canceled.
|
|
📖 Docs preview: https://docs-jfomthmh8-golem-cloud.vercel.app Built from commit |
# Conflicts: # sdks/effect/src/internal/reflection/schemaRender.ts # sdks/effect/test/schema-ref.test.ts # test-components/tool-streaming-moonbit/component/moon.pkg
# Conflicts: # cli/golem-cli/tests/app/mod.rs # sdks/moonbit/golem_sdk_example1/golem_moonbit_examples/golem_tools.mbt
| let __config_json = serde_json::to_value(&__config_value).map_err(|__e| crate::__golem_bridge_runtime::ClientError::InvocationFailed { message: format!("Failed to serialize config value: {__e}") })?; | ||
| agent_config.push(golem_client::model::AgentConfigEntryDto { | ||
| path: vec![#(#path_segments),*], | ||
| value: __config_json.into(), |
There was a problem hiding this comment.
[P2] Use the REST canonical codec for configuration, not the session codec
encode_generated_streamless_value uses the public invocation-session representation, but REST config reaches parse_worker_creation_agent_config in golem-worker-executor/src/worker/agent_config.rs, which decodes it with from_untrusted_json_value. Those representations differ for options, results, variants, and unions, including nested occurrences.
For example, Some("hello") is now sent as {"$option":"some","value":"hello"}, while the REST decoder expects "hello"; None becomes {"$option":"none"} instead of null; and Ok("hello") becomes {"$result":"ok","value":"hello"} instead of {"ok":"hello"}. I reproduced all three failures using the actual encoder and server-side decoder, so agent creation fails for these config values.
The TypeScript generator and Scala/MoonBit REST config encoders make the same substitution. Please encode REST config with its canonical JSON codec and keep the session codec for streaming requests. The new REST config tests cover wide integers, whose representations happen to match; add an option/result (ideally nested) case that feeds the generated config JSON into the server decoder.
Uh oh!
There was an error while loading. Please reload this page.