Skip to content

Forfeited by #89 revert: union defaultImpl fix + UpdateListen return-type shim + 2 regression tests #93

Closed

Description

@GregHolmes

The revert of #89 (PR #91) removed three hand-applied patches and two regression tests that are not carried forward on the re-land branch gh/sdk-gen-2026-08-11 (#92) and are not among #92's 17 reconciled patches. Filing so the next person to hit the symptom doesn't rediscover it from scratch. (Surfaced by review of #91.)

Forfeited patches

Verified on gh/sdk-gen-2026-08-11 — all three unions read defaultImpl = _UnknownValue.class, both tests absent:

  1. Union default-variant fix (defaultImpl = V2Value.class) on AgentV1UpdateListenListenProvider, AgentV1SettingsAgentListenProvider, AgentV1SettingsAgentContextListenProvider.
  2. AgentV1UpdateListenListen.getProvider() additive return-type shim (kept DeepgramListenProviderV2 read/write working over the union).
  3. Regression guards: AgentV1UpdateListenShimTest.java, AgentSettingsProviderDefaultTest.java.

Symptom the fix addressed

The three agent listen-provider unions declare version as an optional discriminator, so a provider object with no version is a valid payload (exactly what 0.7.x emits). Fern points @JsonTypeInfo defaultImpl at _UnknownValue, whose @JsonCreator has an empty body, so the incoming value is discarded: getProvider() returns null, re-serialization emits {"provider":null} (silent provider drop on the wire), and _getUnknown()/equals() throw NullPointerException.

Calibration

The two Settings unions carry this bug in released 0.7.1 — pre-existing, not a regression. So the revert restores the released behavior; it does not make anything worse for installed users. What is forfeited is the unreleased fix.

Decision needed

Whether to re-apply the defaultImpl = V2Value fix on #92 before it merges — #92 regenerates with the same generator (4.16.0) that produces the defect. Declining is defensible (status quo for the Settings unions), but should be a deliberate decision. Owner: @GregHolmes.

Activity

  1. GregHolmes commented on Aug 11, 2026

    @GregHolmes
    CollaboratorAuthor

    Resolved on gh/sdk-gen-2026-08-11 (#92, commit 7c5cf01):

    Re-applied — the silent-data-loss fix:

    • defaultImpl = V2Value on all three unions (AgentV1UpdateListenListenProvider, AgentV1SettingsAgentListenProvider, AgentV1SettingsAgentContextListenProvider), frozen in .fernignore + documented in AGENTS.md.
    • AgentSettingsProviderDefaultTest re-added as the regression guard (3 tests, passing). Version-less provider payloads now deserialize as V2 instead of {"provider":null}.

    Intentionally not re-applied — AgentV1UpdateListenListen.getProvider() return-type shim and AgentV1UpdateListenShimTest. The provider retype (DeepgramListenProviderV2 → AgentV1UpdateListenListenProvider union) is a deliberate breaking change for 0.8.0, documented in docs/Migrating-v0.7-to-v0.8.md and guarded by the union round-trip test in RegenTypesTest. Preserving the old return type would defeat that.

    Closing — all three items are now either fixed or a documented, tested decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions