{"record":{"id":"d29d135a8b5ba8ce","repo":"router-for-me/CLIProxyAPI","slug":"select-claude-device-id-device-pool-has-d-entrie","errorCode":null,"errorMessage":"select Claude device ID: device pool has %d entries, want %d","messagePattern":"select Claude device ID: device pool has (.+?) entries, want (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/claude/identity.go","lineNumber":270,"sourceCode":"\t\t}\n\t\tif _, exists := seen[deviceID]; exists {\n\t\t\tcontinue\n\t\t}\n\t\tseen[deviceID] = struct{}{}\n\t\tdeviceIDs = append(deviceIDs, deviceID)\n\t}\n\n\tif changed {\n\t\tmetadata[ClaudeDeviceIDsMetadataKey] = append([]string(nil), deviceIDs...)\n\t}\n\treturn append([]string(nil), deviceIDs...), changed, nil\n}\n\n// SelectDeviceID returns the credential's sole device ID after validating the conversation session.\nfunc SelectDeviceID(deviceIDs []string, sessionID string) (string, error) {\n\tdeviceIDs = NormalizeDeviceIDPool(deviceIDs)\n\tif len(deviceIDs) != ClaudeDevicePoolSize {\n\t\treturn \"\", fmt.Errorf(\"select Claude device ID: device pool has %d entries, want %d\", len(deviceIDs), ClaudeDevicePoolSize)\n\t}\n\tsessionID = strings.TrimSpace(sessionID)\n\tif sessionID == \"\" {\n\t\treturn \"\", fmt.Errorf(\"select Claude device ID: session ID is empty\")\n\t}\n\treturn deviceIDs[0], nil\n}\n\n// ValidDeviceID reports whether a value matches Claude Code's lowercase 64-hex device format.\nfunc ValidDeviceID(value string) bool {\n\tif len(value) != claudeDeviceIDByteSize*2 || value != strings.ToLower(value) {\n\t\treturn false\n\t}\n\tdecoded, errDecode := hex.DecodeString(value)\n\treturn errDecode == nil && len(decoded) == claudeDeviceIDByteSize\n}\n","sourceCodeStart":252,"sourceCodeEnd":287,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/auth/claude/identity.go#L252-L287","documentation":"Error \"select Claude device ID: device pool has %d entries, want %d\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/auth/claude/identity.go:270 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the device pool configuration contains the expected number of entries.","Adjust the requested pool size or repopulate the Claude device ID pool."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}