Skip to content

Commit e580c42

Browse files
Update changelogs from fern repo (#4432)
Co-authored-by: patrickthornton <70873350+patrickthornton@users.noreply.github.com>
1 parent 6d8b3cc commit e580c42

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## 4.0.3
2+
**`(fix):`** Fix WebSocket `handleIncomingMessage()` using Fern-internal message IDs
3+
(e.g. `AgentV1Welcome`, `ListenV1Results`) instead of the wire discriminant
4+
values from the spec (e.g. `Welcome`, `Results`). This caused all incoming
5+
message handlers to never fire, falling through to the unknown type handler.
6+
7+
The generator now extracts wire discriminant values from each message body's
8+
`type` property — resolving literal values (e.g. `literal<"Welcome">`) and
9+
enum values (e.g. `enum[Flushed, Cleared]`) — and dispatches via a `switch`
10+
statement on those values. This aligns with the approach used by the Python
11+
generator.
12+
13+
14+
**`(fix):`** WebSocket handler registration methods and field names now use
15+
wire discriminant values instead of Fern-internal prefixed names. For example,
16+
`onAgentV1Welcome(handler)` is now `onWelcome(handler)`, and
17+
`onAgentV1PromptUpdated(handler)` is now `onPromptUpdated(handler)`. Methods
18+
that were already backed by a custom `x-fern-sdk-method-name` (e.g.
19+
`onFunctionCallResponse`) are unchanged.
20+
21+
22+
**`(chore):`** Improve generated WebSocket client code quality: use a string literal for
23+
static URL paths instead of `StringBuilder`, remove dead if/else branches in
24+
async `sendMessage()`, consolidate redundant catch blocks in message dispatch,
25+
and correct Javadoc articles ("a" vs "an") for type names starting with vowels.
26+
27+

0 commit comments

Comments
 (0)