You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SDK: decode daemon stdlib-JSON timestamps and durations over HTTP #1631
The daemon HTTP surface marshals protobuf response structs with Go standard encoding/json. google.protobuf.Timestamp and google.protobuf.Duration therefore arrive as objects shaped like {seconds, nanos}. Protobuf-ES fromJson expects ProtoJSON strings such as an RFC 3339 timestamp or 1.5s duration.
The SDK currently passes these values directly to fromJson, causing ProtocolError responses against a real daemon for data containing these well-known types. Affected surfaces include session snapshots, schedules and fires, learning proposals, learned skills, and dream plans. The mismatch can occur in unary responses and streamed envelopes.
Direction
Normalize the two daemon wire shapes at the HTTP transport boundary before Protobuf-ES decoding. The normalization should be descriptor-guided rather than key-name guessing, handle nested messages, lists, and maps, preserve already-valid ProtoJSON strings, and avoid mutating the registered raw response.
Acceptance criteria
Valid stdlib-JSON Timestamp objects decode to the corresponding protobuf value.
Valid stdlib-JSON Duration objects decode to the corresponding protobuf value.
Normalization works recursively in nested messages, repeated fields, maps, unary responses, and streamed responses.
Existing ProtoJSON string representations continue to decode unchanged.
Malformed or out-of-range values still produce a typed protocol error rather than silent coercion.
Tests cover seconds as numbers and strings, nanos precision, negative durations, and raw JSON preservation.
Documentation and the SDK changelog describe the daemon response-format compatibility.
Activity