{"record":{"id":"1b77f23dbb9c57be","repo":"github/copilot-sdk","slug":"unknown-workspacediffmode-value-value","errorCode":null,"errorMessage":"Unknown WorkspaceDiffMode value: ${value}","messagePattern":"Unknown WorkspaceDiffMode value: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/sdk/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffMode.java","lineNumber":35,"sourceCode":"@javax.annotation.processing.Generated(\"copilot-sdk-codegen\")\npublic enum WorkspaceDiffMode {\n    /** The {@code unstaged} variant. */\n    UNSTAGED(\"unstaged\"),\n    /** The {@code branch} variant. */\n    BRANCH(\"branch\"),\n    /** The {@code session} variant. */\n    SESSION(\"session\");\n\n    private final String value;\n    WorkspaceDiffMode(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 WorkspaceDiffMode fromValue(String value) {\n        for (WorkspaceDiffMode v : values()) {\n            if (v.value.equals(value)) return v;\n        }\n        throw new IllegalArgumentException(\"Unknown WorkspaceDiffMode value: \" + value);\n    }\n}\n","sourceCodeStart":17,"sourceCodeEnd":38,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/java/sdk/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffMode.java#L17-L38","documentation":"WorkspaceDiffMode.fromValue is the Jackson @JsonCreator for the WorkspaceDiffMode enum. It throws IllegalArgumentException when the input string does not equal the value of any declared enum constant. The SDK cannot map the wire-format diff-mode string to a known enum constant.","triggerScenarios":"Deserializing a response/event containing a diffMode string not among the SDK's generated WorkspaceDiffMode constants, or calling fromValue directly with an unknown string.","commonSituations":"Version skew: the CLI emits a newly introduced diff mode while the Java SDK's generated enum predates it; typos when constructing values manually.","solutions":["Update the Java SDK to the version matching the connected CLI so the enum contains the new mode.","Inspect the exception message for the unknown value and compare against the SDK's declared constants.","If you control the payload, send only values supported by your SDK version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"boolean known = Stream.of(WorkspaceDiffMode.values()).anyMatch(v -> v.getValue().equals(raw));\nif (!known) log.warn(\"Unsupported diff mode: {}\", raw);","typeGuard":null,"tryCatchPattern":"try {\n  WorkspaceDiffMode mode = WorkspaceDiffMode.fromValue(raw);\n} catch (IllegalArgumentException e) {\n  log.warn(\"Unknown diff mode '{}', using default\", raw);\n}","preventionTips":["Upgrade SDK and CLI together so enums cover new wire values.","Validate wire values against EnumSet before deserializing.","Never construct enum values from unvalidated user input."],"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"}