{"record":{"id":"e0ddf40d3662fa6b","repo":"github/copilot-sdk","slug":"unknown-workspacedifffilechangetype-value-value","errorCode":null,"errorMessage":"Unknown WorkspaceDiffFileChangeType value: ${value}","messagePattern":"Unknown WorkspaceDiffFileChangeType value: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/sdk/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChangeType.java","lineNumber":37,"sourceCode":"    /** The {@code added} variant. */\n    ADDED(\"added\"),\n    /** The {@code modified} variant. */\n    MODIFIED(\"modified\"),\n    /** The {@code deleted} variant. */\n    DELETED(\"deleted\"),\n    /** The {@code renamed} variant. */\n    RENAMED(\"renamed\");\n\n    private final String value;\n    WorkspaceDiffFileChangeType(String value) { this.value = value; }\n    @com.fasterxml.jackson.annotation.JsonValue\n    public String getValue() { return value; }\n    @com.fasterxml.jackson.annotation.JsonCreator\n    public static WorkspaceDiffFileChangeType fromValue(String value) {\n        for (WorkspaceDiffFileChangeType v : values()) {\n            if (v.value.equals(value)) return v;\n        }\n        throw new IllegalArgumentException(\"Unknown WorkspaceDiffFileChangeType value: \" + value);\n    }\n}\n","sourceCodeStart":19,"sourceCodeEnd":40,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/java/sdk/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChangeType.java#L19-L40","documentation":"WorkspaceDiffFileChangeType.fromValue is the Jackson @JsonCreator used to deserialize a string into the enum. It iterates all declared enum constants and throws IllegalArgumentException when no constant's value matches the input string. This happens when the wire payload carries a change-type string the SDK's generated enum does not know (older/newer CLI version mismatch).","triggerScenarios":"Deserializing a JSON payload (e.g. workspace diff file change events) whose change-type field contains a string not present among the generated enum constants.","commonSituations":"CLI/server updated to emit a new diff change type while the Java SDK is an older generated version; manual construction with a typo'd value; passing raw strings from another API.","solutions":["Upgrade the Copilot Java SDK to a version whose generated WorkspaceDiffFileChangeType includes the new value.","Log the offending value (from the exception message) and check the SDK enum values for the expected constant.","Sanitize/normalize the incoming string before deserialization if it comes from your own code."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Set<WorkspaceDiffFileChangeType> known = EnumSet.allOf(WorkspaceDiffFileChangeType.class);\nif (raw != null && known.stream().noneMatch(v -> v.getValue().equals(raw))) {\n    log.warn(\"Unsupported diff change type: {}\", raw);\n}","typeGuard":null,"tryCatchPattern":"try {\n  WorkspaceDiffFileChangeType t = WorkspaceDiffFileChangeType.fromValue(raw);\n} catch (IllegalArgumentException e) {\n  log.warn(\"Ignoring unknown change type: {}\", raw);\n}","preventionTips":["Keep the Java SDK version aligned with the CLI version.","Log-and-skip unknown enum strings on non-critical event paths.","Pin dependency versions and regenerate generated enums on upgrades."],"tags":["java","enum","deserialization","generated-code"],"backgroundTag":"invalid-enum-value","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}