{"record":{"id":"0a56676a7096b80a","repo":"github/copilot-sdk","slug":"decode-elicitation-schema-property-q-property-mi","errorCode":null,"errorMessage":"decode elicitation schema property %q: property missing after conversion","messagePattern":"decode elicitation schema property %q: property missing after conversion","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/session.go","lineNumber":1238,"sourceCode":"\t}\n\twrapperData, err := json.Marshal(struct {\n\t\tProperties map[string]json.RawMessage  `json:\"properties\"`\n\t\tType       rpc.UIElicitationSchemaType `json:\"type\"`\n\t}{\n\t\tProperties: map[string]json.RawMessage{name: data},\n\t\tType:       rpc.UIElicitationSchemaTypeObject,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"marshal elicitation schema wrapper for property %q: %w\", name, err)\n\t}\n\n\tvar rpcSchema rpc.UIElicitationSchema\n\tif err := json.Unmarshal(wrapperData, &rpcSchema); err != nil {\n\t\treturn nil, fmt.Errorf(\"decode elicitation schema property %q: %w\", name, err)\n\t}\n\trpcProperty, ok := rpcSchema.Properties[name]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"decode elicitation schema property %q: property missing after conversion\", name)\n\t}\n\treturn rpcProperty, nil\n}\n\n// Confirm shows a confirmation dialog and returns the user's boolean answer.\n// Returns false if the user declines or cancels.\nfunc (ui *SessionUI) Confirm(ctx context.Context, message string) (bool, error) {\n\tif err := ui.session.assertElicitation(); err != nil {\n\t\treturn false, err\n\t}\n\trpcResult, err := ui.session.RPC.UI.Elicitation(ctx, &rpc.UIElicitationRequest{\n\t\tMessage: message,\n\t\tRequestedSchema: rpc.UIElicitationSchema{\n\t\t\tType: rpc.UIElicitationSchemaTypeObject,\n\t\t\tProperties: map[string]rpc.UIElicitationSchemaProperty{\n\t\t\t\t\"confirmed\": &rpc.UIElicitationSchemaPropertyBoolean{\n\t\t\t\t\tDefault: Bool(true),\n\t\t\t\t},","sourceCodeStart":1220,"sourceCodeEnd":1256,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/go/session.go#L1220-L1256","documentation":"The SDK decodes a UI elicitation (dialog) schema from the RPC wire format into its public schema type. After unmarshaling, it looks up the specific property by name in the converted schema's Properties map; this error means the requested property name was not present in the decoded schema even though JSON unmarshaling succeeded. It indicates the property name passed to the elicitation helper does not match any property the runtime actually sent, or the schema shape changed between SDK/runtime versions.","triggerScenarios":"Calling a Session elicitation helper (e.g. Elicit/Confirm-family) with a property `name` argument whose key is absent from `rpc.UIElicitationSchema.Properties` after conversion of the runtime-provided schema JSON.","commonSituations":"Typo in the property name; the dialog schema was updated server-side (renamed/removed a field) while the client still asks for the old key; mismatched SDK and native runtime versions producing a differently-shaped schema.","solutions":["Print/log the elicitation schema and confirm the exact property key exists before requesting it","Fix the property name argument to match the schema exactly (case-sensitive)","Upgrade the SDK and the runtime/CLI together so the elicitation schema shape matches","Guard with an existence check on schema.Properties[name] before use and handle absence gracefully"],"exampleFix":"// before\nprop, err := decodeElicitationProperty(name, wrapperData)\n// after\nvar rpcSchema rpc.UIElicitationSchema\n_ = json.Unmarshal(wrapperData, &rpcSchema)\nif _, ok := rpcSchema.Properties[name]; !ok {\n    return nil, fmt.Errorf(\"unknown elicitation property %q\", name)\n}\nprop, err := decodeElicitationProperty(name, wrapperData)","handlingStrategy":"validation","validationCode":"var probe rpc.UIElicitationSchema\nif err := json.Unmarshal(wrapperData, &probe); err == nil {\n    if _, ok := probe.Properties[name]; !ok {\n        return fmt.Errorf(\"elicitation property %q not in schema\", name)\n    }\n}","typeGuard":"func hasProperty(s rpc.UIElicitationSchema, name string) bool {\n    _, ok := s.Properties[name]\n    return ok\n}","tryCatchPattern":"prop, err := decodeElicitationProperty(name, data)\nif err != nil {\n    if strings.Contains(err.Error(), \"property missing\") {\n        return handleMissingProperty(name) // graceful fallback\n    }\n    return err\n}","preventionTips":["Keep property-name constants in one place shared with the schema definition","Log the full schema on mismatch to catch renames quickly","Pin SDK and runtime versions together in CI"],"tags":["go","schema","elicitation","rpc"],"backgroundTag":"schema-validation-failed","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"}